Undo: rewind and checkpoints
Before Claude edits a file, it saves what was there. That is what makes it reasonable to let it try something.
A checkpoint is captured at every prompt you send, not at every edit, and Claude Code keeps the file snapshots for the hundred most recent checkpoints in a session. They are saved with the conversation, so they still work after you resume a session tomorrow.
The rewind menu
/rewind, or press Esc twice while the input is empty. If there is text in the input, a double Esc clears that instead, and the cleared text goes into your input history so Up brings it back.The menu lists every prompt you sent in the session. Pick a point, then pick what to do with it.
| Choice | What it does |
|---|---|
| Restore code and conversation | Both go back to that moment |
| Restore conversation | The chat goes back, your files stay as they are |
| Restore code | The files go back, the conversation stays |
| Summarize from here | Compress everything after that point into a summary |
| Summarize up to here | Compress everything before it, keep the recent messages |
The two restore-code options only appear when that checkpoint actually has file changes to undo. The separation is the useful part: undoing the code while keeping the conversation lets you say that approach was wrong, try the other one without re-explaining the problem.
The part that catches people
Checkpoints cover the file editing tools. They do not cover what a shell command did. If Claude ran a script that rewrote a file, or a migration, or git checkout, rewinding will not put any of that back.
There is also a quieter limit worth knowing: snapshots are swept after about thirty days by default, so rewinding a very old session can find the conversation intact and the files gone.
- Ask for a change you do not want, then rewind the code and keep the conversation.
- Open
/rewindin a long session and read the list of your own prompts. It is a good record of how the work actually went.
Little by little, you're building something great.