# What a rewind cannot undo

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

The workspace goes back. The world does not. Five tools act beyond the machine, and a rewind names them instead of implying otherwise.

Status: 5 outside tools · credits are not refunded · compaction closes the door

## The five that leave the machine {#outside}

| Tool | What stays done |
| --- | --- |
| `send_mail` | The message is delivered. |
| `deploy` | The site is online. |
| `write_storage` | The database or bucket is changed. |
| `workflow` | A workflow was created, changed or run. |
| `bash` | A command may have pushed, published or called anything. |

Each one used after a point is recorded, and `rewind()` returns them as `kept`. The listing from `checkpoints()` carries the same thing per point as `outside`, so an interface can warn *before* the rewind rather than report after it.

```javascript
const points = await agent.checkpoints();
const target = points.find((p) => p.n === 2);

if (target.outside.length) {
  console.warn("Going back will not undo:", target.outside.join(", "));
}
```

## Credits are not refunded {#credits}

`credits.spent` says what the removed turns cost and `credits.refunded` is `0`. The work was done and billed; a rewind is a change of mind, not a cancellation.

## Compaction closes the door behind it {#compaction}

> **You cannot cut a conversation at a message that no longer exists**
>
> Compaction replaces the older part with a summary, so points before the first surviving message are forgotten rather than offered. Rewinding to one answers checkpoint_compacted and names what is still available.

## The refusals {#errors}

| Code | Status | When |
| --- | --- | --- |
| session_required | 400 | The agent has no session — `memory: true` is needed. |
| agent_running | 409 | It is answering. `stop()` first. |
| invalid_checkpoint | 400 | `n` is not a whole number of at least 1. |
| checkpoints_disabled | 400 | `checkpoints: false`. |
| checkpoint_compacted | 404 | That message was summarised away. The message names what is left. |
| checkpoint_not_found | 404 | No such message in this session. |

## And some files simply cannot go back {#files}

- A file over 25 MB was recorded, not copied — `skipped` says so.
- A workspace over 5 000 files makes the point `partial`.
- A heavy folder that existed is left as it is, with whatever is now in it.
- A file that cannot be written — locked, in use — is reported rather than retried.

All four land in `files.skipped` with a reason. A rewind that skipped nothing restored everything; one that skipped something says exactly what.

- [How snapshots work](/sdk/agent/checkpoints/snapshots): Where the bounds come from.
- [Compaction](/sdk/agent/context/compaction): The other thing that removes messages.

```python
points = agent.checkpoints()
target = next(p for p in points if p["n"] == 2)

if target["partial"]:
    print("Some files could not be copied: going back will not restore them.")
# What went out (a sent message, a deploy) is never undone by a rewind.
```
