Checkpoints and Restore

Checkpoints and restore is an AI agent UX pattern that saves named snapshots before significant agent actions and offers one-click restore to those points. It makes ambitious automation safe by designing undo as infrastructure, not an afterthought.

Share

Interactive demo

Add a simple login helper in login.ts

Added login(user, pass) that looks up the user in the database.

Refactor it to hash passwords first

Updated login to hash the password, then query with the hash.

Overview

The design problem

How might we let people undo a bad agent turn by jumping the thread back to an earlier prompt or change?

Use this pattern

When agent turns mutate durable state in a conversation

  • Coding agents that edit files across several prompts in one thread.
  • Multi-step chats where a later ask undoes or breaks earlier work.
  • Products where users need to discard “everything after this reply” without hunting version history.
  • Any flow where confidence comes from knowing you can return to a labeled turn, not after something breaks.

Avoid this pattern

When snapshots would add noise without recovery value

  • Read-only assistants that never mutate state worth snapshotting.
  • Environments with no durable storage for checkpoints.
  • Tiny single edits where ordinary undo already covers risk.

States

Design checkpoints as restore points on the thread, not as a buried version menu.

Checkpoints and restore in a thread

Loading diagram…

  1. 01

    Turn complete

    An agent reply finishes. That point in the thread becomes a restorable checkpoint.

  2. 02

    Thread continues

    Later prompts and edits stack on top. Earlier checkpoints stay attached to their turns.

  3. 03

    Restore offered

    Earlier agent replies expose “Restore to this checkpoint” when newer turns exist.

  4. 04

    Confirming

    If restore removes later messages, say so before cutting the thread.

  5. 05

    Restored

    The thread ends at the chosen turn. Later prompts and their side effects are gone.

  6. 06

    Continue from here

    The user can prompt again from the restored point, or leave the checkpoint as-is.

Key UX elements

The parts that must be present for rollback to feel trustworthy.

Snapshot

Put restore on that turn in the thread.

A checkpoint action under an earlier agent reply beats a buried history panel.

Restore

One clear action: go back to this point.

Copy like “Restore to this checkpoint” should mean later turns disappear and work reverts.

Confirm

Warn when later messages will be removed.

Ask “Discard all changes up to this checkpoint?” before cutting the thread. Keep Cancel and Continue only.

Anti-patterns to avoid

  • Checkpoints that exist but are not labeled to the agent step they protected.

  • Restore that partially applies and leaves systems inconsistent.

  • No checkpoint before irreversible external side effects (send, charge, delete).

  • Infinite checkpoint lists with no prune or favorite.

How products use it

ProductImplementation
CursorAgent checkpoints and restore tied to code changes.
Git-based agentsCommits or stashes as restore points before bulk edits.
Design tools with AIVersion history snapshots before generative edits.
Devin-style coding agentsWorkspace snapshots users can roll back after long runs.

Implementation

Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.

Generate a production-ready implementation of the "Checkpoints and Restore" AI interface design pattern.

Pattern Definition:

Frequently asked questions

What are checkpoints and restore in agent UX?

Checkpoints capture named state before an agent makes a big change; restore returns to that state in one action so users can approve ambitious work without fear of permanent damage.

When should an agent create a checkpoint?

Before bulk edits, migrations, permission changes, or any step that is hard to reverse. Optionally let users pin checkpoints at milestones they choose.

How do checkpoints differ from reversibility marking?

Reversibility marking labels how hard an action is to undo. Checkpoints provide the actual restore mechanism. Use labels to set scrutiny and checkpoints to recover.

Weekly AI UX in your inbox

Weekly AI interface UX notes and resources on Substack, no spam, unsubscribe anytime.

Subscribe on Substack