The restore points an agent saved during a run. Each shows the step that made it, the files it changed, a short summary, and the cost and time so far. Pick two to compare them, restore to one after a question that shows what will be undone, and undo the restore. A live run adds checkpoints at the top without moving the reader.
On this page
- Restoring an agent run
- Reviewing what a step changed
- Comparing two points
- Long coding runs
- Ops agents
Examples
Restore and undo
Compare two checkpoints
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- checkpointsrequired
Checkpoint[]- { id, step, at (epoch ms), elapsedMs, cost, summary?, files: { path, status?, added?, removed?, before?, after? }[] }. `cost` and `elapsedMs` are the run's totals when the checkpoint was saved. Any order; the list shows the newest first. With before and after contents a comparison shows the real diff, otherwise the counts.
- current / onCurrentChange
string|null / (id) => void- Default
the latest - The checkpoint the run is at. Rows after it read Undone. Pass it to control it, and update it when onRestore resolves.
- onRestore
(id, signal) => Promise<void>- Restore the run to a checkpoint, after the question. The signal aborts on Cancel and on unmount; throw to show the message and keep the question open. Undo restore calls it again with the checkpoint the run was at. Without it there is no Restore.
- compared / defaultCompared / onComparedChange
string[] / string[] / (ids) => void- Default
[] - The checkpoints picked to compare, at most two; a third pick drops the oldest pick.
- open / defaultOpen / onOpenChange
string|null / string|null / (id) => void- Default
null - The checkpoint whose files and Restore button are open.
- formatCost
(n: number) => string- Default
$0.31 - How a cost is written.
- height
number- Default
440 - Height of the list before it scrolls.
- live
boolean- Default
true - Announce each new checkpoint to screen readers through a polite status.
- title / headingLevel
ReactNode / 2|3|4- Default
Checkpoints / 2 - The heading and the name of the region.
- Restore
question- Asks first, under the row: how many checkpoints and files it undoes (+/-), that the cost already spent stays spent, and the later checkpoints dim and read Will be undone. A target ahead of the run says Re-applies instead.
- Compare
net change- Pick two with the Compare toggle or C. Files are netted across the checkpoints between them: a file added and then deleted is not listed, a file edited twice is one entry. Cost and time between the two are shown.
- Live run
append- A new checkpoint appears at the top while the list is at the top. If the reader has scrolled, a N new checkpoints button waits instead, so the list never moves under them. Focus follows the checkpoint, not its position.
- Keyboard
list- Up, Down, Home, End, Page Up and Page Down move between checkpoints (one tab stop), Enter opens, R restores after the question, C adds or removes it from the compare pick, Escape closes the question.
- Motion
rows and panels- A new row slides in over 180 ms, the question and the comparison fold open in 180 ms, dimming is a 120 ms fade. Nothing plays on first render and reduced motion makes it instant.
- a11y
region- A named region with a list, a polite status for new checkpoints and for a restore, aria-expanded on each row, aria-pressed on the compare toggle. State is words (Current, Undone, Will be undone), never colour alone.
| Prop | Type | Default | Description |
|---|---|---|---|
| checkpointsrequired | Checkpoint[] | required | { id, step, at (epoch ms), elapsedMs, cost, summary?, files: { path, status?, added?, removed?, before?, after? }[] }. `cost` and `elapsedMs` are the run's totals when the checkpoint was saved. Any order; the list shows the newest first. With before and after contents a comparison shows the real diff, otherwise the counts. |
| current / onCurrentChange | string | null / (id) => void | the latest | The checkpoint the run is at. Rows after it read Undone. Pass it to control it, and update it when onRestore resolves. |
| onRestore | (id, signal) => Promise<void> | - | Restore the run to a checkpoint, after the question. The signal aborts on Cancel and on unmount; throw to show the message and keep the question open. Undo restore calls it again with the checkpoint the run was at. Without it there is no Restore. |
| compared / defaultCompared / onComparedChange | string[] / string[] / (ids) => void | [] | The checkpoints picked to compare, at most two; a third pick drops the oldest pick. |
| open / defaultOpen / onOpenChange | string | null / string | null / (id) => void | null | The checkpoint whose files and Restore button are open. |
| formatCost | (n: number) => string | $0.31 | How a cost is written. |
| height | number | 440 | Height of the list before it scrolls. |
| live | boolean | true | Announce each new checkpoint to screen readers through a polite status. |
| title / headingLevel | ReactNode / 2 | 3 | 4 | Checkpoints / 2 | The heading and the name of the region. |
| Restore | question | - | Asks first, under the row: how many checkpoints and files it undoes (+/-), that the cost already spent stays spent, and the later checkpoints dim and read Will be undone. A target ahead of the run says Re-applies instead. |
| Compare | net change | - | Pick two with the Compare toggle or C. Files are netted across the checkpoints between them: a file added and then deleted is not listed, a file edited twice is one entry. Cost and time between the two are shown. |
| Live run | append | - | A new checkpoint appears at the top while the list is at the top. If the reader has scrolled, a N new checkpoints button waits instead, so the list never moves under them. Focus follows the checkpoint, not its position. |
| Keyboard | list | - | Up, Down, Home, End, Page Up and Page Down move between checkpoints (one tab stop), Enter opens, R restores after the question, C adds or removes it from the compare pick, Escape closes the question. |
| Motion | rows and panels | - | A new row slides in over 180 ms, the question and the comparison fold open in 180 ms, dimming is a 120 ms fade. Nothing plays on first render and reduced motion makes it instant. |
| a11y | region | - | A named region with a list, a polite status for new checkpoints and for a restore, aria-expanded on each row, aria-pressed on the compare toggle. State is words (Current, Undone, Will be undone), never colour alone. |
What it handles
- 01Lists the restore points of one run, newest first, each with the step that saved it, a summary, the files it changed with +/- counts, and the cost and time so far.
- 02Compares any two checkpoints as one net change: files edited in between merge into one entry, a file added and then deleted is left out, and the cost and time between them are shown.
- 03Asks before restoring and says what it will do: how many checkpoints and files are undone, that the money already spent stays spent, with the later checkpoints dimmed.
- 04Lets a restore be undone: a banner after it brings the later checkpoints back with one press.
- 05Takes new checkpoints from a live run at the top without moving the reader: a scrolled list holds them behind a button, and focus stays on the checkpoint it was on.
- 06Works from the keyboard: arrows move, Enter opens, R restores after the question, C picks for comparing.
States
- First render
- Nothing. The list is as given
- none
- New checkpoint, list at the top
- The row slides in at the top
- 180ms, ease out
- New checkpoint, list scrolled
- Nothing moves; a button counts what is waiting
- none
- Restore question
- Folds open under the row; later rows dim and say Will be undone
- 180ms fold, 120ms fade
- Restoring
- The button spins and Cancel appears
- none
- Restore fails
- The message shows and the question stays
- none
- Restored
- Later rows read Undone and a banner offers Undo restore
- 180ms fold
- Compare
- The comparison folds open above the list
- 180ms, ease out
- Reduced motion
- Everything changes at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The list is as given | none |
| New checkpoint, list at the top | The row slides in at the top | 180ms, ease out |
| New checkpoint, list scrolled | Nothing moves; a button counts what is waiting | none |
| Restore question | Folds open under the row; later rows dim and say Will be undone | 180ms fold, 120ms fade |
| Restoring | The button spins and Cancel appears | none |
| Restore fails | The message shows and the question stays | none |
| Restored | Later rows read Undone and a banner offers Undo restore | 180ms fold |
| Compare | The comparison folds open above the list | 180ms, ease out |
| Reduced motion | Everything changes at once | 0ms |
Works with
- Trace WaterfallWhere each step of the run spent its time; a checkpoint is the step you can go back to.
- Run Budget and BoardThe money side of the same run: the cost on each checkpoint adds up to its total.
- Approval PromptAsks before an agent acts; checkpoints let a person go back after it did.
- Inline DiffThe diff that a comparison and each checkpoint's files are drawn with.
When to use
When to use
- Going back to a point in an agent run that was fine, after a later step went wrong, and being told what that will undo first.
- Reviewing what each step of a long coding or ops run changed, and comparing the state at two points in it.
When not to use
- Versions of a document, written and published by people: use Revision History.
- The git branches an agent worked on and how they split and merge: use Branch Graph.
- Where a run spent its time, step by step: use Trace Waterfall.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Agent Checkpoints to my app and wire it to my own data.
- I need going back to a point in an agent run that was fine, after a later step went wrong, and being told what that will undo first. Set that up with the Knowns UI Agent Checkpoints.
- Which Agent Checkpoints props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "agent-checkpoints" }) and search_docs({ query: "agent checkpoints" }). Pro props, full examples and source come back once your license key is in the MCP config.