Dashboards·terminal · desktop·MIT
agent-tree
Live tree of the main session and its subagents: model, tokens, tools and cost.

agent-tree opens an Agents pane beside the chat with a live tree of the main session, the orchestrator, and every subagent it spawns. Each node shows the model and effort, tokens, tool calls, duration, an estimated cost and the first line of the answer. It costs no tokens: the hooks only watch the engine’s events, and the interface draws the pane. The same tree is also served as a local web page.
What it does
- The pane. The top line gives the model and effort of the main session’s last request and its total tokens, with the cached part in parentheses. Below it, one node per subagent:
[running],[ok],[error]or[aborted], the subagent type, model, effort, task description, tokens, tool calls, duration and up to 200 characters of the answer’s first line. A footer adds up the subagents’ tokens and cost. Lines never wrap: under 70 columns each detail takes its own line, and anything wider than the pane is cut. - The web page. The same tree in a browser, one row per level, with a wire from each agent to the subagents it spawned and dots running down the wire of an agent that is still working. The pane lists subagents flat; only the page nests a subagent’s own subagents under it. Click a card for its last 50 tool calls and up to 4,000 characters of its answer. A card flashes green, red or yellow when its agent finishes, fails or is aborted.
- An Edge window on Windows: the page opened through Edge’s app mode, with no tabs and no address bar.
- Estimated cost. Each request’s uncached input, cache writes, cache reads and output, priced at Anthropic’s list prices from a table in
src/pricing.ts, with cache writes at the 5-minute rate. A plan that is not billed per token does not pay this amount. A model missing from the table, such as an older 4.x, shows no cost, and a+after a total means a request on such a model is left out of it. - A rating once a subagent ends with its answer and its whole cost is known:
perfectup to $0.03,okup to $0.15,fairup to $0.60,poorup to $2.00,awfulabove. It grades what the run spent, not how well it worked. The thresholds are theCEILINGSlist insrc/pricing.ts, which you can edit. The main session shows its cost but gets no rating. - Context fill. The last request’s prompt against the window the mod assumes for the model: 1M tokens for current models, 200K for Haiku 4.5. A session on a smaller window is fuller than the percentage says.
- Notifications. A toast with cost and rating when a subagent finishes. A failed one also raises a system notification; an aborted one, usually your own Esc, only gets the toast.
If you would rather open each subagent’s whole conversation from the pane, agentpane does that.
Install
Needs Claude Code 2.1.287 or later. The web page also needs Node.js on the PATH, and the window view needs Microsoft Edge, so it is offered on Windows only.
There is no marketplace. Clone the repository and load the folder:
git clone https://github.com/pedrowillen/claude-agent-tree.git
claude --plugin-dir ./claude-agent-tree
--plugin-dir loads it for one terminal session. To load it in every session, the Code tab of Claude Desktop included, the author points the CLAUDE_CODE_PLUGIN_DIRS user environment variable at the clone, then quits and reopens the desktop app. On Windows, with your own path:
[Environment]::SetEnvironmentVariable('CLAUDE_CODE_PLUGIN_DIRS', 'C:\projects\claude-agent-tree', 'User')
On macOS and Linux, export the variable in your shell profile and make sure the desktop app inherits it.
At the start of each session a question asks how to see the agents: the Agents pane, the web page, the Edge window, or any mix. Dismissing it opens the pane. Run /agent-tree to choose again. With the web page picked, its address appears as a toast and in the status line; the pane’s last line shows it too.
How it works
The hooks module watches session.start, turn.start, agent.spawn, turn.step, tool.call and turn.complete, keeps the tree in the session state and redraws the pane when it changes. Every hook passes its event on unchanged: the mod never blocks, delays or alters what Claude does, and adds nothing to the prompt. Model and effort come from each request as it starts; tokens and cost come from the usage that closes it.
For each subagent tool call it keeps a one-line label: the tool plus the first path, command, pattern, URL, query, description or prompt it was given, cut to 80 characters. It keeps the last 50 per agent, and each subagent’s answer up to 4,000 characters. The main session’s tool calls are not recorded.
At session start the mod launches a small Node server (node -, its source passed on stdin) that lives as long as the session, one per session. It listens on 127.0.0.1 only, on port 47821 or the next free one up to 47830, and refuses requests whose Host header is not 127.0.0.1 or localhost. It serves the page and its icon, takes the tree from the mod on POST /state and streams it to open pages on GET /events (server-sent events). Both data endpoints need a random key the server makes each time it starts, carried as ?t= in the link the mod shows. Without it they answer 403, so another program on the machine or a website cannot read the tree, which holds tool commands and answers, or replace it. The mod sends the tree at most about ten times a second. Nothing leaves your machine.
It runs two other processes: cmd /c ver at session start, to tell whether it is on Windows, and cmd /c start msedge --app=<address> for the Edge window. If Node is missing, the pane’s last line reads Web: node not found; if all ten ports are taken, it says that instead. The pane works the same either way.
Limitations
- The cost is an estimate. Prices change, and the table in the code dates from 6 October 2026.
- The pane shows at most 20 subagents. When a new prompt spawns its first subagent, the finished ones from the previous prompt are cleared; running ones stay.
- The question comes back at the start of every session.
Similar Claude Mods
claude-carbon
Estimated grams of CO2 for each answer and session, with a molecule and warming stripes.
savvy-progress
Running, finished and planned subagents with model, context, cost and time, in one panel.
mission-control
Main agent, subagents and every tool call in a pane, plus a map of the files they touch.
token-weather-usage
Context, 5-hour and 7-day limits, cache countdown and cost on one line above the prompt.
Popular Claude Mods
The whole directory →effortless
Picks the effort for every prompt and shows how long the prompt cache stays warm.
Context Attachment Manager
Pick which past images go out with your next message; the rest become placeholders.
context-bar
Your context window as one stacked bar above the prompt, a color per category.
intermission
Multiplayer Doom deathmatch in a pane while Claude works, handed back when it needs you.







