Every call of a run on one time axis: nested by who called whom, live bars, the input, output or error inline, filters and search, brush to zoom, and the critical path that set the total time.
Used for
- Find the slow call
- Read a run's timeline
- Debug a failed span
- Compare agent calls
- Audit tool latency
Examples
Installation
npx knowns-ui@latest add trace-waterfallFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Trace waterfall from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/trace-waterfall
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add trace-waterfall
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/icons/actor-icon.tsx
- lib/knowns/icons/model-icons.tsx
- lib/knowns/icons/tool-icons.tsx
- lib/knowns/icons/model-icons.data.ts
- lib/knowns/icons/tool-icons.data.ts
- lib/knowns/icons/LICENSES.md
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/code-block/code-block.tsx
- components/ui/knowns/code-block/code-block-utils.ts
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- components/ui/knowns/textarea.tsx
- components/ui/knowns/chat-composer/use-autosize.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/input.tsx
- components/ui/knowns/segmented-control.tsx
- components/ui/knowns/trace-waterfall/trace-waterfall.tsx
- components/ui/knowns/trace-waterfall/waterfall-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/trace-waterfall, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "trace-waterfall" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- run
AgentRun- Read spans and actors live (useAgentSnapshot). Takes precedence over spans / actors.
- spans / actors
Span[] / Actor[]- Default
[] - Plain data. Rows nest by caller: a call made by X sits under the call into X that was open when it started (lead → subagent → its tools).
- title
ReactNode- Default
"Trace" - Heading; names the region. Calls, failures and total time sit next to it.
- defaultFilter
"all"|"errors"|"slow"- Default
"all" - Errors and Slow (> p90 of finished calls) keep each match's ancestors, dimmed, so the tree still reads. Search matches summary, tool, caller and error.
- defaultCriticalPath
boolean- Default
false - Ring the chain that set the total time (the top call that ended last, then its child that ended last…); the rest dims.
- maxHeight
number- Default
460 - Body height before it scrolls.
- virtualizeAbove
number- Default
200 - Past this many visible rows only the rows in view are mounted; open rows are measured.
- now
number- Clock override for tests and stills. Running bars otherwise grow on a 500ms tick with a linear transition.
- toolbar
boolean- Default
true - The filter, search and critical-path controls. Set false for a small read-only view, such as a dashboard tile: the title and the count stay.
- axisHint
boolean- Default
true - The "Drag the axis to zoom" hint over the labels. Set false for a still or a video, where it reads as chrome; brushing still zooms.
- Mouse
-- Click a row: input / output / error inline. Chevron: collapse a subtree. Drag across the axis to zoom; double-click (or Reset zoom) to go back. A time cursor follows the pointer; bars show a tooltip.
- Keyboard
role=tree- ↑ ↓ Home End PageUp PageDown move, ← collapses (or goes to the parent), → expands (or goes to the first child), Enter / Space opens details. The axis takes Esc or 0 to reset zoom.
| Prop | Type | Default | Description |
|---|---|---|---|
| run | AgentRun | - | Read spans and actors live (useAgentSnapshot). Takes precedence over spans / actors. |
| spans / actors | Span[] / Actor[] | [] | Plain data. Rows nest by caller: a call made by X sits under the call into X that was open when it started (lead → subagent → its tools). |
| title | ReactNode | "Trace" | Heading; names the region. Calls, failures and total time sit next to it. |
| defaultFilter | "all" | "errors" | "slow" | "all" | Errors and Slow (> p90 of finished calls) keep each match's ancestors, dimmed, so the tree still reads. Search matches summary, tool, caller and error. |
| defaultCriticalPath | boolean | false | Ring the chain that set the total time (the top call that ended last, then its child that ended last…); the rest dims. |
| maxHeight | number | 460 | Body height before it scrolls. |
| virtualizeAbove | number | 200 | Past this many visible rows only the rows in view are mounted; open rows are measured. |
| now | number | - | Clock override for tests and stills. Running bars otherwise grow on a 500ms tick with a linear transition. |
| toolbar | boolean | true | The filter, search and critical-path controls. Set false for a small read-only view, such as a dashboard tile: the title and the count stay. |
| axisHint | boolean | true | The "Drag the axis to zoom" hint over the labels. Set false for a still or a video, where it reads as chrome; brushing still zooms. |
| Mouse | - | - | Click a row: input / output / error inline. Chevron: collapse a subtree. Drag across the axis to zoom; double-click (or Reset zoom) to go back. A time cursor follows the pointer; bars show a tooltip. |
| Keyboard | role=tree | - | ↑ ↓ Home End PageUp PageDown move, ← collapses (or goes to the parent), → expands (or goes to the first child), Enter / Space opens details. The axis takes Esc or 0 to reset zoom. |
What it handles
- 01Nests rows by caller, lead agent then subagent then its tools, and colours each bar by agent with failures in red.
- 02Grows running bars live from one clock, writing the view and now into CSS variables so React renders only when the data changes.
- 03Opens a row inline into its input, output or error as highlighted JSON.
- 04Filters to All, Errors or Slow, where slow means above the p90 duration, and searches calls by text.
- 05Zooms by brushing the axis, and Escape or 0 resets it, and without a brush it shows the full run.
- 06Moves by keyboard: Up and Down between rows, Enter or Space to open, Left and Right to collapse or expand a subtree, and it virtualises past virtualizeAbove rows.
States
- First render
- Nothing. Rows and bars paint as they are
- none
- Rows reorder or collapse
- Rows glide to their new place
- 280ms, ease in-out
- A new row arrives
- It settles in from slightly above
- 280ms, ease out
- Row opens
- The chevron turns and the detail shows
- 180ms, ease out
- Call finishes
- Its duration label fades in
- 180ms, ease out
- Running bar
- It grows with the clock on every frame
- none
- Reduced motion
- Rows jump and labels appear at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. Rows and bars paint as they are | none |
| Rows reorder or collapse | Rows glide to their new place | 280ms, ease in-out |
| A new row arrives | It settles in from slightly above | 280ms, ease out |
| Row opens | The chevron turns and the detail shows | 180ms, ease out |
| Call finishes | Its duration label fades in | 180ms, ease out |
| Running bar | It grows with the clock on every frame | none |
| Reduced motion | Rows jump and labels appear at once | 0ms |
Works with
When to use
When to use
- Debugging a run: every tool call on one time axis with its timing, nested by caller, with input, output and errors inline.
- Finding the critical path or the slow step in a long run, with filters, search and brush zoom.
- Large traces: rows are virtualised, so thousands of spans stay smooth.
When not to use
- End users who only need to know what the agent is doing right now: use Agent Monitor.
- Showing one call in detail on its own: use Tool Call Card.
- A high-level picture of who talks to whom: use Agent Graph.
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 Trace Waterfall to my app and wire it to my own data.
- I need debugging a run: every tool call on one time axis with its timing, nested by caller, with input, output and errors inline. Set that up with the Knowns UI Trace Waterfall.
- Which Trace Waterfall props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "trace-waterfall" }) and search_docs({ query: "trace waterfall" }).