What Claude Code's Checkpoints Actually Are
Claude Code checkpoints are automatic save points inside a single session. Every user prompt you send creates a new checkpoint, capturing the state of the files Claude has touched before that prompt runs. You don't have to ask for it and you don't have to configure anything. It just happens in the background every time you type a message.
Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. Checkpoints are saved with the conversation itself, not held in memory, so you can quit, come back later, run /resume, and /rewind is still available on that session's history. By default, the session gets cleaned up and its checkpoints deleted after 30 days, though that period is configurable through the cleanupPeriodDays setting.
How to Actually Use /rewind
Run /rewind, or press Esc twice when the prompt box is empty, and Claude Code opens a menu listing every prompt you sent in the session. Pick a point in that history and you get a choice of what to do with it.
- Restore code and conversation - reverts both the files and the chat back to that point.
- Restore conversation - rewinds the chat to that message while leaving your current files untouched.
- Restore code - reverts the file changes while keeping the full conversation, including everything Claude learned along the way.
- Summarize from here / Summarize up to here - compresses part of the conversation into a summary to free up context, without touching any files on disk.
The two code-restore options only show up when the checkpoint you picked actually has tracked file changes to undo. If nothing changed on disk after that point, Claude Code just shows the conversation and summarize options, because there's nothing to revert.
The Two-Layer Undo: Checkpoints vs Git
I think about recovery in Claude Code as two layers, and confusing them is where builders get burned. Checkpoints are the fast layer: automatic, zero setup, undoes the last 20 minutes of a session in two keystrokes. Git is the durable layer: manual, deliberate, and the only one that survives past the session, the 30-day cleanup, and a laptop getting wiped.
The Two-Layer Undo
| Checkpoints (/rewind) | Git commits | |
|---|---|---|
| Created | Automatically, every prompt | Manually, when you choose to commit |
| Scope | One Claude Code session | The whole project, forever |
| Survives a new session or /clear | Yes, if you don't exceed 100 checkpoints | Yes, always |
| Survives 30+ days | No, deleted with the session by default | Yes, permanent history |
| Tracks Bash-run changes (rm, mv, cp) | No | Yes, if you commit after |
| Shareable with a teammate | No | Yes, push and pull |
Neither layer replaces the other. Checkpoints are for the mistake you catch in the same session, thirty seconds after Claude went the wrong direction. Git is for the state you need to be able to get back to next week, next month, or after someone else has touched the repo.
Where Rewind Can't Save You
This is the part that actually matters and the part most quick explainers skip. Checkpointing only tracks edits Claude makes through its own file-editing tools. Several common situations fall outside that, and knowing them up front is what keeps /rewind from becoming a false sense of security.
- Bash-run file changes aren't tracked. If Claude runs rm file.txt, mv old.txt new.txt, or cp source.txt dest.txt through a Bash command, none of that is undoable through /rewind. Only edits made through Claude's direct file-editing tools are captured.
- Most subagent edits aren't restored. When a subagent applies file changes, those land outside your session's checkpoints, so rewinding doesn't restore them even though the subagent used the same file-editing tools. You have to use Git to revert those.
- Manual edits and other concurrent sessions aren't tracked. If you open a file yourself and change it outside Claude Code, or another session touches the same file, checkpointing generally doesn't capture that.
- Symlinked and hard-linked files are skipped on restore. Claude Code will warn you it 'restored the code, but skipped N files' rather than silently leaving them wrong, but it won't undo them for you.
My Actual Workflow: When I Use Each
In practice the split is simple. I lean on /rewind constantly during the session itself: Claude takes a wrong turn on an approach, I hit Esc twice, restore code to two prompts back, and redirect without losing the rest of the conversation. It's faster than a git reset for something that small and it keeps my thinking intact.
The Git layer is non-negotiable before anything risky. I still follow the Checkpoint Habit from my Git workflow: commit before I let Claude touch a file, work on a branch, review the diff before I accept it. That habit is what protects me from the exact gaps above - a Bash command that deletes something, a subagent edit that lands outside the session, a mistake I don't catch until tomorrow when the session's 30-day clock has already started ticking.
If you're also running sessions unattended, this matters even more. My Leash Loop for unattended runs assumes a human reviews the diff afterward - and that review only means something if there's a real Git history to diff against, not just a session that might get cleaned up in a month.
Inside Claude Code Club
This is exactly the kind of detail that separates 'I read the docs once' from 'I know where this breaks on a real project.' Inside Claude Code Club we compare the recovery habits that actually hold up on client work, not just the demo-friendly version. Start with the [curriculum](/curriculum) or join us at https://www.skool.com/claudecodeclub/about for $9/month and bring the session that made you wish you'd committed sooner.
Short, practical drops on skills, MCP, agents, prompts, and more. No spam, unsubscribe anytime.
Frequently asked questions
How many checkpoints does Claude Code keep?
Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. A new checkpoint is created automatically on every user prompt, so a long session can use up that budget faster than you'd expect.
Do checkpoints expire?
Yes. Claude Code deletes checkpoints along with the session after 30 days by default. That period can be changed with the cleanupPeriodDays setting, but the default means checkpoints are not a long-term backup.
Can /rewind undo a file that Claude deleted with a Bash command?
No. Checkpointing only tracks edits made through Claude's file-editing tools. Changes made through Bash commands like rm, mv, or cp are not captured, so /rewind can't bring those files back. Git is the only layer that protects you there, if you committed before the command ran.
Is /rewind a replacement for Git?
No, and Claude Code's own documentation says so directly: checkpoints are local, session-level undo, while Git is permanent version history. Checkpoints are excellent for quickly reverting the last few minutes of a session. They are not built for long-term history, collaboration, or surviving past the 30-day cleanup window.
Where can I learn the recovery habits that hold up on real client work?
The Claude Code Club is where builders compare the workflows that actually survive contact with a real project, including exactly how to combine checkpoints with a proper Git habit. Join for $9/month at claudecodeclub.ai.
Last reviewed by David Iya on August 5, 2026


