Skip to main content

Checkpoints & Rewind

Intermediate
What you'll learn
  • 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.

Guided walkthrough1 of 3
  1. Each user prompt captures the state of your code before Claude's file-editing tools run. No command, no config, no ceremony.

Opening the rewind menu

There are two ways in:

Guided walkthrough1 of 2
  1. Type the slash command from the prompt. Always works.

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.
Watch out
  • 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

Guided walkthrough1 of 3
  1. Revert both your files and the chat history to the selected point — a clean 'rewind time' to that moment.

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.

Guided walkthrough1 of 2
  1. 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.

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:

Guided walkthrough1 of 3
  1. 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.

Checkpoints vs. Git: use both

They solve different problems, so pair them.

Checkpoints (/rewind)Git
ScopeOne sessionWhole project history
GranularityPer prompt, automaticPer commit, deliberate
Tracks bash-made changes?NoYes (once staged/committed)
Lifespan~30 days, then gonePermanent
Shareable / collaborativeNoYes
Mental model"Local undo""Permanent history"
Pro tip
  • 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

Guided walkthrough1 of 4
  1. Try a bold implementation, and if you don't like it, restore code and conversation to the fork point and try another.

Check yourself

0/3
  1. Claude ran `rm config.old.json` via a bash command and you want it back. Can `/rewind` restore it?
  2. Your code is fine, but a long debugging tangent has filled the context window. Which action fits?
  3. How is a checkpoint created?
Checkpoints & rewind vocabulary
Press Enter or Space to flip the card. Use the left and right arrow keys to move between cards.Term shown.
1 / 5
Key takeaways
  • 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