Checkpoint and rewind
Snapshot the code before each agent turn, and go back to it when the agent goes off track.
Also called Checkpointing
Cursor, Anthropic, Simon Willison
The problem
The agent sometimes builds the wrong thing, and starting over often works better than repairing it.
Sometimes the agent builds something that doesn't match what you wanted.
Starting over often has a higher success rate than trying to fix Claude’s mistakes.
Therefore
As you work with Claude, checkpointing automatically captures the state of your code before each prompt you send that starts a turn.
Checkpoints save snapshots of your codebase during an Agent session. Agent automatically creates them before making significant changes, capturing the state of all modified files.
Keeping code in version control lets us record how that code changes over time and investigate and reverse any mistakes.
In use
Anthropic’s Claude Code team
Teams emphasize starting from a clean git state and committing checkpoints regularly so they can easily revert any incorrect changes if Claude goes off track.
Claude Code
Claude Code automatically tracks Claude’s file edits as you work.
Where it breaks
Only the agent’s own file edits are saved: a file changed by a shell command stays changed, and lasting history belongs in Git.
A file that only Bash commands changed isn’t tracked and stays as it is.
Checkpoints are stored locally and separate from Git. Only use them for undoing Agent changes; use Git for permanent version control.
Sources
- Best practices for coding with agentsLee Robinson, Cursor, Jan 9, 2026
- How Anthropic teams use Claude CodeAnthropic
- CheckpointingAnthropic
- OverviewCursor
- Using Git with coding agents - Agentic Engineering PatternsSimon Willison
Added Nov 14, 2026