Checkpoints & Rewind
Claude Code automatically snapshots your code before every edit — /rewind lets you undo to any earlier point, with fine-grained control.
Claude Code moves fast and sometimes goes down the wrong path. Automatic checkpoints (session-level snapshots taken before every prompt that starts a turn) mean you're never stuck with a bad change: press Esc twice, or run /rewind, to see every prompt in the session and jump back to any point — restoring code, conversation, or both.
What's grown since the video: beyond a full restore, /rewind now also offers “Summarize from here” / “Summarize up to here” for freeing context without discarding work (see Compacting Context). Worth knowing as a genuine limitation, not a video inaccuracy: checkpoints only track edits made through Claude's own file-editing tools — changes made via a Bash command (like rm, mv, or a script) aren't captured and can't be undone this way, and neither are most subagent edits. This is a session-recovery tool, not a replacement for git.
Real-life use cases
Undoing a refactor that made things worse
Twenty minutes into a refactor that's clearly gone sideways, a developer opens /rewind, picks the checkpoint from before the refactor started, and restores both code and conversation — recovering instantly instead of manually reverting file by file.
Comparing two approaches cheaply
A user tries one implementation approach, checkpoints naturally capture it, they don't like the result, rewind to before that approach, and try a second one — without ever needing to think about git branches for what's really just exploratory iteration.
Source
- Source video: “Claude Code Explained” — 27 concepts in 27 minutes (YouTube)https://www.youtube.com/watch?v=ZlDnsf_DOzg
- Checkpointinghttps://code.claude.com/docs/en/checkpointing