Claude Code's restore point system
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.
Checkpoints are independent of git. They work even if you have no commits. Use them to explore risky changes without polluting your history.
# 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"
Claude Code creates checkpoints automatically before: editing more than 5 files simultaneously, running migration scripts, installing or removing dependencies, and database operations.
# 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)
Combine checkpoints with git: checkpoint for quick exploration, commit when you find the right solution. The checkpoint is ephemeral, the commit is permanent.