Feature deep-dive

Claude Code Checkpoints and /rewind: Undo a Bad AI Coding Turn

Every prompt you send snapshots the files Claude Code edits. Press Escape twice, pick the moment the session went off track, and roll the code and the conversation back together — no commit required.

Claude Code rewind confirmation dialog listing Restore code and conversation, Restore conversation and Restore code, with a note that the conversation will be forked and that bash edits are not restored
The rewind confirmation screen in Claude Code: three restore scopes, and a warning about the files Claude never touched.

An illustrated walkthrough of 13 steps - about 5 minutes to read. Every step links back to the exact moment in the source video.

TL;DR

Every message you send creates a checkpoint: a snapshot of the files Claude Code edited plus the conversation up to that point. Open the list with /rewind, or with two presses of Escape on an empty input, choose the prompt to return to, and pick one of three scopes - Restore code and conversation, Restore conversation, or Restore code. The confirmation screen names the file it will rewrite and the line counts, and warns that rewinding does not affect files edited manually or via bash. It is a local undo for the current session, not a substitute for git.

Source video

This page follows the anxious engineer recording of a Claude Code session and rebuilds its rewind steps one frame at a time. Every screenshot links to the exact moment it appears.

Screenshots are frames from the video, credited to the creator; the write-up is our own. Steps verified against the video and the Claude Code docs in September 2026.

Checkpoints you never had to make

There is no save command. Each prompt you send is a point you can return to, with the files it changed listed alongside it.

  1. 1

    Start the session you will later want to undo

    The recording opens with /clear, then one long prompt: build a React button component, split the work into steps, ask for approval at the end of each one, and keep the progress in button.tsx. Nothing has been saved yet - the status line reads 0 tokens - but sending this message is what creates the first checkpoint.

    Claude Code terminal at the start of a session where a /clear command and the first multi-step React button prompt sit above an empty 0 token context meter, the moment the first checkpoint is created
    One prompt, one checkpoint, before any code exists.Watch at 0:04
  2. 2

    Step 1 lands and the todo ticks off

    Claude writes button.tsx with the types, the props interface and the forwardRef wrapper, strikes through the first todo, and stops to ask for approval. This is a clean stopping point - the state the session will later rewind to.

    Claude Code reporting Step 1 Complete with a struck-through todo item while VS Code shows the freshly created button.tsx component that a later rewind can restore
    A stopping point worth being able to return to.Watch at 0:28
  3. 3

    Your approval is another checkpoint

    Typing step 1 complete. continue. does two things at once: it approves the next step, and it records another restore point. Checkpoints are keyed to your messages rather than to Claude's edits, so the more you steer, the more places you can land.

    Typing the step 1 complete approval message into the Claude Code input box, the user prompt that becomes the next rewindable checkpoint for button.tsx
    The message that becomes the rewind target.Watch at 0:40

Opening the rewind list

Two escapes, or /rewind, and the whole session appears as a list of your own messages.

  1. 4

    The turn you regret

    Step 2 Complete reports variantStyles and sizeStyles built from Tailwind utility classes, and VS Code shows the bg-blue-600 strings now sitting in the file. The project does not use Tailwind. The work is not lost, it is just the wrong direction - which is exactly what checkpoints are for.

    A Claude Code transcript where Step 2 Complete lists variantStyles and sizeStyles maps built from Tailwind classes, with VS Code highlighting the bg-blue-600 utility strings the author now wants gone
    A finished step that is wrong for this project.Watch at 1:10
  2. 5

    Press Escape twice to open Rewind

    With the input box empty, two Escape presses open the Rewind panel - the same screen /rewind brings up. Its header reads Restore the code and/or conversation to the point before..., and below it is one entry per message sent this session, each with the file that message changed and the line counts, like button.tsx +45 -0. /clear shows up too, marked No code changes. Enter continues, Esc exits.

    The Claude Code Rewind menu opened by pressing Escape twice, listing every prompt in the session with its per-file diff counts such as button.tsx +45 -0
    Every prompt in the session, with the diff it caused.Watch at 1:18
  3. 6

    Highlight the last message that was good

    Move the marker onto step 1 complete. continue. - the prompt sent before the Tailwind work started - and press Enter. Restoring to the point before a message means everything after it gets rolled back, so choose the entry that was still healthy rather than the one you want repeated.

    Moving the selection marker onto the earlier step 1 complete checkpoint inside the Claude Code rewind list so only the Tailwind edits made after it get rolled back
    Selecting the checkpoint from before the mistake.Watch at 1:26

