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 turn you start, 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 4
  1. Each prompt that starts a turn 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. /checkpoint and /undo are aliases for the same command, so reach for whichever name comes to mind.

Open the rewind menu

/rewind
Watch out
  • The alias names are friendlier than they are literal: /checkpoint does not take a snapshot on demand (snapshots are automatic), and /undo does not undo the last edit by itself. All three names open the same menu, where you still pick the point and the action.

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.

The two code restore options only appear when the selected checkpoint actually has tracked file changes to revert. If no file edits were captured after that point, the menu offers just Restore conversation, the two summarize options, and Never mind (which returns to the message list without changing anything).

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, and a Summarized conversation marker appears where the compressed messages were. To steer what the summary focuses on, highlight a Summarize option with the arrow keys and type instructions where the row reads add context (optional), then press Enter — picking the option with its number key summarizes immediately with no instructions.

For the whole flow, see Context Management — /rewind's summarize actions are a scalpel where /compact is a broad brush.

What you'll learn
  • Summarize keeps you in the same session. To branch off and try a different approach while leaving the original session intact, use /branch or claude --continue --fork-session instead.

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. These gaps matter:

Guided walkthrough1 of 7
  1. Tracking is per file, and a file enters it only when Claude edits it with its file-editing tools. Once that has happened, /rewind also undoes what Bash commands do to that same file afterward — a formatter or generator rewriting an already-edited file is rewindable. A file that only Bash ever touched is not tracked and stays as it is, so a file deleted by rm that Claude never edited needs Git. The menu reflects this: under each prompt it counts changes to files Claude had already edited, whatever made them.

Checkpoints vs. Git: use both​

They solve different problems, so pair them.

Checkpoints (/rewind)Git
ScopeOne sessionWhole project history
GranularityPer turn-starting prompt, automaticPer commit, deliberate
Tracks bash-made changes?Only on files Claude already editedYes (once staged/committed)
LifespanLast 100 checkpoints, swept ~30 days after the sessionPermanent
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.
  • Lean on Git for files Claude never edits directly — the ones only destructive bash (rm/mv) or a background subagent touches. Rewind covers a file only once Claude has edited it with its own file tools.

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 never edited `config.old.json` with its file tools, then deleted it with `rm` in a bash command. Can `/rewind` bring it back?
  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 / 6
Key takeaways
  • Checkpoints are automatic snapshots taken before each turn-starting prompt — a local undo for the session. The last 100 are kept, then swept ~30 days after the session.
  • Open the rewind menu with /rewind (aliases: /checkpoint, /undo) 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.
  • Tracking is per file and starts when Claude edits it with its file tools — after that, even Bash changes to that file rewind. Files Claude never edited (bash-only, external, concurrent, most subagent) are not tracked, and symlinked or hard-linked paths are skipped on restore.
  • 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