Skip to content

Agent Handoff

The run as a relay: which agent handed what to whom, the context that went along and what got lost on the way. Each new hand-off sends a light down the rail; drag a card forward to give it to someone later.

On this page
Used for
  • Show who passed what
  • Reassign a hand-off
  • Spot lost context
  • Follow a relay of agents
  • Review a pipeline

Examples

Installation

npx knowns-ui@latest add agent-handoff
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

A card per agent in relay order (model, spend, status and what it's on right now), and between each pair a lane with the handoffs that went from one to the next. Each handoff lists the context passed along; lost items are struck through, and opening the list shows why, with “Add back”. The status line says whether the next agent is on it, it looks good, or it needs a look.

Connectors draw in from each agent into its lanes; a new handoff sends a light down the sender's line and rises in at the top of the lane. Hover or focus an agent to brighten its lines. Reassign by dragging a card onto a later agent, or with the keyboard: Space picks it up, ← → choose the agent, Space hands it over, Escape cancels. Below 760px the relay stacks, each lane under its sender, without connectors.

Props

run
AgentRun
Agents (with description, model, spend), tasks and tool calls; ended tasks with handoffTo become handoffs.
actors / tasks / approvals / spans
arrays
Default[]
Plain data instead of a run.
handoffs
Handoff[]
Defaultfrom tasks
{ id, from, to, title, summary?, at, items, task? } - richer data; you then own reassigning and restoring.
items
(task) => HandoffItem[] | undefined
Defaulttask.handoffItems
Context passed with a handoff, { id, label, kind?: file | note | data | link, lost?: { reason } }.
order
string[]
Defaultfirst appearance
Relay order of agent ids; the rest follow.
verb
(agent, task) => string | undefined
Default"Working"
Short word next to an agent's current task, e.g. “Drafting”.
onAssign
(handoff, agent) => void
A handoff was moved onto a later agent (forward only).
onRestore
(handoff, item) => void
Defaultemit task.item.restore
“Add back” on a lost item. With a run the event is emitted for you; this is called as well.
onOpen
(handoff) => void
Enter on a handoff card.
laneHeight
number
Default300
Max height of a lane before it scrolls; the bottom fades while there's more.
title
ReactNode | false
Defaultfalse
Optional header with a handoff count.

What it handles

  1. 01Puts agents in relay order, from the order prop first and then by first appearance, with a lane for each.
  2. 02Builds a handoff card from each ended task that has handoffTo, or from your own handoffs prop, listing the context items it carried.
  3. 03Marks an item as lost with a tooltip giving the reason, and an Add back action that calls onRestore and emits task.item.restore on a run.
  4. 04Draws a connector between the giving and receiving agent and runs a light along it once when a new hand-off arrives.
  5. 05Reassigns a handoff forward only: drag it onto a later agent, or press Space, Left or Right and Space again, with Escape to cancel and a spoken hint.
  6. 06Shows each receiving agent's status as todo, working, done or warning, with a spinner and your verb, Working by default, next to its current task.

States

First render
Nothing. Lanes and cards paint as they are
none
New hand-off
The card rises into its lane
280ms, ease out
Lost items open
The list rises under the card
180ms, ease out
Card hover or drag
Shadow and scale change
180ms, ease out
Connector highlights
The line thickens
280ms, ease in-out
Row hover
Text and background colour change
120ms, ease out
Reduced motion
New cards and lists appear at once
0ms

Works with

When to use

When to use

  • Pipelines where work passes from agent to agent and you need to show what context went along and what was lost.
  • Letting a person reassign the next step by drag or keyboard.

When not to use

  • Agents working in parallel rather than in sequence: use Agent Lanes.
  • A generic multi-step form or wizard: use Stepper.

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 Handoff to my app and wire it to my own data.
  • I need pipelines where work passes from agent to agent and you need to show what context went along and what was lost. Set that up with the Knowns UI Agent Handoff.
  • Which Agent Handoff props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-handoff" }) and search_docs({ query: "agent handoff" }).

Need help?

Stuck on Agent Handoff, or found something off? We read every message.