← Claude Code Hub
✦ Tip #002 Feb 3, 2026

Claude Code Rewind: Undo Changes Instantly with Checkpoints

Every prompt creates an automatic checkpoint. If Claude breaks something, press Esc twice and rewind to any previous state in seconds.

Claude Code automatically snapshots your code before every edit. Each time you send a prompt, a checkpoint is created. If Claude takes a wrong turn — breaks a feature, goes down the wrong path, or over-engineers a solution — you can rewind to any previous state in seconds. Checkpoints persist across sessions and are cleaned up automatically after 30 days.

Result:

> Esc Esc  (press Escape twice)

┌─ Rewind to ──────────────────────────┐
│ ● Message 5: "Add auth middleware"   │
│ ○ Message 4: "Create user model"     │
│ ○ Message 3: "Set up database"       │
│                                      │
│ Restore: ◉ Both  ○ Code  ○ Convo    │
└──────────────────────────────────────┘

Setup

No setup needed. Checkpointing is enabled by default.

1. Make some changes with Claude

Work normally — every prompt you send creates a checkpoint automatically.

2. Rewind when needed

Press Esc twice with the input empty, or type /rewind:

Esc + Esc     → Opens the rewind menu (only when you haven't typed anything)
/rewind       → Same thing, via command

If you had text half-written, double Esc clears it instead of opening the menu. You don't lose it: it goes to your input history, so Up brings it back once you're out of the menu.

3. Choose what to do with that point

Option What it does
Restore code and conversation Reverts files and rewinds the chat to that point
Restore conversation Rewinds the chat and leaves files as they are now
Restore code Reverts file changes and keeps the conversation
Summarize from here Compresses the conversation from that point forward, freeing context
Summarize up to here Compresses everything before that point, leaving recent messages intact
Never mind Back to the list without touching anything

The two code options only show up when that checkpoint has tracked file changes to revert. If no edits were captured, the menu offers restoring the conversation, the summarize options, and leaving.

And if you ran /clear earlier in the same process, an extra entry sits at the top of the list to resume the conversation from before that /clear (since v2.1.191).

Reference

Feature Details
Trigger EscEsc with an empty input, or /rewind
Checkpoint creation Automatic on every user prompt
Snapshots kept The 100 most recent checkpoints in the session
Persistence Survives session restarts and /resume
Retention 30 days, in plain text on your disk (configurable via cleanupPeriodDays)
Tracks File edits made through Claude's editing tools
Does NOT track Bash commands (rm, mv, cp), external edits

Limitations

  • Files modified by bash commands (e.g., rm file.txt) are not tracked
  • Manual edits you make outside Claude Code are not captured
  • What a subagent edits usually isn't restored by a rewind. The exception is a skill with context: fork running in the foreground, which edits during your own turn. Everything else, including any background subagent, is a job for git rather than rewind. Where a subagent runs changes more than you'd think: it also trims its tools
  • Symlinked and hard-linked paths are not rewound. Restoring code prints Restored the code, but skipped N files and those files keep their current contents
  • Checkpoints are session-level recovery, not a replacement for Git

Official docs: Checkpointing

Esc Esc rewinds, but a single Esc is a different move: stop and redirect Claude mid-task without losing what it's done.

The same Rewind menu can also compress context without undoing anything: free up context without losing recent work with Summarize up to here.

Workshop for teams

Multiply your team's output without sacrificing quality: a 6 to 8 hour AI First workshop, online, on the Claude platform.

See the workshop
Free guide

The 51 essentials, as a PDF.

One page per tip. Five chapters. What I actually use daily in production — no theory, no fluff.

  • I. Getting started 10 tips
  • II. Awareness 3 tips
  • III. Mastery 22 tips
  • IV. Autonomy 10 tips
  • V. Comparison 6 tips
Are you a professional Web developer?

You'll receive the guide by email · You join the Gravitas newsletter · Unsubscribe anytime

of 51
#

Wmedia · 51 Tips
Free guide · 51 tips · 5 chapters

The 51 essentials, as a PDF.

Are you a professional Web developer? · Unsubscribe anytime