<!-- Markdown mirror. Canonical: https://empryo.com/docs/tools/checkpoints -->

# Checkpoints

> Undo, redo and rewind agent work. Step back through past turns, restore files and conversation, or try a different approach from any earlier point.

Checkpoints let you undo what the agent did. Every time you send a prompt and the agent finishes responding, Empryo saves a checkpoint. You can look back at any of them, undo to one, or start over from an earlier point with a new message.

Use them when the agent went in the wrong direction and you want to return to where things were good.

## Look back

In the terminal UI, press `Ctrl+B` to step back one checkpoint and `Ctrl+F` to step forward.

| Shortcut | Action |
|----------|--------|
| `Ctrl+B` | View the previous checkpoint |
| `Ctrl+F` | View the next checkpoint, or return to live |

While you're viewing a past checkpoint, later messages are dimmed and a marker appears:

```
↶ Viewing checkpoint #2, send a message to rewind here.
```

Looking is read-only. No files change. Press `Ctrl+F` past the last checkpoint to go back to live.

## Try again from an earlier point

Send a message while you're viewing a past checkpoint, and the conversation continues from there. The model forgets everything after that point. The later messages stay visible, dimmed, so you can still read them.

This is the quickest way to recover from a wrong turn: go back to the last good point and ask for something different.

## Undo and redo

`/checkpoint undo` reverts the last checkpoint. It rewinds the conversation and restores the files the agent changed.

| Command | What it does |
|---------|-------------|
| `/checkpoint` | List all checkpoints |
| `/checkpoint N` | View checkpoint N |
| `/checkpoint live` | Return to the live view |
| `/checkpoint undo` | Undo the last checkpoint |
| `/checkpoint undo N` | Undo back to checkpoint N |
| `/checkpoint redo` | Redo the last undone checkpoint |
| `/checkpoint save` | Save the current state as a git tag now |

Undone turns stay in the chat, dimmed, below a marker:

```
↶ Rewound past this point.
```

> **Note:**
> Sending a new message after an undo clears the redo history, like undo in any editor.

## The checkpoint rail

A narrow rail along the right edge of the chat shows one mark per checkpoint. The terminal UI and the desktop app both have it.

- A spinner marks the checkpoint that's still running.
- The latest checkpoint is drawn as a diamond.
- A filled dot means that turn edited files. A hollow dot means it didn't, or that it was undone.
- The checkpoint you're currently viewing is highlighted.

If there are more checkpoints than fit, `+N` counts show how many are hidden above and below. The rail scrolls to follow you.

## How files are restored

When a turn that edited files finishes, Empryo tags that state in git. Undo restores only the files edited in the turns you undid. Other files, including ones another tab is working on, are left alone.

> **Note:**
> **No git repository?** You can still look back and rewind the conversation. Files are not restored, so the agent works from the rewound conversation instead.

## Sessions and tabs

Checkpoint tags are saved with the session and come back when you reopen it. Deleting a session removes its tags.

Each tab has its own checkpoint history. Undoing in one tab doesn't affect any other tab.

## Messages sent while the agent works

If you type a message while the agent is still working (steering), it doesn't create a new checkpoint. It becomes part of the checkpoint that's running.
