Claude Code checkpointing automatically captures the state of your code before each prompt you send that starts a turn, and /rewind (or Esc twice on an empty prompt) lets you restore code, conversation or both to one of those points (Checkpointing). Checkpoints cover Claude’s file editing tools, not every change on disk.

Applies to: Claude Code, per Anthropic’s checkpointing documentation as published on October 30, 2026. Last checked: October 30, 2026.

On this page

Open the rewind menu

Run this in an interactive session (Checkpointing):

/rewind

Pressing Esc twice while the prompt input is empty opens the same menu. If the input contains text, double Esc clears it instead; the cleared text is saved to input history, so Up recalls it after you leave the menu (Checkpointing).

The menu lists the prompts you sent during the session. If you ran /clear earlier in the same Claude Code process, an extra entry at the top, /resume <session-id> (previous session), resumes the conversation from before /clear, until you exit or resume another session (Checkpointing).

Pick what to restore

After selecting a prompt, the documentation lists these actions (Checkpointing):

Action What it does
Restore code and conversation Reverts both code and conversation to that point
Restore conversation Rewinds to that message while keeping current code
Restore code Reverts file changes while keeping the conversation
Summarize from here Compresses the conversation from this point forward into a summary
Summarize up to here Compresses the conversation before this point, keeping later messages
Never mind Returns to the message list without changes

The two code restore options appear only when the selected checkpoint has tracked file changes to revert. Otherwise the menu offers only Restore conversation, the summarize options and Never mind (Checkpointing).

After Restore conversation or Summarize from here, the original prompt goes back into the input field so you can re-send or edit it. Rewound messages can return if you exit before your next prompt; Anthropic says to send a prompt before exiting, because the rewound conversation is saved together with it (Checkpointing).

Summarize instead of rewinding

Summarizing does not change files on disk, and the original messages stay in the session transcript. To steer a summary, highlight a Summarize option with the arrow keys, type instructions where the row reads add context (optional), then press Enter; picking the option by its number key summarizes at once without instructions (Checkpointing).

Anthropic compares this to a targeted /compact. To try a different approach while keeping the original session intact, the docs point to /branch or this command (Checkpointing):

claude --continue --fork-session

Which changes are tracked

Every prompt that starts a turn creates a checkpoint, and Claude Code tracks the changes its file editing tools make (Checkpointing). The documented limits:

  • Bash. Once Claude has edited a file with its file editing tools, /rewind also undoes later Bash changes to that file. A file that only Bash commands changed is not tracked and stays as it is.
  • Subagents. Edits by a foreground forked skill (a skill with context: fork running in the foreground) are restored as usual. For any other subagent, rewinding restores only files Claude had already edited in your conversation; this includes a background forked skill, the default, and a background /code-review --fix run.
  • External changes. Manual edits outside Claude Code and edits from other concurrent sessions are normally not captured, unless they touch the same files as the current session.
  • Messages sent mid-turn. A message typed while Claude was working can be marked No code restore. To undo the edits after it, select the prompt that started the turn and choose Restore code or Restore code and conversation, which reverts the whole turn’s edits.
  • Symlinks and hard links. Code restore skips them and shows a Restored the code, but skipped N files warning. Turning on /debug before restoring writes each skipped path to ~/.claude/debug/<session-id>.txt.

All of the above comes from the Limitations section of Anthropic’s page, which says to use version control such as Git for changes checkpoints do not restore.

How long checkpoints are kept

Claude Code keeps file snapshots for the 100 most recent checkpoints in a session and saves checkpoints with the conversation, so /rewind still works after you resume a session. A session’s snapshots are deleted in the retention sweep, by default about 30 days after the session last saved one; rewinding to a checkpoint whose snapshots are gone can fail with No files were restored. The cleanupPeriodDays setting keeps them longer (Checkpointing). For where those session files live, see where Claude Code stores data.

Checkpoints and Git

Anthropic describes checkpoints as “designed for quick, session-level recovery” and says to keep using version control, such as Git, “for commits, branches, and long-term history” (Checkpointing). To control which commands Claude may run in the first place, see Claude Code permissions; for scripts that run around tool calls, see Claude Code hooks.