checkpointing.md +29 −9
4 4
5# Checkpointing5# Checkpointing
6 6
77> Automatically track and rewind Claude's edits to quickly recover from unwanted changes.> Track, rewind, and summarize Claude's edits and conversation to manage session state.
8 8
9Claude Code automatically tracks Claude's file edits as you work, allowing you to quickly undo changes and rewind to previous states if anything gets off track.9Claude Code automatically tracks Claude's file edits as you work, allowing you to quickly undo changes and rewind to previous states if anything gets off track.
10 10
20* Checkpoints persist across sessions, so you can access them in resumed conversations20* Checkpoints persist across sessions, so you can access them in resumed conversations
21* Automatically cleaned up along with sessions after 30 days (configurable)21* Automatically cleaned up along with sessions after 30 days (configurable)
22 22
2323### Rewinding changes### Rewind and summarize
24 24
2525Press `Esc` twice (`Esc` + `Esc`) or use the `/rewind` command to open up the rewind menu. You can choose to restore:Press `Esc` twice (`Esc` + `Esc`) or use the `/rewind` command to open the rewind menu. A scrollable list shows each of your prompts from the session. Select the point you want to act on, then choose an action:
26 26
2727* **Conversation only**: Rewind to a user message while keeping code changes* **Restore code and conversation**: revert both code and conversation to that point
2828* **Code only**: Revert file changes while keeping the conversation* **Restore conversation**: rewind to that message while keeping current code
2929* **Both code and conversation**: Restore both to a prior point in the session* **Restore code**: revert file changes while keeping the conversation
30* **Summarize from here**: compress the conversation from this point forward into a summary, freeing context window space
31* **Never mind**: return to the message list without making changes
32
33After restoring the conversation or summarizing, the original prompt from the selected message is restored into the input field so you can re-send or edit it.
34
35#### Restore vs. summarize
36
37The three restore options revert state: they undo code changes, conversation history, or both. "Summarize from here" works differently:
38
39* Messages before the selected message stay intact
40* The selected message and all subsequent messages get replaced with a compact AI-generated summary
41* No files on disk are changed
42* The original messages are preserved in the session transcript, so Claude can reference the details if needed
43
44This is similar to `/compact`, but targeted: instead of summarizing the entire conversation, you keep early context in full detail and only compress the parts that are using up space. You can type optional instructions to guide what the summary focuses on.
45
46<Note>
47 Summarize keeps you in the same session and compresses context. If you want to branch off and try a different approach while preserving the original session intact, use [fork](/en/how-claude-code-works#resume-or-fork-sessions) instead (`claude --continue --fork-session`).
48</Note>
30 49
31## Common use cases50## Common use cases
32 51
33Checkpoints are particularly useful when:52Checkpoints are particularly useful when:
34 53
3554* **Exploring alternatives**: Try different implementation approaches without losing your starting point* **Exploring alternatives**: try different implementation approaches without losing your starting point
3655* **Recovering from mistakes**: Quickly undo changes that introduced bugs or broke functionality* **Recovering from mistakes**: quickly undo changes that introduced bugs or broke functionality
3756* **Iterating on features**: Experiment with variations knowing you can revert to working states* **Iterating on features**: experiment with variations knowing you can revert to working states
57* **Freeing context space**: summarize a verbose debugging session from the midpoint forward, keeping your initial instructions intact
38 58
39## Limitations59## Limitations
40 60