← Blog · 2026-10-27
Claude Code /rewind Not Working? 9 Causes and Fixes for Checkpoints
30-second test: run
/rewindand pick the prompt before things went wrong. If the menu only offers Restore conversation and the summarize options, Claude Code has no tracked file edits after that point: start at cause 1. If it saysNo files were restored, go to cause 6. If it saysRestored the code, but skipped N files, go to cause 7. And whatever happens,git statusandgit difftell you what's really on disk.
Checkpoints are Claude Code's built-in undo. Before each prompt you send that starts a turn, it snapshots the files its file-editing tools are about to change, and /rewind (or Esc twice on an empty prompt) puts them back. Most "rewind is broken" reports aren't bugs. The change you wanted undone was made some way that checkpoints don't track.
What the rewind menu offers
Pick a prompt from the list, then one of these:
| Option | What it does |
|---|---|
| Restore code and conversation | Reverts tracked files and the conversation to that point |
| Restore conversation | Rewinds the chat but leaves files as they are now |
| Restore code | Reverts tracked files but keeps the conversation |
| Summarize from here / Summarize up to here | Compresses part of the conversation to free context. Files on disk don't change |
| Never mind | Back to the list, nothing changed |
The two code options only appear when the selected checkpoint has tracked file changes to revert. A common mix-up: Restore conversation and both summarize options never touch your files.
9 causes, in the order to check them
- Bash made the change, not Claude's edit tools. A file that only shell commands changed (a
sed, a formatter,npm install, a code generator,rm) isn't tracked, so/rewindleaves it as it is. There's one exception: once Claude has edited a file with its file-editing tools in your conversation, later Bash changes to that same file are undone too. For everything else, use Git:git diffto see the change andgit restore <file>(orgit checkout -- <file>) to undo it. - A subagent made the edits. Claude Code usually doesn't capture subagent edits in your session's checkpoints. Rewinding restores only files Claude had already edited in your own conversation, and the subagent's edits to other files stay. That includes background forked skills (the default for a skill with
context: fork) and a background/code-review --fixrun. A forked skill running in the foreground (background: false) edits during your own turn, so its edits rewind normally. - You, your editor or another session changed the file. Checkpointing only tracks files edited within the current session. Manual edits, an IDE's auto-format on save, and edits from another Claude Code session running in the same folder normally aren't captured, unless they touch the same files this session edited.
- The message you picked was typed mid-turn. A message you queued while Claude was still working can show No code restore in the menu, because it has no checkpoint of its own. Select the prompt that started that turn instead and choose Restore code. That reverts Claude's edits from the whole turn, including the ones made before your message arrived.
- Checkpointing is switched off. In
/config, Rewind code (checkpoints) controls thefileCheckpointingEnabledsetting, which is on by default. Check your user, project and local settings files for"fileCheckpointingEnabled": false, and your shell forCLAUDE_CODE_DISABLE_FILE_CHECKPOINTING, which turns it off for one session. Whichever one turns it off, the other can't turn it back on. Headless-pruns ignore the setting entirely: there's no rewind menu there, and file checkpointing needsCLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true(orenableFileCheckpointingin the Agent SDK). No files were restored: the backups are gone or the file is locked. Each file needs the backup saved before Claude edited it. Claude Code deletes a session's backups in its retention sweep, by default about 30 days after the session last saved one, so an old session you/resumestill lists its checkpoints but can't restore them. A fork made with/branchor--fork-sessioncopies the backups, and a copy that failed (for example on a full disk) is missing in the fork. Also check file permissions: if Claude Code can't write or delete the file, fix that and run/rewindagain. When the backups are gone, running it again fails the same way, so recover from Git or ask Claude to reverse its edits. To keep backups longer, raisecleanupPeriodDays(default30) in settings. On versions before v2.1.260, missing backups were skipped silently and the rewind looked like it worked.Restored the code, but skipped N files: links. Since v2.1.216, a code restore skips any tracked path that is (or became) a symlink, hard link or other non-regular file, whose directory changed since the checkpoint, or whose backup can't be safely read. Skipped files keep their current contents. Config files that a dotfile manager symlinks into your project and files pnpm hard-links into place are the usual culprits. The message only gives a count; run/debugbefore your next restore and the log at~/.claude/debug/<session-id>.txtnames each path, or find links yourself withfind . -type landfind . -type f -links +1. Undo those by hand or ask Claude to reverse the edit.- The checkpoint is older than the last 100. Claude Code keeps file snapshots for the 100 most recent checkpoints in a session. In a very long session, the earliest prompts may no longer have snapshots to restore.
- Rewound messages came back after you quit. If you rewind the conversation and exit before sending another prompt, the rewound messages can return when you resume. Run
/rewind, pick the same prompt, choose Restore conversation, then send Claude a prompt before you exit, because Claude Code saves the rewound conversation together with that prompt. Files you restored stay as the rewind left them.
Two things rewind does that people miss
- It can bring back a conversation you
/cleared. If you ran/clearearlier in the same Claude Code process, the top of the rewind menu has a/resume <session-id> (previous session)entry. It's there until you exit or resume a different session. - Summarize can take instructions. Highlight a Summarize option with the arrow keys and type what to focus on where the row says add context (optional), then press
Enter. Pressing the option's number key summarizes right away with no instructions. To try a different approach while keeping the original session intact, use/branchorclaude --continue --fork-sessioninstead.
Make undo boring: pair checkpoints with Git
Anthropic is explicit that checkpoints are for quick, session-level recovery and not a replacement for version control. A habit that covers every gap above: commit (or git stash) before you hand Claude a big task, so Bash changes, subagent edits and expired backups can all be undone with git restore or git reset. If you aren't comfortable with Git, at least run git init and commit once in each project folder; git diff then shows exactly what changed.
If /rewind fails because the session itself broke, for example an API error on every turn, see Claude Code API errors or Claude Code stuck or not responding. If you rewind mostly to free space rather than undo edits, Claude Code context filling up fast has nine fixes.
Facts on this page come from Anthropic's Claude Code docs on checkpointing, the error reference and the settings reference. This guide isn't affiliated with Anthropic.