Claude Code Checkpoints
Checkpoints are Claude Code'scode safety rollback toolthat automatically tracks Claude's file edits, helping you quickly undo unwanted changes and preventing situations where broken code is hard to recover from.
How checkpoints work
Checkpoints run automatically in the backgroundwhen you use Claude Codewith no manual configuration needed:
- Automatic creationAfter each user prompt is sent, a checkpoint is automatically created to record the current code state
- Persistent storageCheckpoints are preserved across sessions. Even after closing a session, you can still access historical checkpoints when you resume later
- Automatic cleanupCheckpoints older than 30 days are automatically deleted (cleanup time is configurable)
Note: Only direct modifications made by Claudethrough file editing tools are trackedChanges made by other means will not be recorded.
How to use checkpoints to revert changes
1. Open the revert menu
There are two ways to trigger it, choose either one:
- Keyboard shortcut: Press twice
Esc(Esc+Esc) - Slash command: Enter
/rewind
2. Choose the revert type
After opening the menu, you can choose from three revert modes based on your needs:
| Revert type | Effect | Applicable scenario |
|---|---|---|
| Conversation only | Revert to previous conversation content, keep current code changes | When you feel the conversation has gone off track and want to ask a new question, but the code changes are fine |
| Code only | Restore files to a previous state, keep current conversation | When the code is broken but you want to continue adjusting based on the current conversation |
| Code and conversation | Revert both code and conversation to a previous state | When you want to completely start over and return to a satisfactory point |
Common use cases
Checkpoints are especially suitable for the following development scenarios:
- Explore multiple approachesTry different code implementation ideas; if unsatisfied, revert to the starting point with one click and try another approach
- Quickly fix mistakesWhen Claude's changes introduce bugs or break functionality, quickly revert to the working state before the changes
- Iterative feature developmentRun multiple variant experiments on a feature and restore to a stable intermediate version at any time
Important limitations
Checkpoints are atemporary safety netnot a universal solution; you need to be aware of their boundaries:
Does not track Bash command changes
likerm mv cpFile operations executed through Bash tools are not recorded by checkpoints and cannot be reverted.
Does not track external changes
Only files edited by Claude within the current session are tracked. Manual changes you make in external tools like VS Code, the terminal, or modifications from other sessions will not be captured.
Cannot replace version control tools
Checkpoints are only used forsession-level temporary rollbackand are not suitable for long-term project management and team collaboration.
- Long-term history, branch management → use version control tools like Git
- Checkpoints = local temporary undo, Git = permanent project history