Claude Code Rewind: Checkpoints as Your Time Machine
How the claude code rewind checkpoint system works: undo Claude's edits with /rewind or double Esc, restore code or conversation, and what it can't undo.
Every time you send a prompt, Claude Code quietly saves a checkpoint of your code — and the /rewind command (or pressing Esc twice) lets you roll files, the conversation, or both back to any of those points. It's a time machine for your files, and it's the single best anxiety cure for non-programmers.
I'm Evgeny, and my early sessions had a recurring nightmare: 'what if Claude breaks something and I can't even tell what it broke?' Checkpoints killed that nightmare. You can let Claude attempt ambitious things precisely because the road back always exists. Let's learn where the button is and — just as important — what it does not protect you from.
How do you undo Claude Code's last changes?
Run /rewind, or press Esc twice while the input field is empty. A menu opens listing every prompt you sent this session. Pick the moment things were still fine, then choose what to restore. One subtlety worth knowing: if you have text typed in the input, double Esc clears the text instead of opening the menu — the cleared text goes into your input history, so pressing Up brings it back afterwards.
/rewind
Same as double-tapping Esc on an empty input line. Checkpoints survive restarts: they persist across sessions and stick around for 30 days by default.
Restore code, conversation, or both?
The rewind menu offers three restore flavors. Restore code and conversation rolls everything back — the full do-over. Restore conversation rewinds the chat to that message but keeps your current files — perfect when the code is fine but the discussion went sideways. Restore code reverts file changes while keeping the conversation — handy when you want Claude to remember what was tried, just not keep the result. After a conversation restore, your original prompt from that point reappears in the input field, ready to re-send or rewrite.
> /rewind ◇ Restore code and conversation ◇ Restore conversation ◇ Restore code ◇ Summarize from here ◇ Summarize up to here ◇ Never mind
Those two summarize options are the menu's quiet bonus: they compress part of the chat into a summary without touching files at all — freeing context space when a long debugging detour is bloating the session. It's like /compact, but you choose which side of a chosen message gets squeezed.
Why is rewind not working on some changes?
Because checkpoints only track edits made through Claude's own file-editing tools. Three blind spots cause most 'rewind not working' complaints. First, bash commands: if Claude ran rm file.txt or mv old.txt new.txt in the terminal, rewind cannot bring that back. Second, external changes: files you edited yourself outside Claude Code, or edits from another concurrent session, normally aren't captured. Third, anything older than the cleanup window — checkpoints are cleaned up along with sessions after 30 days by default. If your loss falls in a blind spot, your savior is git, not rewind.
The docs put it perfectly: checkpoints complement version control, they don't replace it. Rewind is the 'oops, last twenty minutes' button; git commits are the 'this version worked, carve it in stone' ritual. Use both. Say to Claude: "commit the current working state to git before we try this experiment" — that's belt and suspenders.
How do you restore a whole session, not just edits?
That's a neighboring but different question. Rewind works inside a conversation: it rolls files and messages back to a point within the current session. If you closed the terminal and want the whole conversation back, you need the session commands instead: claude --continue reopens the latest chat in this folder, and claude --resume lists all of them. The nice part: checkpoints persist across sessions, so once you've restored yesterday's conversation, its rewind points are available again through the same /rewind.
When should you actually reach for checkpoints?
Three patterns from my practice. Exploring alternatives: let Claude build approach A, rewind the code, ask for approach B, compare — without losing your starting point. Recovering from mistakes: a change broke the app and you don't know which one — rewind to the last point where things worked and replay from there with a better prompt. And freeing context: summarize a noisy debugging stretch from its midpoint so the session stays sharp. If you instead want to keep both timelines alive and branch off, that's a different tool — claude --continue --fork-session forks the session while leaving the original intact.
Lab: break something on purpose
0/5Kicker: rewind only helps if you remember it exists in the moment of panic. So rehearse the panic once, calmly, in the lab above. Two Esc presses, one menu, disaster undone — and tomorrow you'll let Claude take on something genuinely ambitious.

Author
Evgeny Arsentyev
PhD · Chief Product Officer at a healthtech company
▌ Reading is the blue pill
Want to actually build this?
Guides explain. The free course transforms — personalized, gamified, and built to get you shipping fast.
◉ Take the red pill →