Every prompt you send drops an automatic save point. Rewind with Esc Esc or /rewind, choose from five restore options, branch between competing approaches — and learn the one thing checkpoints can never see: what your bash commands did to disk.
Big refactors, speculative rewrites, "let's just try it" — the real cost is losing a working state you can't get back to. Checkpoints are snapshots of your conversation state that let you rewind to previous points in a session — for exploring different approaches, recovering from mistakes, or comparing alternative solutions.
| Checkpoint | Snapshot of conversation state — messages, files, context |
| Rewind | Return to a previous checkpoint, discarding subsequent changes |
| Branch point | A checkpoint from which multiple approaches are explored |
Checkpoints are a built-in default behavior: no configuration to enable, no save command to remember. Claude Code manages the whole lifecycle for you.
# keyboard shortcut Esc + Esc # slash command /rewind # alias — same interface /checkpoint
Both open the same browser: a list of all available checkpoints with timestamps. Select any one to rewind to that state.
Work normally → want to go back? Esc Esc → choose a checkpoint → select what to restore → continue from there.
Pick a checkpoint and Claude compresses everything from that point forward into an AI-generated summary, freeing context window space. It's the option you reach for after a long debugging session — 20+ messages of exploration that you want condensed, not erased.
This is the limitation that bites people. Checkpoints track the files Claude itself modifies — but bash command changes are NOT tracked. If a shell command deleted, moved, or copied files, "Restore code" will not bring them back.
| 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 |
The safe-refactoring pattern in full: current state is checkpointed automatically → start refactoring → run tests → tests pass: keep working · tests fail: rewind and try a different approach. The checkpoint costs nothing; the failed experiment costs nothing either.
From the chapter's performance-optimization session — bar length = response time (shorter is better):
Database migration (direct cutover vs dual-write — 15 failing tests trigger the rewind) · API design (REST → GraphQL → back to the REST checkpoint) · configuration management (env vars vs validated YAML).
Performance optimization (the three-branch session from the last slide) · UI/UX layouts (sidebar → top-nav → card grid → combine) · test strategy (unit → integration → optimize speed → E2E).
Debugging hypotheses (event listeners? connections? — rewind between each until circular references confess) · summarize-from-here after a 20+ message debugging session.
The shared shape of the rewind examples: name a starting checkpoint, try a hypothesis, "Restore code and conversation" back to it, try the next — and only the winner gets committed.
| Scope | Git: file system · Checkpoints: conversation + files |
| Persistence | Git: permanent · Checkpoints: session-based |
| Granularity | Git: commits · Checkpoints: any point |
| Speed | Git: slower · Checkpoints: instant |
| Sharing | Git: yes · Checkpoints: limited |
{
"cleanupPeriodDays": 30
}
The only checkpoint-related setting: how many days session history and checkpoints are retained (default 30). Checkpointing itself needs no configuration — it's on by default.
| Session checkpoints | The rewind history itself |
| ~/.claude/tasks/ | Persistent task lists |
| ~/.claude/shell-snapshots/ | Captured shell-environment snapshots |
| ~/.claude/backups/ | Rolling setting / CLAUDE.md backups |
| Missing checkpoints? | Check if checkpoints were cleared · check disk space · ensure cleanupPeriodDays is set high enough (default 30) |
| Rewind failed? | Ensure no uncommitted changes conflict · the checkpoint may be corrupted · try rewinding to a different checkpoint |
Checkpoints let you go back, but how do you know when? As the conversation grows, Claude's context window fills and model quality silently degrades — you might be shipping code from a half-blind model without realizing it.
Every user prompt automatically creates a checkpoint — messages, file modifications, tool history, context — persistent across sessions and pruned after cleanupPeriodDays (default 30). Open the browser with Esc Esc or /rewind, then choose: restore code and conversation, conversation only, code only, summarize from here, or never mind. Branch from one baseline to compare approaches, rewind between debugging hypotheses, summarize long sessions to reclaim context. And remember the edges: bash operations, external edits, and anything permanent belong to git — checkpoints are for rapid experimentation, commits are for finalized work.