# checkpoints()

Canonical URL: https://developers.iagenify.com/sdk/ref/local-agent/checkpoints/
Language: en

`agent.checkpoints() → Promise<Point[]>`

Where you can go back to, oldest first — with what each point holds and what going back to it would not undo.

Status: free · needs a session · 20 at most

```javascript
const points = await agent.checkpoints();
// [{ n: 1, at: "2026-10-07T09:12:44.000Z", text: "Rename every component…",
//    files: 184, partial: false, outside: [] },
//  { n: 2, at: "…", text: "Now update the imports.",
//    files: 184, partial: false, outside: ["write_storage"] }]
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `n` | integer |  | The message number. `rewind(n)` takes this. |
| `at` | string |  | When the snapshot was taken. |
| `text` | string |  | The message it precedes. |
| `files` | integer |  | How many files the point records. |
| `partial` | boolean |  | The workspace was larger than the snapshot could hold. |
| `outside` | string[] |  | **What left the machine after this point** — a rewind will not undo it. |

## outside is what to show before offering a rewind {#outside}

> **Warn before, not after**
>
> If outside is not empty, something happened that going back does not reverse — a message sent, a site published, a storage written, a command run. Saying so before the click is the difference between a choice and a surprise.

```javascript
const target = points.find((p) => p.n === 2);
if (target.outside.length) {
  console.warn("Going back will not undo:", target.outside.join(", "));
}
```

## An empty list {#empty}

| Why | Then |
| --- | --- |
| No session | `rewind()` answers `session_required` |
| `checkpoints: false` | `checkpoints_disabled` |
| A subagent | It keeps none |
| Compaction removed the messages | Points below the surviving conversation are forgotten |

## Twenty {#retention}

The last twenty messages of a session stay replayable. Older points are dropped, and their stored content is collected once nothing refers to it.

- [rewind()](/sdk/ref/local-agent/rewind): Going back.
- [How snapshots work](/sdk/agent/checkpoints/snapshots): What a point holds.

```python
points = agent.checkpoints()
# [{"n": 1, "at": "2026-10-07T09:12:44Z", "text": "Rename every component…",
#   "files": 184, "partial": False},
#  {"n": 2, "at": "…", "text": "Now update the imports.",
#   "files": 184, "partial": False}]
```

```python
target = next(p for p in points if p["n"] == 2)
if target["partial"]:
    print("Some files were not copied: going back will not restore them.")
```
