Claude Code checkpoints and rewind: what you can and can't undo

By: Irina Shvaya | October 14, 2026
This article is part of our Claude Code Guide: what Claude Code is, how to use it safely on a business website, and how to budget for and choose help. Want it set up for your team? See Claude Code consulting.

Claude Code checkpoints let you undo the file edits Claude makes during a session. Every prompt you send that starts a turn creates a restore point, and you can roll your files, the conversation or both back to it by pressing Esc twice or running /rewind. For a session that goes wrong on a website template or a batch of pages, that is the fastest way back to where you were.

Checkpoints have hard limits, though. They don't track changes made by shell commands, they usually don't cover edits made by subagents, and they can't undo anything that left your machine, such as a deploy, a database change or a call to your CMS. Anthropic's own docs say checkpoints are for "quick, session-level recovery" and that you should keep using git for real version history. This guide explains exactly what a rewind restores as of October 2026, what it misses, and how to combine it with git so nothing on your site depends on luck.

Key Takeaways

  • A checkpoint is created at each prompt you send that starts a turn. Claude Code keeps file snapshots for the 100 most recent checkpoints in a session.
  • Open the rewind menu with /rewind (aliases /checkpoint and /undo) or by pressing Esc twice when the prompt input is empty. You can restore code, conversation, or both.
  • Checkpoints only track edits made with Claude's file editing tools. Files changed by Bash commands such as rm, mv or cp can't be restored by a rewind.
  • Remote actions (deploys, databases, APIs) can't be checkpointed at all. Neither can edits you make by hand outside Claude Code or edits from another session, in most cases.
  • Snapshots are deleted by the retention sweep, by default about 30 days after the session last saved one.
  • Use checkpoints for quick experiments inside a session and git commits for anything you want to keep, share or deploy.

What a checkpoint is

A checkpoint is a restore point Claude Code saves automatically. In the words of Anthropic's checkpointing docs, it "captures the state of your code before each prompt you send that starts a turn." Before Claude edits a file with its own editing tools, it snapshots the file's current contents, so a later rewind can put those contents back.

A few details matter in practice:

  • No setup. Checkpointing is on as soon as you start a session. You don't name or save checkpoints yourself.
  • Per prompt, not per edit. If one prompt leads Claude to change twelve files, rewinding to before that prompt restores all twelve together.
  • Saved with the conversation. Close the terminal, resume the session tomorrow with claude --continue, and you can still rewind.
  • A rolling window. File snapshots are kept for the 100 most recent checkpoints in a session.
  • An expiry date. Snapshots are deleted in Claude Code's retention sweep, by default about 30 days after the session last saved one. Rewinding to a checkpoint whose snapshots are gone can fail with a "No files were restored" message. The cleanupPeriodDays setting changes the retention period.

How to rewind, step by step

In the terminal, the rewind menu works like this:

  1. Press Esc to stop Claude if it is still working.
  2. Make sure the prompt input is empty. If it has text in it, a double Esc clears the text instead (it is saved to your input history, so the Up arrow brings it back later).
  3. Press Esc twice, or type /rewind. The menu lists the prompts you sent during the session.
  4. Pick the prompt you want to go back to, then choose an action from the list below.
  5. Check the result. Run /diff or git status and open the page in your browser to confirm the files are what you expect.

The actions, as listed in Anthropic's docs:

Menu optionWhat it doesWhen to use it on a website
Restore code and conversationReverts both files and conversation to that pointClaude went down the wrong path entirely, such as editing the wrong template
Restore conversationRewinds the conversation but keeps current codeThe edits are good, but the discussion got muddled and you want a cleaner thread
Restore codeReverts file changes but keeps the conversationYou want to undo the edits but keep what Claude learned about the codebase
Summarize from hereCompresses the conversation from that point forward into a summaryA long debugging detour is crowding the context
Summarize up to hereCompresses the conversation before that point, keeping later messages intactEarly exploration is no longer needed, but recent work is
Never mindReturns to the list without changesYou opened the menu to look

The two code-restore options only appear when the checkpoint has tracked file changes to revert. After you restore the conversation, your original prompt is put back in the input box so you can edit and resend it. That helps when the first prompt was too vague.

The summarize options don't touch files. They free up context, which our guide to context, compaction and memory covers in depth.

In VS Code

The VS Code extension supports checkpoints too. Hover over a message to reveal the rewind button, which offers three choices: "Fork conversation from here", "Rewind code to here", and "Fork conversation and rewind code." The same limits apply. Other surfaces change often, so check the current docs for the one you use.

What checkpoints don't track

This is the part that catches people. A rewind looks like a full undo, but it only covers one kind of change. Anthropic's docs list these limits:

  • Bash commands. "Checkpointing does not track files modified by Bash commands." If Claude runs a script that rewrites 300 HTML files, or deletes and moves files with rm and mv, rewind can't bring them back. On website projects, bulk edits often run as scripts, so this is the most common gap.
  • Remote systems. "Actions that affect remote systems (databases, APIs, deployments) can't be checkpointed." A deploy, a push to GitHub, a WordPress database update or a change made through a CMS connection stays done after a rewind.
  • Subagent edits. Claude Code "usually doesn't capture those edits in your session's checkpoints." The docs' advice for those is plain: "Use git to revert them." The exception is a skill set to run as a forked subagent in the foreground. See subagents explained for how subagents work.
  • Changes made outside the session. Edits you make by hand in your editor, and edits from other Claude Code sessions running at the same time, are "normally not captured, unless they happen to modify the same files as the current session."
  • Symlinked and hard-linked files. A restore skips them and warns you that it skipped some files.
  • Messages typed while Claude was working. These get no checkpoint of their own and are marked "No code restore" in the menu. To undo that part of the work, rewind to the prompt that started the turn.

