Skip to content
Back

Crew tree

A lead and its sub-agents as one live tree of cards – what each does now, how full its context is, its tools and the last thing it was handed; handoffs run as a light along the connectors, a click opens the details with steering, and a switcher swaps projects.

oxyn add crew-tree
MCP
3 working8 agents
Dioxus
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Rendered from Rust at build time · goes live when visible

When to use

  • A lead and its sub-agents as one live tree of cards: every agent stays on screen, each card says what it does right now, how full its context is, its tools and the last thing it was handed.
  • Handoffs run as a light along the rounded connectors and light up the card they reach; a click opens the agent's details with steering; a switcher swaps projects.

When not to use

  • An agent asks before it acts: use Approval Card instead.
  • Several open requests in one card: use Approval pager instead.
  • An agent's question in its own card above the composer: use Decision Card instead.

Installation

Crew tree is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add crew-tree
Rust
use crate::oxyn::{CrewTree, STATUS_INDICATOR_CSS};

Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{CrewTree, STATUS_INDICATOR_CSS};

Usage

Dioxus · rust
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Examples

Default

A lead and three sub-agents with their helpers; handoffs run along the connectors and light up the card they reach, contexts fill, and the lead ends up asking you to merge.

3 working8 agents
Code
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Working details

The lead's details while it works: task, model, usage, tools, last handoff and Message / Pause / Stop.

3 working8 agents
LeadClaude OpusWorking
Delegating
44k / 200k
Code
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Needs you

The run settled with the lead waiting: "1 needs you" in the header and Message / Decline / Approve in its details.

1 working1 needs you8 agents
LeadClaude OpusNeeds you
Ship PR #317?
66k / 200k
↳ReviewerLooks good – ready to ship
Reviewer handed to Lead: Looks good – ready to ship
Code
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Launch

Another project from the switcher: the launch post crew (Editor, Researcher, Writer with its Fact checker, SEO).

2 working5 agents
Code
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Narrow

Narrow: every level indented, the cards as wide as there is room.

1 working1 needs you8 agents
Reviewer handed to Lead: Looks good – ready to ship
Code
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

Classic

Classic style: elevated cards, a grey footer band and filled badges.

1 working1 needs you8 agents
Reviewer handed to Lead: Looks good – ready to ship
Code
rsx! {
    CrewTree {
        root: Some(crew()),
        handoffs: handoffs(),
        projects: projects(),
        now: clock.now(),
        on_steer: move |(agent, action, message)| steer(agent, action, message),
        on_project: move |id| switch_to(id),
    }
}

API reference

CrewTree

PropTypeDefaultDescription
rootOption<CrewCard>Default::default()The lead and its tree (the demo project's crew when `None`).
handoffsVec<CrewHandoff>Default::default()Handoffs; new ids run a light (the demo's when `root` is `None`).
titleStringDefault::default()Header title when there are no projects.
projectsVec<CrewProject>Default::default()Projects for the switcher (the demo's three when `root` is `None` and this is empty).
projectString"checkout"The project at the start.
atOption<u64>Default::default()Freeze the demo at this many ms into a pass (a settled state).
openStringDefault::default()The card whose details are open at the start (agent id).
nowrequiredClockMs—The clock.
styleStringDefault::default()`clean`, `classic`, or empty to follow `data-cstyle`.
on_steerEventHandler<(String, String, String)>—A steering action: (agent id, action, message).
on_selectEventHandler<String>—A card was opened (agent id).
on_projectEventHandler<String>—Another project was chosen (its id).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabInto the crew – one stop for all cards – then the project switcher
← → ↑ ↓Walk the cards
HomeorEndThe lead, the last card
EnterorSpaceOpen or close the card's details
EscClose the message field, then the details – focus goes back to the card
↑ ↓ EnterIn the project switcher: pick a project; Esc closes it

Accessibility

  • A tree; every card is named with its status, activity and context – "Coder: Working, Editing basket.ts, context 38%" – and says it opens a dialog.
  • The details are a dialog named after the agent; close, steering buttons and the message field are reachable by Tab.
  • The project switcher is a button with a listbox; the current project is marked as selected.
  • A polite live region reads each handoff and each steering action – "Lead handed to Coder: Handle empty baskets", "Paused Coder".

Responsive behaviour

  • Wide (760 px): sub-agents side by side under the lead; narrower: every level indented.
  • Rows are fixed, so a changing activity or context never moves a card or a connector.
  • Long names, activities and tasks end in … with the full text on hover.
Edge cases (spec)

Wide at 760 px; below that every level is indented and cards take the remaining width. Rows are fixed, so changing activity or context never moves a card. Below 420 px the "N agents" count drops. Long names, activities and tasks end in an ellipsis with the full text on hover. Context values outside 0–1 or NaN are clamped; a NaN cost is left out.

Notes for AI

  • Import CrewTree from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: CrewTreeEl in oxyn_gpui.
  • Props to set first: now.
  • It reads a clock (now) for live timers; pass one clock for the whole page rather than one per component.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI