PTN—37
Checkpoints & branches
Give long AI sessions save-points: restore to before a bad turn, or branch to try an alternative without losing the original.
Undo is built for keystrokes; AI sessions need save-points built for turns. One agent message can rewrite six files, and one bad prompt can send a document somewhere it takes ten minutes to notice and an hour to unwind. Checkpoints make the session’s history addressable: every consequential state change gets a marker, and any marker can be restored. The unit of recovery matches the unit of damage — a turn, not a keystroke — which is what a generic undo stack never gives you.
Restore has to be honest about its blast radius. “Restore to checkpoint 4” must state what it reverts — which files, which edits, which conversation turns — because a restore that silently takes the person’s own work with it converts the safety net into a second hazard. Cursor’s checkpoint restore earns trust precisely because it is scoped and stated: the workspace returns to the moment before that agent message, and you knew that before you clicked.
Branching is the offensive use of the same machinery. Restore says “that was wrong”; branch says “what if we tried it another way, without betting the original.” Exploratory work with AI is naturally tree-shaped — two tones for the email, two architectures for the feature — and forcing that tree through a linear session means every experiment overwrites the incumbent. A branch preserves the original by construction, so trying the alternative costs nothing but the attempt.
The tree only works if you can see where you are in it. The current branch needs a visible label, the checkpoint markers need to live in the transcript where the turns are, and getting back to any prior state needs to be one click. A history that exists but cannot be navigated is an archive, not a control — people will re-do work by hand before they will spelunk for a restore point they cannot see.
Anatomy
Session · campaign email
Branch · main draftTurn 1 — Drafted the spring tune-up campaign email
Turn 2 — Rewrote the offer as an $89 flat rate
Turn 3 — Added an urgency line — “this week only”
A session timeline with restorable checkpoints and a labeled branch — recovery and exploration on the same machinery.
- 1Checkpoint markers. Every consequential state change gets a marker in the timeline, created automatically — not on request.
- 2Scoped restore. Restore is one click and states exactly what it reverts before it does — files, edits, turns.
- 3Branch label. The current branch is named and visible, so you always know which version of the work you are in.
- 4Preserved original. Branching copies forward instead of overwriting — the original survives every experiment by construction.
When to use
- Sessions run long enough that one bad turn can bury an hour of good ones.
- Agent turns mutate real state — files, documents, canvases — beyond the transcript itself.
- The work is exploratory and people need to try alternatives without sacrificing the original.
- Regenerating from scratch is expensive — long context, accumulated setup, paid compute.
Design considerations
- 01Checkpoint automatically at every consequential state change — a save-point the person had to remember to create is a save-point that does not exist.
- 02State the blast radius before restoring: which files, edits, and turns revert, and what the person’s own work loses, if anything.
- 03Separate the AI’s changes from the person’s where possible, so restore removes the bad turn without eating their edits.
- 04Put checkpoint markers in the transcript itself — recovery lives where the mistake is visible, not in a separate history panel.
- 05Label branches by what differs, and keep switching between them one click each way.
- 06Expire checkpoints honestly: if history is kept for the session only, say so before the person builds a workflow on it.
Pitfalls
- ✕Manual-only checkpoints — the person who most needs a restore point is the one who did not know the turn would go wrong, so opt-in save-points protect nobody.
- ✕Restores that overreach: reverting the agent’s edits and the person’s last twenty minutes together, teaching people the safety net is more dangerous than the mistake.
- ✕Invisible branching — the session forked, but nothing says which branch is live, so people polish the wrong version and lose the work anyway.
- ✕Checkpoint sprawl: marking every trivial turn until the timeline is noise and finding the restore point that matters takes longer than redoing the work.
In the wild
- Cursor
- Creates a checkpoint at each agent message and offers one-click restore of the workspace to the state before that turn — scoped, stated, and in the transcript.
- ChatGPT
- Editing an earlier message forks the conversation into a new branch while keeping the original reachable through the version toggles on that turn.
- Figma
- Branching lets designers explore an alternative on a copy of the file and merge or discard it later — the original is never the experiment.
- Claude
- Artifacts keep prior versions as the AI revises them, so an over-eager rewrite can be stepped back to any earlier state of the document.