Agent Checkpoints
An agent run as restore points; going back branches instead of deleting.
The checkpoints of a run on a line, like commits. Pick one to see what came after it, then restore: a new attempt branches out from that point while the old one fades back but stays, so nothing is lost.
PROGet Agent Checkpoints and 176 other Pro components with pro lifetime — Get Pro
- Category
- AI Agent
- Access
- ProPro · unlocked
- Source
- 347 lines · one file
- States
- 5 drawn
- Added
- 13 Nov 2026
The decision inside it
Restoring can't unsend an email
Steps after the checkpoint that reached the outside world, an email sent or a payment made, are listed before you confirm with a plain warning that restoring won't undo them. Restoring never deletes the later work; it starts a branch.
When to use it
Use Agent Checkpoints to let people roll an agent run back to an earlier point, with what can't be undone listed first. To replay a finished run use Run Replay; for document versions use Version History.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Agent Checkpoints for this.
Install it: npx shadcn@latest add @liro/agent-checkpoints
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/agent-checkpoints.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { AgentCheckpoints, type Checkpoint } from "@/components/ui/agent-checkpoints";
export function RunCheckpoints({ checkpoints, head, restore }: {
checkpoints: Checkpoint[];
head: string;
restore: (id: string) => Promise<void>;
}) {
return <AgentCheckpoints title="Checkpoints" checkpoints={checkpoints} head={head} onRestore={restore} />;
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
checkpoints | Checkpoint[] | Yes | – |
head | string | Yes | The checkpoint the agent is at now. |
onRestore | (id: string) => void | Promise<void> | No | Restores to a checkpoint and starts a branch from it. May return a promise; a rejection shows inline. |
title | string | No | – |
defaultSelected | string | No | A checkpoint to open on mount, to show what restoring it would do. |
look | Look | No | – |
Dependencies
npm packages
clsxframer-motionlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themebuttonStates
All of them are drawn by the component. None is left for you to design.
- Run so far
- Before restoring
- Restored, branched
- Nothing to undo
- Restore fails
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances