Dev & Open Source

How to Use Claude Code Checkpoints in 2026: Rewind Code and Conversation Safely

How to use Claude Code checkpoints in 2026: snapshot your files automatically, rewind code or conversation with /rewind, and understand exactly what checkpoints track and what you still need Git for.

Waqas Ahmed Waseer
Waqas Ahmed Waseer Oct 25, 2026 7 min read
How to Use Claude Code Checkpoints in 2026: Rewind Code and Conversation Safely

Claude Code checkpoints let you undo an agent's work in seconds. Claude Code automatically snapshots your files before every prompt that starts a turn, and /rewind (or pressing Esc twice on an empty prompt) walks you back to any earlier point to restore the code, the conversation, or both. The feature shipped with Claude Code 2.0 on 29 September 2025 and is now the fastest way to recover when an agent heads down the wrong path.

One thing is worth knowing before you lean on it: checkpoints track Claude's own file edits, not everything that happens in your repository. That makes them a session-level safety net that complements Git, not a replacement for it. We use Claude Code to build and run this site, and checkpoints have changed how aggressively we let it refactor, precisely because getting back to a known-good state no longer means digging through git reflog.

What are Claude Code checkpoints?

A checkpoint is an automatic snapshot of your working files taken before a turn begins. According to the official checkpointing docs, every prompt you send that starts a turn creates one, with no manual action required. Claude Code keeps file snapshots for the 100 most recent checkpoints in a session and saves them alongside the conversation, so /rewind still works after you close and resume that session.

Snapshots are not kept forever. Claude Code deletes a session's file snapshots in its retention sweep, by default about 30 days after the session last saved one, so rewinding to a very old checkpoint can fail with a No files were restored error. If you need them to live longer, raise the cleanupPeriodDays setting. For day-to-day work the defaults are generous; the 30-day window mainly matters if you return to an abandoned experiment weeks later.

How do you rewind with /rewind?

Run /rewind, or press Esc twice while the prompt input is empty, to open the rewind menu. (If the input has text, double-Esc clears it instead; the cleared text goes to your input history, so Up brings it back.) The menu lists the prompts you sent during the session. Pick the point you want to act on, then choose an action:

  • Restore code and conversation: revert both to that point.
  • Restore conversation: rewind the chat while keeping your current code.
  • Restore code: revert file changes while keeping the conversation.
  • Summarize from here / Summarize up to here: compress part of the conversation to free context (more on this below).
  • Never mind: back out with no changes.

The two code-restore options only appear when that checkpoint actually captured file changes. After a conversation restore, the original prompt drops back into the input so you can edit and resend it. A practical habit: when an edit goes wrong, rewind to the prompt that started the bad turn rather than a message mid-turn, so you revert the whole change cleanly.

What checkpoints track (and what they quietly don't)

This is the part most tutorials skip, and it is where people get burned. Checkpointing watches files that Claude edited with its file-editing tools in the current session. Anything outside that lane is only partially covered or not covered at all. The table below maps it out, drawn from the limitations section of the docs.

ChangeReverted by /rewind?Notes
Claude's file-tool editsYesThe core case; this is what checkpoints exist for.
Bash edits to a file Claude already editedYesOnce Claude has touched a file, later shell changes to it are undone too.
A file only ever changed by BashNoNever tracked; use Git to revert it.
Subagent edits (background skill, /code-review --fix)Usually noOnly a foreground forked skill's edits are restored; other subagents' edits stay.
Manual edits you make in your editorNoExternal changes aren't captured unless they hit the same files.
Edits from another concurrent sessionNoSame reason; treat Git as the source of truth.
Symlinked / hard-linked pathsNoSkipped on restore with a skipped N files warning.

The headline takeaway: /rewind is excellent for undoing a run of Claude's edits, and useless for undoing what a shell command or a background subagent did to untracked files. Commit before big operations and you cover both.

Free up context with the summarize options

The rewind menu doubles as a context-management tool, which is easy to miss. Summarize from here compresses the conversation from a chosen point forward into a summary; Summarize up to here compresses everything before that point while keeping later messages intact. Either one leaves a Summarized conversation marker in the transcript and works like a targeted /compact: it frees context-window space without touching any files on disk.

This is genuinely useful on long debugging sessions. You can keep your original instructions and the final working state while collapsing a verbose middle stretch of trial and error. You can also highlight a summarize option and type guidance in the add context (optional) row to steer what the summary keeps. If instead you want to branch off and try a different approach while preserving the original thread untouched, use /branch or claude --continue --fork-session rather than summarizing. When you are planning a large change, pairing this with plan mode keeps the session lean from the start.

Checkpoints vs Git: which should you rely on?

They solve different problems, so the honest answer is both. Checkpoints give you instant, session-level undo with no staging, no commit messages, and no Git knowledge required, ideal for the fast "try it, hate it, revert it" loop inside a single session. Git gives you permanent history, branches, collaboration, and a record that survives the 30-day sweep and reaches every file in the repo regardless of what changed it.

A workflow that holds up: commit a clean baseline before you hand Claude a big task, use /rewind freely to iterate within the session, then commit again once you are happy. That way the checkpoint handles the minute-to-minute recovery and Git handles everything checkpoints deliberately don't: bash side effects, subagent edits, and anything you touched by hand. If you run several agents at once, our guide to git worktrees for parallel AI coding agents covers the isolation that checkpoints alone can't give you.

FAQ

Do Claude Code checkpoints replace Git? No. Checkpoints are built for quick, session-level recovery of Claude's own edits and operate independently of Git. They don't give you permanent history, branches, or collaboration, and their snapshots are swept after about 30 days. Keep using Git for commits and long-term version control.

Does /rewind undo changes made by bash commands? Partly. If Claude had already edited a file with its file-editing tools, later bash changes to that same file are undone when you rewind. A file that only a bash command ever changed is not tracked at all, so you'll need Git to revert it.

How many checkpoints are kept, and for how long? Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. The snapshots are deleted in the retention sweep roughly 30 days after the session last saved one, unless you extend cleanupPeriodDays in settings.

Can I rewind after resuming a session or after running /clear? Yes. Checkpoints are saved with the conversation, so /rewind works after you resume a session. If you ran /clear earlier in the same process, the menu shows a /resume <session-id> (previous session) entry at the top so you can get back to the pre-clear conversation.

Does rewinding restore edits made by a subagent? Usually not. Only a foreground forked skill's edits are captured in your session's checkpoints. Edits from background subagents, forked skills, or a /code-review --fix run stay in place, so revert those with Git.

Sources

Some links may earn us a commission at no extra cost to you.

Waqas Ahmed Waseer

Waqas Ahmed Waseer

Waqas Ahmed Waseer is a developer and automation builder with 8+ years shipping production systems used by 100k+ people. He builds custom multi-tenant SaaS, AI automation (n8n, LLM workflows, WhatsApp bots) and hosting infrastructure (WHM/cPanel, CloudLinux) — and is the maker of WaSphere, FlowMaticX, and the WaseerHost hosting brand. 100+ projects delivered for SMBs, agencies and funded startups.

Related

More in Dev & Open Source

View all →

Discussion · 0

Be kind. Comments are public.

    Newsletter · Monday edition

    The Monday brief.

    One email every Monday morning. The week ahead in AI, startups, hosting and dev tools — no fluff, no sponsored bait.

    Free. Unsubscribe in one click.