intermediate·
8 min

Checkpoints: explore without fear of breaking things

Claude Code's restore point system

What are checkpoints?

Checkpoints are snapshots of your project state at a given moment. Claude Code creates them automatically before significant changes, and you can create them manually whenever you want. If something goes wrong, you return to the checkpoint with one command.

INFO

Checkpoints are independent of git. They work even if you have no commits. Use them to explore risky changes without polluting your history.

Creating and restoring checkpoints

Checkpoint commandsbash
# Create manual checkpoint
/checkpoint "before refactoring auth"

# List all checkpoints
/checkpoints list

# Restore to last checkpoint
/restore

# Restore to a specific checkpoint
/restore "before refactoring auth"

# Compare current state vs checkpoint
/diff checkpoint "before refactoring auth"

When to use checkpoints

  • Before large refactors: "going to rewrite the auth module"
  • Before migrating dependencies: "upgrading from React 18 to 19"
  • Before experiments: "trying a different architecture"
  • When Claude proposes large changes and you're unsure
  • In pair programming: checkpoint = "point of agreement"

Automatic checkpoints

Claude Code creates checkpoints automatically before: editing more than 5 files simultaneously, running migration scripts, installing or removing dependencies, and database operations.

Configure automatic checkpoints in CLAUDE.mdbash
# In your CLAUDE.md
## Checkpoints
- Create automatic checkpoint before any changes in /src/api/
- Create checkpoint before modifying configuration files
- Maximum 10 saved checkpoints (delete oldest ones)
TIP

Combine checkpoints with git: checkpoint for quick exploration, commit when you find the right solution. The checkpoint is ephemeral, the commit is permanent.