A git commit graph for coding agents. Branches are coloured lanes and merges join them, and every commit shows who made it: a person, or an agent with its model's logo. Preview how a pull request lands as a merge, a rebase or a squash, restore an agent's checkpoints, and watch its commits arrive live.
On this page
Examples
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- commits
Commit[]- { id, message, branch, parents?, author: { name, kind?, model?, avatar? }, at, sha?, files?, additions?, deletions?, ci?, checkpoint?, agentId?, spanId? }, in any order. About 5 to 20 reads best.
- base / head
string- Default
"main" / first other branch - The branch the PR goes into, and the PR's branch.
- title / number
ReactNode- Header, e.g. the PR title and #217. A string title is also the squash commit's message.
- strategy / defaultStrategy / onStrategyChange
"open"|"merge"|"rebase"|"squash"- Default
"open" - Which result to show. Open is the history as it is; the others show the base after the PR lands.
- strategies
boolean- Default
true - Show the Open / Merge / Rebase / Squash control.
- mergedBy
CommitAuthor- Default
{ name: "You" } - Author of the merge commit, and of the squash commit when the branch had several authors.
- autoplay / speed / paused
boolean / number / boolean- Default
false / 1 / false - Cycle the strategies while nobody interacts; stops on the first click, key or focus, and pauses offscreen. Speed scales the timing.
- onSelect
(commit, agentId?) => void- Click or Enter on a commit. agentId links an agent's commit to its run.
- onRestore / restoreLabel
(commit) => void / string- Default
- / "Restore" - Shows Restore on checkpoint commits.
- now
() => number- Default
Date.now - Clock for relative times.
| Prop | Type | Default | Description |
|---|---|---|---|
| commits | Commit[] | - | { id, message, branch, parents?, author: { name, kind?, model?, avatar? }, at, sha?, files?, additions?, deletions?, ci?, checkpoint?, agentId?, spanId? }, in any order. About 5 to 20 reads best. |
| base / head | string | "main" / first other branch | The branch the PR goes into, and the PR's branch. |
| title / number | ReactNode | - | Header, e.g. the PR title and #217. A string title is also the squash commit's message. |
| strategy / defaultStrategy / onStrategyChange | "open" | "merge" | "rebase" | "squash" | "open" | Which result to show. Open is the history as it is; the others show the base after the PR lands. |
| strategies | boolean | true | Show the Open / Merge / Rebase / Squash control. |
| mergedBy | CommitAuthor | { name: "You" } | Author of the merge commit, and of the squash commit when the branch had several authors. |
| autoplay / speed / paused | boolean / number / boolean | false / 1 / false | Cycle the strategies while nobody interacts; stops on the first click, key or focus, and pauses offscreen. Speed scales the timing. |
| onSelect | (commit, agentId?) => void | - | Click or Enter on a commit. agentId links an agent's commit to its run. |
| onRestore / restoreLabel | (commit) => void / string | - / "Restore" | Shows Restore on checkpoint commits. |
| now | () => number | Date.now | Clock for relative times. |
Agent work with checkpoints
Live commits from a run
Accessibility
- Commits are a list of buttons with one tab stop. Arrow keys, Home and End move between them, and Enter selects.
- Each commit's name carries the message, author (agent and model, or person), time, branch, hash, size and checks.
- A text summary describes the history. The line under the graph says what the chosen strategy does, and it is announced when it changes.
- The strategy control is a SegmentedControl (a radio group). Restore is a separate button after a checkpoint.
- With reduced motion, strategies switch instantly and autoplay is off.
When to use
When to use
- Showing the git history behind an agent's work: who committed what, agent or person, on which branch.
- Previewing how a pull request lands as a merge, a rebase or a squash before you pick one.
- Letting people roll an agent back to a checkpoint commit.
When not to use
- Which agent called which, live: use Agent Graph.
- Reviewing the code change itself: use Inline Diff.
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 Branch Graph to my app and wire it to my own data.
- I need showing the git history behind an agent's work: who committed what, agent or person, on which branch. Set that up with the Knowns UI Branch Graph.
- Which Branch Graph props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "branch-graph" }) and search_docs({ query: "branch graph" }). Pro props, full examples and source come back once your license key is in the MCP config.