The practical rule: a rewind undoes what Claude typed into files with its editor, during this session. Everything else needs git or a backup.

Checkpoints vs git

Git is version control: a permanent history of committed changes that you can share, review, branch and roll back. Checkpoints are a private, short-lived undo stack for one session. They complement each other, and you need both.

QuestionCheckpointsGit
Created automatically?Yes, at each prompt that starts a turnNo, someone commits
Covers Bash and script changes?NoYes, anything in the working tree
Covers your own manual edits?Normally noYes
Shared with teammates?No, local to your sessionYes, through a remote such as GitHub
How long it lastsAbout 30 days by default, last 100 checkpointsUntil someone deletes history
Can it undo a deploy?NoIt can restore old files to redeploy, but the deploy itself already happened
Best forTrying an idea and backing out within minutesAnything you want to keep, review or ship

If git is new to you, start with git basics for Claude Code. You only need a handful of commands: check status, commit, create a branch, and discard changes.

A working routine that uses both

On a website project, this routine keeps every change recoverable:

  1. Start from a clean, committed state on a branch. Run git status before the session. If it shows uncommitted changes, commit or stash them first, so you can always get back to a known good copy.
  2. Work on a copy of the site, not the live server. Our guide to setting up a staging site explains how.
  3. Let checkpoints cover experiments. Try a new header layout, look at it in the browser, and rewind with Restore code if you don't like it.
  4. Commit when something works. Ask Claude to commit with a clear message, or do it yourself. A commit is the point you can return to next week.
  5. Before any script that edits many files, commit first. Because rewind can't undo a script's changes, the commit is your undo. A prompt such as Before running the rewrite script, commit the current state with the message "before meta rewrite", then run it on three pages only and show me the diff builds that habit in.
  6. Review the diff before anything leaves your machine. Pushes and deploys can't be rewound, so a person reads the change first.

The check that proves the routine works: at any moment, git log should show a recent commit you could go back to, and git status should show only the changes from the current task.

What we learned running eseospace.com

Two lessons from our own 2,200-page site, both described in our eseospace.com rebuild case study, show why checkpoints alone aren't enough. Our September 2026 accuracy audit applied more than 4,400 corrections across about 750 pages as scripted edits, each tested on a copy first. Changes made by scripts are exactly the kind a checkpoint doesn't track.

We also had two sessions working on the same site, and one regenerated pages the other had just edited, so those edits disappeared. A checkpoint in the first session could not have helped, because the overwrite came from a different session. What catches that is a habit: check git history for changes you didn't make before any deploy. More of these cases are in common Claude Code mistakes on websites.

When rewind is the right tool, and when it isn't

SituationUse
Claude edited the wrong template a minute agoRewind: Restore code and conversation
You want to compare two approaches to a page layoutRewind between attempts, or /branch to keep both conversations
A script rewrote hundreds of files incorrectlyGit: discard the changes or reset to your last commit
Yesterday's committed change broke the contact formGit: revert that commit on a branch and review
A bad change is already liveYour host's rollback or a redeploy of the last good commit, then fix forward
The conversation is long and Claude seems confusedRewind's summarize options, /compact, or /clear

Because remote actions can't be undone this way, the permission settings that stop Claude from pushing or deploying on its own matter more than any undo button. Our article on whether Claude Code is safe for a live website covers those settings.

Conclusion

Checkpoints make Claude Code safer to experiment with: you can try a change, look at it and back out in seconds with Esc twice or /rewind. They are not a backup. They miss script and shell changes, most subagent edits, other sessions, your own manual edits and everything that reaches a server. Treat them as a short-term undo, and keep git commits, a staging copy and a person approving deploys as the real safety net. If you want a team setup with branches, permission rules and a review process built in, our Claude Code consulting covers it. More guides are in our Claude Code Guide.

Frequently asked questions

Does rewind undo a deploy or a push to GitHub?

No. Anthropic's docs say actions that affect remote systems, such as databases, APIs and deployments, can't be checkpointed. If a bad change went live, use your host's rollback or redeploy the last good commit, then fix the problem on a branch.

Can I rewind after closing Claude Code?

Yes, within limits. Checkpoints are saved with the conversation, so if you resume the session with claude --continue or claude --resume, /rewind still works. Snapshots are deleted by the retention sweep, by default about 30 days after the session last saved one, and only the 100 most recent checkpoints keep file snapshots.

Why didn't rewind restore some of my files?

The most likely reason is that those files were changed by a Bash command or script, by a subagent, by another session, or by you in your editor. Checkpoints only track edits made by Claude's own file editing tools in the current session. Symlinked and hard-linked files are also skipped. Use git to restore them.

Is /undo different from /rewind?

No. As of October 2026, /checkpoint and /undo are aliases for /rewind, and all three open the same menu. You can also ask Claude in plain words to undo a change, but the menu is the predictable route.

Do I still need git if I have checkpoints?

Yes. Anthropic describes checkpoints as session-level recovery and says to keep using version control for permanent history and collaboration. Git covers script changes, manual edits and teammates' work, and it gives a reviewer a diff to approve before anything ships.

Put this into action with eSEOspace

We help businesses grow with seo, geo & aeo that actually performs. Explore the services behind this guide:

Book a free strategy call →

Get a FREE Audit

We'll perform a comprehensive SEO, AEO, GEO & CRO audit of your website — completely free — and show you exactly how to outrank your competitors.

Don't have a site yet? Get in touch →

Get a FREE GEO/AEO/SEO Audit

We'll analyze your site's SEO, GEO, AEO & CRO — completely free — and show you exactly how to get found across Google and AI answers.

Don't have a site yet? Get in touch →

You Might Also like to Read