In Claude Code, a checkpoint is an automatic savepoint, and /rewind is the command that takes you back to one. As you work, Claude Code captures the state of your files before each edit it makes. When something goes wrong, you run /rewind, pick an earlier point, and roll your code, your conversation, or both back to how they were. Think of checkpoints in Claude Code as a safety net that makes it safe to let Claude make bold changes, because you can always return to the last good state.

What checkpoints in Claude Code actually are

You don't set checkpoints up and you don't have to remember to create them. Claude Code does it for you. Every prompt you send starts a new checkpoint, and before Claude edits a file with its editing tools, the prior state is saved. Those savepoints stick around across sessions too, so if you close Claude Code and come back to a resumed conversation, your checkpoints are still there. They're cleaned up automatically along with the session after 30 days, which is adjustable.

checkpoints this session
1"Set up the new pricing page"Saved before Claude touched any filesSaved
2"Add the discount logic"Saved before the edit -- last good stateSaved
3"Now wire it into checkout"This is the edit that broke somethingCurrent

Every prompt you send opens a new checkpoint you can return to.

How /rewind works

You open the rewind menu two ways: type /rewind, or press Esc twice while the prompt box is empty. (If there's text in the box, a double Esc clears it instead, so clear or send your message first.) The menu lists every prompt you sent during the session. You pick the point you want to go back to, then choose what to do with it.

There isn't just one kind of rewind. Once you pick a point, you decide how much to roll back:

  • Restore code and conversation -- put both your files and the chat back to that point.
  • Restore conversation -- rewind the chat to that message but keep your current code.
  • Restore code -- undo the file changes but keep the conversation going.
  • Summarize from here -- instead of rewinding, compress the chat from that point forward into a short summary to free up room. This does not change your files.
Restore vs. summarize: restoring undoes changes and takes you back in time. Summarizing leaves your files exactly as they are and just tidies up the conversation to save space. They live in the same menu but do very different jobs.

A real example

Say you asked Claude to add a discount feature and it worked. Then you asked it to wire that feature into checkout, and now the page throws an error. Instead of reading through every change Claude made and undoing them by hand, you rewind.

/rewind

Open the rewind menu, then pick your last good checkpoint. Click to copy.

In the menu you select the "Add the discount logic" prompt -- the last point where things worked -- and choose Restore code and conversation. Your files snap back to that state, the broken checkout edit is gone, and you can try the wiring again with a clearer instruction. The whole thing takes seconds, and you never had to figure out which edit did the damage.

Step 1An edit goes wrongClaude makes a series of changes and something breaks.
Step 2Run /rewindPick the last checkpoint where things still worked.
Step 3Try againYou're back to a clean state, ready to give a better instruction.

What checkpoints do not cover

Checkpoints are a session-level undo, not a full backup, and it helps to know the edges. A few things are outside their reach:

  • Files changed by terminal commands. Checkpoints only track edits Claude makes through its file-editing tools. If Claude ran a command that deleted, moved, or copied a file, rewind can't undo that.
  • Changes made outside the session. Edits you make by hand, or from another Claude Code session at the same time, generally aren't captured unless they happen to touch the same files.
  • Long-term history. Checkpoints are for quick recovery inside a session. They complement version control like Git; they don't replace it. Treat checkpoints as "local undo" and Git as your permanent history.
The point of checkpoints is confidence. You can hand Claude an ambitious task and know that if it goes sideways, getting back to solid ground is one command away.

When to reach for /rewind

Rewind earns its keep any time you're moving fast. Trying two different approaches and want to test the second from a clean start? Rewind between them. An edit introduced a bug you can't easily trace? Rewind to before it. A debugging session got long and noisy and you want to reclaim room without losing your original instructions? Summarize from the midpoint. It's the command that lets you experiment freely instead of tiptoeing.