Checkpoint Examples
Real-world examples of using checkpoints effectively in Claude Code.
BeginnerFree11 minupdated 2026-10-28
Checkpoints allow you to save conversation state and rewind to previous points in your Claude Code session. This is invaluable for exploring different approaches, recovering from mistakes, or comparing alternative solutions.
Checkpoints allow you to save conversation state and rewind to previous points, enabling safe experimentation and exploration of multiple approaches. They are snapshots of your conversation state, including:
Checkpoints are invaluable when exploring different approaches, recovering from mistakes, or comparing alternative solutions.
| Concept | Description |
|---|---|
| Checkpoint | Snapshot of conversation state including messages, files, and context |
| Rewind | Return to a previous checkpoint, discarding subsequent changes |
| Branch Point | Checkpoint from which multiple approaches are explored |
You can access and manage checkpoints in two primary ways:
Press Esc twice (Esc + Esc) to open the checkpoint interface and browse saved checkpoints.
Use the /rewind command (aliases: /checkpoint, /undo) for quick access:
# Open rewind interface
/rewind
# Or use the alias
/checkpointWhen you rewind, you are presented with a menu of six options:
Note: After restoring the conversation or choosing Summarize from here, the original prompt from the selected message is restored into the input field so you can re-send or edit it. Choosing Summarize up to here leaves you at the end of the conversation with the input empty.
Tip: Send Claude a prompt before you exit after a rewind. Claude Code saves the rewound conversation together with that prompt, so if you exit first, the rewound messages can come back. To remove them again, run /rewind, select the same prompt, and choose Restore conversation. Restored files stay as the rewind left them.
/clearis no longer a hard boundary (v2.1.191+):/rewindcan resume from a checkpoint taken before you ran/clear. Clearing the conversation no longer permanently discards the state that preceded it - you can rewind back across the clear if you need that earlier code or context again.
Claude Code automatically creates checkpoints for you:
/rewind still works after you resume a sessionThis means you can always rewind to any previous point in your conversation, from a few minutes ago to days before.
| Scenario | Workflow |
|---|---|
| Exploring Approaches | Save → Try A → Save → Rewind → Try B → Compare |
| Safe Refactoring | Save → Refactor → Test → If fail: Rewind |
| A/B Testing | Save → Design A → Save → Rewind → Design B → Compare |
| Mistake Recovery | Notice issue → Rewind to last good state |
Press Esc twice or use /rewind to open the checkpoint browser. You'll see a list of all available checkpoints with timestamps. Select any checkpoint to rewind to that state.
Each checkpoint shows:
User: Let's add a caching layer to the API
Claude: I'll add Redis caching to your API endpoints...
[Makes changes at checkpoint A]
User: Actually, let's try in-memory caching instead
Claude: I'll rewind to explore a different approach...
[User presses Esc+Esc and rewinds to checkpoint A]
[Implements in-memory caching at checkpoint B]
User: Now I can compare both approachesUser: Refactor the authentication module to use JWT
Claude: I'll refactor the authentication module...
[Makes extensive changes]
User: Wait, that broke the OAuth integration. Let's go back.
Claude: I'll help you rewind to before the refactoring...
[User presses Esc+Esc and selects the checkpoint before the refactor]
User: Let's try a more conservative approach this timeUser: Let's try rewriting this in a functional style
[Creates checkpoint before experiment]
Claude: [Makes experimental changes]
User: The tests are failing. Let's rewind.
[User presses Esc+Esc and rewinds to the checkpoint]
Claude: I've rewound the changes. Let's try a different approach.User: I want to compare two database designs
[Takes note of checkpoint - call it "Start"]
Claude: I'll create the first design...
[Implements Schema A]
User: Now let me go back and try the second approach
[User presses Esc+Esc and rewinds to "Start"]
Claude: Now I'll implement Schema B...
[Implements Schema B]
User: Great! Now I have both schemas to choose fromClaude Code automatically manages your checkpoints:
When exploring multiple approaches:
1. Start with initial implementation → Checkpoint A
2. Try Approach 1 → Checkpoint B
3. Rewind to Checkpoint A
4. Try Approach 2 → Checkpoint C
5. Compare results from B and C
6. Choose best approach and continueWhen making significant changes:
1. Current state → Checkpoint (auto)
2. Start refactoring
3. Run tests
4. If tests pass → Continue working
5. If tests fail → Rewind and try different approachSince checkpoints are created automatically, you can focus on your work without worrying about manually saving state. However, keep these practices in mind:
✅ Do:
❌ Don't:
Checkpoints are a built-in default behavior in Claude Code and do not require any configuration to enable. Every user prompt automatically creates a checkpoint.
Two settings govern checkpoint behavior - whether snapshots are taken at all, and how long they are kept:
{
"fileCheckpointingEnabled": true,
"cleanupPeriodDays": 30
}| Setting | Default | Effect |
|---|---|---|
fileCheckpointingEnabled | true | Snapshot files before each edit so /rewind can restore them. Requires v2.1.119+. Surfaces in /config as Rewind code (checkpoints). Env equivalent: CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING |
cleanupPeriodDays | 30 | Number of days to retain session history and checkpoints |
Claude Code keeps snapshots for the 100 most recent checkpoints; older ones are dropped even inside the retention window.
v2.1.117 update:cleanupPeriodDaysnow governs retention for many on-disk caches, not just checkpoints (a selection below; session transcripts,file-history/,plans/,debug/,paste-cache/and more are covered too):
- Session checkpoints
- ~/.claude/tasks/ - persistent task lists
- ~/.claude/shell-snapshots/ - captured shell-environment snapshots
-~/.claude/backups/- earlier versions of~/.claude.json(the five newest are kept)
A single setting now prunes these directories uniformly after the same number of days.
Checkpoints have the following limitations:
/rewind also undoes changes that Bash commands make to that file afterward; a file that only Bash commands changed isn't tracked. Since v2.1.309, sed -i is treated like any other Bash edit/rewind leaves them as they are (revert them with git); the exception is a foreground context: fork skill, whose edits are restored like the main session'sv2.1.216 update: /rewind no longer restores or deletes files through symlinks or hard links at tracked paths. If a tracked path resolves through a symlink or hard link, rewind skips it rather than following the link, and it reports how many paths it skipped for this reason.
Problem: Expected checkpoint not found
Solution:
cleanupPeriodDays is set high enough (default: 30 days)Problem: Cannot rewind to checkpoint
Solution:
Checkpoints complement (but don't replace) git:
| Feature | Git | Checkpoints |
|---|---|---|
| Scope | File system | Conversation + files |
| Persistence | Permanent | Session-based |
| Granularity | Commits | Any point |
| Speed | Slower | Instant |
| Sharing | Yes | Limited |
Use both together:
Esc twice or use /rewindEsc + Esc - Open checkpoint browser/rewind - Alternative way to access checkpoints/checkpoint, /undo - Aliases for /rewindCheckpoints let you go back - but how do you know when you should? As your conversation grows, Claude's context window fills up and model quality silently degrades. You might be shipping code from a half-blind model without realizing it.
cc-context-stats solves this by adding real-time context zones to your Claude Code status bar. It tracks where you are in the context window - from Plan (green, safe to plan and code) through Code (yellow, avoid starting new plans) to Dump (orange, finish up and rewind). When you see the zone shift, you know it's time to checkpoint and start fresh instead of pushing through with degraded output.
Checkpoints are an automatic feature in Claude Code that lets you safely explore different approaches without fear of losing work. Every user prompt creates a new checkpoint automatically, so you can rewind to any previous point in your session.
Key benefits:
Remember: checkpoints are not a replacement for git. Use checkpoints for rapid experimentation and git for permanent code changes.
Last Updated: October 26, 2026
Claude Code Version: 2.1.310
Sources:
Compatible Models: Claude Fable 5, Claude Opus 5, Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5
Real-world examples of using checkpoints effectively in Claude Code.
We hand-picked the agents, skills and commands that handle this kind of work: Agents and skills for debugging and error diagnosis.
Open-source community guide (MIT) · curated and maintained by Doutor AI.
Need a tailor-made solution?
Not sure where to start with AI in your business? Get a free assessment and a tailored plan - no commitment.
Doutor AI gives you 1,859 ready-to-copy AI prompts, by industry and in plain English - plus a complete technical library for those who want to go further.