# How snapshots work

Canonical URL: https://developers.iagenify.com/sdk/agent/checkpoints/snapshots/
Language: en

Content is stored once per fingerprint and a point is only a list of paths. That is what makes a snapshot per message affordable — and what decides the few things it does not copy.

Status: .iagenify-checkpoints · deduplicated · 20 kept

## The store {#store}

```bash
.iagenify-checkpoints/
  objects/ab/cdef…        one distinct content, stored once
  <session>/0003.json     point 3: { at, text, files, folders }
```

It lives **inside the workspace**, so it counts against the same quota as the files it protects, and it travels with them. An unchanged workspace costs a few kilobytes per point — only the list is new.

## What is never in a point {#excluded}

| Left out | Why |
| --- | --- |
| `.iagenify-checkpoints/` | The store itself. |
| `.sessions/` | The [device journal](/sdk/agent/sessions/journal). Restoring a point that predates it would delete the record of the conversation. |

## Heavy folders are noted, not copied {#heavy}

`node_modules`, `.git`, `dist`, `build`, `.next`, `venv`, `__pycache__` and their kin: the point records whether the folder existed, not what was in it. Hashing them every message would cost minutes.

| At the point | On rewind |
| --- | --- |
| The folder existed | Left exactly as it is — an install is additive. |
| The folder did not exist | Removed in full. |

## Three bounds {#limits}

| Bound | Value | What happens above it |
| --- | --- | --- |
| File size | 25 MB | Recorded with its size and date, not copied. Listed in `skipped`. |
| File count | 5 000 | The point is marked `partial`. |
| Depth | 12 levels | Deeper paths are not walked. |

`checkpoints()` carries `partial` per point, and a `checkpoint_partial` event is emitted at the time with the list of what was skipped — so a partial point is known before it is relied on.

## What a restore does {#restore}

- Files whose content differs are rewritten from the store.
- Files that existed then and are gone now are recreated.
- Files that did not exist then are deleted.
- Anything that could not be put back lands in `skipped`, with a reason.

## Twenty points {#retention}

The last 20 messages of a session stay replayable; older points are dropped and their content is collected when nothing refers to it any more. Compaction forgets points below the surviving conversation as well.

- [What a rewind cannot undo](/sdk/agent/checkpoints/limits): Beyond the files.
- [checkpoints()](/sdk/ref/local-agent/checkpoints): Listing them.