Choosing what comes back

Code, conversation, or both - the confirmation screen shows the diff before anything changes.

  1. 7

    Pick a restore scope: code, chat, or both

    The confirmation screen names the chosen message and its age, states that the conversation will be forked, and prints the exact file operation - The code will be restored in button.tsx +1 -47. Three options follow: 1. Restore code and conversation, 2. Restore conversation, 3. Restore code. The line underneath is the one to remember: Rewinding does not affect files edited manually or via bash.

    Claude Code rewind confirmation screen offering Restore code and conversation, Restore conversation, or Restore code, plus the warning that rewinding does not affect files edited manually or via bash
    Three scopes, plus a warning about what is out of reach.Watch at 1:44
  2. 8

    The session is back at Step 1

    After confirming, the transcript ends where it did before the Tailwind step: Step 1 Complete on screen, the approval question unanswered, and the original prompt sitting in the input box. The file on disk has gone back to the checkpoint state as well, because option 1 restores both halves.

    Claude Code immediately after a checkpoint restore, with the transcript back at Step 1 Complete and the original prompt sitting in the input box ready to reuse
    Chat and files rewound together.Watch at 1:48
  3. 9

    Edit the restored prompt instead of retyping it

    Because the rewound message comes back as editable input, you can change the instruction rather than repeat it. Here the author inserts please use only vanilla css into the same approval prompt: the rewind did the undo work, the edit supplies the new direction.

    Editing the restored Claude Code prompt in the input box to add a vanilla CSS constraint before resending it from the rewound point in the conversation
    Same prompt, one extra constraint.Watch at 1:56
  4. 10

    Send it and let the session continue

    The amended prompt runs from the forked point. Claude Code shows its working state with the esc to interrupt hint, and the todo list is still the one from before the rewind. Nothing from the discarded branch is carried into the new turn.

    Claude Code running the amended step 1 complete please use only vanilla css prompt, showing the esc to interrupt hint and the untouched todo checklist after the rewind
    The redo, launched from the checkpoint.Watch at 2:04

After the rewind

The prompt is back in the input box ready to edit, and the timeline reopens with the new checkpoint in place.

  1. 11

    Step 2, redone the way you asked

    Step 2 Complete now lists baseStyles, variantStyles, sizeStyles and disabledStyles as plain style objects, and says Vanilla CSS via inline styles (CSSProperties). The same step with a different implementation, produced without hand-editing anything Claude wrote the first time.

    A rewound Claude Code session where the regenerated Step 2 summary lists Vanilla CSS via inline styles (CSSProperties), confirming the checkpoint restore and the new prompt both took effect
    The same step, rebuilt without Tailwind.Watch at 2:14
  2. 12

    Check the file, not just the summary

    In VS Code, button.tsx imports CSSProperties from react and opens a baseStyles object holding border, borderRadius, cursor and transition. That is the proof the restore worked at the file level - the Tailwind class strings are gone, not merely hidden further up the transcript.

    VS Code editor pane below a Claude Code session showing button.tsx with the CSSProperties import and a baseStyles object, the file state produced after restoring to an earlier checkpoint
    The rewound file open in the editor.Watch at 2:26
  3. 13

    Reopen Rewind to see the new timeline

    Opening the list again shows the session as it now stands: the original build prompt with button.tsx +45 -0, then the amended vanilla CSS message with button.tsx +71 -1, then (current). The rewound branch is no longer offered as a restore point, which is why a checkpoint you are happy with should become a git commit.

    The Claude Code Rewind checkpoint list reopened after a restore, where the rewound prompt now reads step 1 complete please use only vanilla css if needed with a button.tsx +71 -1 diff count
    The rewound timeline, one checkpoint richer.Watch at 2:38

Frequently asked questions