Loading component…
Loading component…
An agent's run as a line of checkpoints, like git for agents – rewind to any of them and a new attempt branches out of it, while the one it left fades back but stays
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentCheckpoints from ./agent-checkpoints.
import { AgentCheckpoints, type Checkpoint } from "@/components/ui/agent-checkpoints";
const checkpoints: Checkpoint[] = [
{ id: "c1", title: "Read the brief", at: 9_000 },
{ id: "c2", parent: "c1", title: "Built the pricing table", files: 3, at: 64_000 },
{ id: "c3", parent: "c2", title: "Tests failing – 4 of 12", status: "failed", at: 131_000 },
// A second checkpoint after c2 starts a new attempt
{ id: "c4", parent: "c2", title: "Switched to Stripe Elements", status: "running", at: 169_000 },
];
export function Run() {
return <AgentCheckpoints checkpoints={checkpoints} head="c4" onRewind={(c) => agent.restoreFrom(c.id)} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| checkpoints | Checkpoint[] | { id, title, icon?, parent?, status?, at?, files?, cost? } in the order they were taken – pass them again whenever one is added or changes; icon is a small mark before the title, e.g. the logo of the tool it worked with | |
| parent | string | Per checkpoint, the one it follows – a checkpoint whose parent already has a later one starts a new attempt on its own lane | |
| status | "running" \| "done" \| "failed" \| "stopped" | "done" | Per checkpoint – running shimmers, failed gets a badge, stopped means you rewound away while the agent worked toward it |
| head | string | the last checkpoint | Id of the checkpoint the agent stands on – the way to it is blue, everything off it fades back |
| onRewind | (checkpoint: Checkpoint) => void | Rewind was pressed – add a new checkpoint with this one as its parent, and move head to it | |
| task | string | What the run is for, next to the title | |
| formatTime | (ms: number) => string | 0:42 / 1:05 | Formats at |
| formatCost | (amount: number) => string | dollars, e.g. "$0.42" | Formats the total in the bar on top |
| title | string | "Checkpoints" | Heading of the bar |
| className | string | Extra class on the root |
Every row has a fixed height, so nothing jumps when a checkpoint finishes or fails – Rewind takes the place of files and time
Past fourteen checkpoints the list scrolls inside the card and keeps the current one in view
Narrow, the task and the file counts give way first
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"