Claude Code

Checkpoints and rewind

How Claude Code captures edits, restores code or conversation with /rewind, summarizes context, and handles changes it does not track.

Checkpointing is Claude Code's session-level undo mechanism. It records changes made through Claude's file-editing tools so you can return to earlier code and conversation states when an approach fails or context becomes too long.

Use checkpoints to undo operations in the current session quickly. They do not replace Git branches, commits or shared project history.

#What it records

Claude Code captures code state automatically as you work:

ActionResult
Each new user promptCreates a new checkpoint
Claude uses file-editing tools such as Edit/WriteIncludes the file changes in the restore scope
Resume a saved sessionIts checkpoints remain accessible
Session cleanupRemoves checkpoints with the session, normally after about 30 days; configurable

You do not need to create checkpoints manually. Changes made through Claude Code's own editing tools can generally be restored from the rewind menu.

#Open the rewind menu

Entry pointBehavior
/rewindOpens rewind in the current session
Press Esc twice with an empty inputOpens the same menu

If the input contains text, pressing Esc twice clears it instead. The cleared text enters input history and can be recovered with Up.

The menu lists prompts you sent in this session. Select a point, then choose what to do with the code, conversation or context summary.

#Available actions

ActionResultWhen to use it
Restore code and conversationReturns both to the selected pointRestart from the prompt before an incorrect implementation
Restore conversationRewinds conversation while keeping files on diskRewrite the discussion without losing file changes
Restore codeRewinds file edits while keeping the conversationRecover files while retaining the analysis
Summarize from hereSummarizes the selected message and everything after it; earlier content stays intactCompress a side discussion while retaining the initial context
Summarize up to hereSummarizes content before the selected message; that message and later content stay intactCompress early preparation while continuing recent work
Never mindReturns to the message listMake no changes

After Restore conversation or Summarize from here, the selected prompt returns to the input for editing or resending. After Summarize up to here, you remain at the end of the session with an empty input.

#Restore versus summarize

ActionChanges files on disk?Changes conversation?Purpose
Restore codeYesNoUndo file changes
Restore conversationNoYesReturn to an earlier conversation state
Restore code and conversationYesYesUndo both
Summarize from/up to hereNoReplaces part of the context with a summaryFree context capacity

Summarize does not roll back files. It compresses a chosen part of the conversation into a Claude-generated summary, like a more targeted /compact. Original messages remain in the session transcript, and Claude may still refer to their details when needed.

To try a different approach while retaining the original session, use session branching or:

claude --continue --fork-session

#Return after /clear

After /clear within the same Claude Code process, the top of the rewind menu may show:

/resume <session-id> (previous session)

Select it to resume the session from before /clear. This entry remains until you exit Claude Code or resume another session. The official guide requires Claude Code v2.1.191 or later for this menu entry. Earlier versions can locate the session manually with /resume.

#Typical workflow

1

Try a larger change

Ask Claude to plan first, then implement. Each prompt creates a restore point, making it easier to compare approaches.

2

Rewind when the direction is wrong

Rather than adding repeated undo instructions to the context, open /rewind, select the prompt before the problem, and restore code, conversation or both.

3

Summarize a long detour

If research or a discarded discussion is the problem, use Summarize from here or Summarize up to here without changing files.

4

Commit stable work to Git

Checkpoints follow the session cleanup lifecycle. Preserve long-term states with a Git commit, branch or PR.

#Limits

LimitEffect
Bash file changes are not trackedrm, mv, cp and generated files cannot be undone reliably with rewind
External edits generally are not trackedManual edits, other terminals and other Claude sessions are usually outside the checkpoint
Scope covers files edited in this sessionFiles never edited by this session generally have no restore state
Not long-term historyCheckpoints expire with sessions and do not resolve collaboration conflicts

Check Git status before running generators, formatters, migrations or deletion commands. Checkpointing is useful for direct Claude edits, but does not fully protect filesystem changes made by shell commands.

#With Passion8

Checkpointing is managed by Claude Code locally. With Passion8, /rewind, summarization and restoration remain client features; model requests use your ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN configuration.

#Official references

Support

Need help?

For setup, billing, or model issues, email us. Check the status page for uptime.

WeChat / QQ support is available at the bottom right.