Skip to main content
Tips

beginner tip

Undo Claude's Changes Instantly with Rewind Checkpoints

AIErudit angle: When an agent takes a wrong turn, the recovery skill that separates confident operators from stuck ones is knowing you can rewind to any prior checkpoint in seconds. Claude Code auto-snapshots before every prompt, so you can revert code, conversation, or both without fear — a core habit for iterating boldly on AI-generated work.

checkpointsrewindclaude-codetips
Tip visual

Published: Feb 3, 2026 Updated: 2026-04-28

Original: https://wmedia.es/en/tips/rewind-changes-instantly-with-checkpoints

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 quickly, or type /rewind. Select the checkpoint and what to restore:

Esc + Esc     → Opens the rewind menu
/rewind       → Same thing, via command

3. Choose what to restore

OptionWhat it does
Both code and conversationRestores files and rewinds the chat to that point
Code onlyReverts file changes, keeps the full conversation
Conversation onlyRewinds the chat, keeps current file state

Reference

FeatureDetails
TriggerEsc • Esc or /rewind
Checkpoint creationAutomatic on every user prompt
PersistenceSurvives session restarts and /resume
Retention30 days (configurable via cleanupPeriodDays)
TracksFile edits made through Claude's editing tools
Does NOT trackBash 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
  • Checkpoints are session-level recovery, not a replacement for Git

Official docs: Checkpointing