Claude Code can rewind a session. Press Esc twice with an empty prompt, or run /rewind, pick an earlier prompt, and restore the code, the conversation or both. For a quick undo of the last few edits, that works well. It is not a backup, and the gaps matter when the files are client work, price lists, templates or records someone else depends on.
We checked the Claude Code checkpointing documentation on November 8, 2026. The points below come from that page.
What rewind covers
- Files that Claude edits with its own file tools. Claude Code saves a checkpoint before each prompt that starts a turn.
- The 100 most recent checkpoints in a session. Older checkpoints lose their snapshot files.
We'll list the folders an agent can reach, check what each backup covers, and set the restore test before the next run.
What rewind does not cover
- A file that only Bash commands change. Once Claude has edited a file with its file tools, a rewind also undoes Bash changes to that file afterward. A file that only Bash has touched is not tracked, and it stays as it is.
- Edits from most subagents. A background subagent can change files that Claude never edited in the conversation, and rewind leaves those changes in place.
- Changes made outside the session. Manual edits and edits from another session stay put unless they touch the same files.
- Symlinked and hard-linked files. Rewind skips them and shows a warning. They keep their current contents.
- Snapshots after the retention window. Claude Code deletes a session's file snapshots in its retention sweep, by default about 30 days after the session last saved one. A rewind to a checkpoint whose snapshots are gone can fail with "No files were restored." The cleanupPeriodDays setting extends the period.
The documentation says the same thing in its own words: checkpoints are for quick, session-level recovery, and version control is still the place for permanent history.
What a real backup must cover before an agent touches files
- 1Every business file the agent can reach. That includes the exports, templates, configuration and spreadsheets next to the code, not only the repository.
- 2A history the agent's session does not manage. A git repository pushed to a host you control works. So does a dated copy in storage with its own retention.
- 3A starting point you can name. Commit or copy the folder before the agent starts, so the agent's work is the difference between two known states.
- 4A retention period longer than a review cycle. Thirty days is short for a client file that someone checks next quarter.
- 5One restore you have tested. Pick a file, restore it from the backup into a scratch folder, and open it. A backup you have never restored is a guess.
- 6A separate place for work you cannot afford to lose. Have the agent write to a branch or a copy, then review the diff before anything reaches the live folder.
Where rewind fits
Rewind is an undo inside one session. A backup answers a different question: what did these files look like last Tuesday, and can we get them back if the session is gone or the snapshots have expired? Keep both. Use rewind for the mistake you spot now, and use the backup for everything else.
Limits on what an agent may change belong in the approval design. The agent action budgets guide covers those limits, and the AI agent governance checklist covers who approves what. If agents already edit files your business relies on, we can set up the repository, the backup and the review steps as part of custom development.
Before the next session that touches business files, restore one file from the backup into a scratch folder and open it.
