Checkpoints & Rewind
- Understand what a checkpoint captures — and what it silently does not
- Open the rewind menu two ways and pick the right restore action every time
- Tell 'restore' (undo state) apart from 'summarize' (compress context)
- Know exactly why checkpoints complement Git but never replace it
The big idea
When you turn Claude loose on an ambitious, wide-scale change, the scariest question is "what if it goes wrong three edits deep?" Checkpointing is the answer: Claude Code automatically snapshots your code before each edit, so you can rewind to any earlier state instead of untangling a half-finished refactor by hand.
Think of it as a local undo for the whole session — a safety net that lets you say "yes, try the bold approach" without fear.
How checkpoints are created
You don't create checkpoints — they happen automatically.
- Each user prompt captures the state of your code before Claude's file-editing tools run. No command, no config, no ceremony.
- Checkpoints survive quitting and resuming a conversation, so you can rewind in a resumed session, not just the live one.
- Checkpoints are removed alongside their session after 30 days (configurable). They are session-level recovery, not an archive.
Opening the rewind menu
There are two ways in:
- Type the slash command from the prompt. Always works.
- Double-Esc opens the rewind menu when the prompt box is empty. If there's text in it, double-Esc clears that text instead (the cleared text is saved to input history, so press Up to get it back afterward).
Open the rewind menu
/rewind
The menu lists every prompt you sent this session. Pick the point you want to act on, then choose one action.
Restore vs. summarize: the key distinction
This is where people get confused. The menu offers two kinds of action:
- Restore actions change state on disk and/or in the conversation — they undo.
- Summarize actions never touch your files — they compress conversation to free up context window space.
- Restore = undo (reverts code, conversation, or both). Summarize = compress context (files on disk are untouched).
- Reach for restore when an edit broke something. Reach for summarize when the session is bloated but the code is fine.
The restore actions
- Revert both your files and the chat history to the selected point — a clean 'rewind time' to that moment.
- Rewind the chat to that message but keep your current code. Useful to re-ask a question without losing edits you want to keep.
- Revert file changes but keep the conversation. Undo the edits, keep the discussion about them.
After restoring the conversation (or choosing "Summarize from here"), the original prompt from the selected message is dropped back into the input field so you can re-send or edit it.
The summarize actions
Both compress part of the conversation into an AI-generated summary — like a targeted /compact where you choose which side of the selected message to squeeze.
- Messages BEFORE the selected message stay intact. The selected message and everything after it become a summary. Use it to discard a side discussion while keeping early context in full detail.
- Messages BEFORE the selected message become a summary; the selected message and everything after stay intact. You remain at the end of the conversation. Use it to compress early setup chatter while keeping recent work verbatim.
The original messages stay in the session transcript either way, so Claude can still reference the details. You can type optional instructions to steer what the summary focuses on.
For the whole flow, see Context Management — /rewind's summarize actions are a scalpel where /compact is a broad brush.
Rewinding past a /clear
If you ran /clear earlier in the same Claude Code process, the rewind menu shows an extra entry at the top: /resume <session-id> (previous session). Select it to jump back to the conversation that was active before /clear.
Where checkpoints stop — the limits that bite
Checkpoints feel magical until they don't. Three gaps matter:
- Files touched by shell commands Claude runs — rm, mv, cp, code generators, formatters — are NOT tracked. Only direct edits through Claude's file-editing tools are checkpointed. A deleted file from rm is gone as far as rewind is concerned.
- Manual edits you make outside Claude Code, and edits from other concurrent sessions, are normally not captured — unless they happen to touch the same files the current session edited.
- Checkpoints are quick, local recovery. They are not commits, not branches, and not shareable with your team.
Checkpoints vs. Git: use both
They solve different problems, so pair them.
Checkpoints (/rewind) | Git | |
|---|---|---|
| Scope | One session | Whole project history |
| Granularity | Per prompt, automatic | Per commit, deliberate |
| Tracks bash-made changes? | No | Yes (once staged/committed) |
| Lifespan | ~30 days, then gone | Permanent |
| Shareable / collaborative | No | Yes |
| Mental model | "Local undo" | "Permanent history" |
- Commit working states with Git before a risky, wide-scale run — that's your durable floor.
- Use /rewind for fast in-session recovery between commits without polluting your Git history.
- If Claude will run destructive bash (rm/mv) or generators, lean on Git — rewind won't save those files.
When to reach for it
- Try a bold implementation, and if you don't like it, restore code and conversation to the fork point and try another.
- An edit introduced a bug three prompts ago? Restore code to just before it instead of debugging the debris.
- Experiment with variations, always knowing a known-good state is one /rewind away.
- A verbose debugging detour ate your context window? Summarize from the midpoint forward and keep your original instructions in full detail.
Check yourself
0/3- Checkpoints are automatic, per-prompt snapshots of your code — a local undo for the whole session, kept about 30 days.
- Open the rewind menu with /rewind or double-Esc on an empty input; it lists every prompt you sent.
- Restore actions undo state (code, conversation, or both); summarize actions compress context and never touch files.
- Bash-made, external, and concurrent changes are NOT tracked — only direct file-tool edits are.
- Checkpoints complement Git, they don't replace it: think 'local undo' vs. 'permanent, shareable history'.
Next
- Context Management —
/compact,/clear, and how summarize fits the bigger picture - Plan Mode — investigate and approve a plan before edits run, so you rewind less often
- Permissions — the other half of running ambitious tasks safely