[FEATURE] Roll up elapsed time and token spend to subtree totals in the Agent Panel
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When a session spawns agents that are themselves spawn-capable, and those agents go on to spawn their own children, the Agent Panel shows every agent as a flat row. There is nothing in the panel that says which agent spawned which.
I checked claude agents --help and the current settings/env var/CLI flag surface on v2.1.238 and found no toggle for a tree or nested view. I haven't been able to source a definitive statement that the runtime panel itself is flat by design (as opposed to just undocumented), so I'm not claiming that outright, only that nothing currently exposes parent/child structure in it.
Proposed Solution
Render spawned agents as an indented tree in the Agent Panel, with each row showing which agent spawned it. A child agent's row sits nested under its parent instead of appearing as a sibling at the top level.
Optional but useful: let a parent row collapse its subtree, showing a descendant count when collapsed. Roll up the existing per-row columns (elapsed time, token spend) to the subtree total when a parent is collapsed.
Use Case Example
Consider a lead session running a large multi-phase plan across several repositories, with ten or more named background agents spawned over the course of the session and several running at once. Some of those agents are themselves allowed to spawn sub-agents under a depth-limited fan-out policy.
With a flat list, there's no way to tell that one lane has fanned out three children while a sibling lane is a leaf doing its own work directly. If one descendant stalls, there's no way to trace it back to the lane that spawned it without cross-referencing timestamps and task descriptions by hand. The per-row elapsed-time and token columns already in the panel would become much more useful if they could be read as a subtree total instead of only a single row.
Alternative Solutions
_No response_
Priority
Medium - Would improve workflow
Feature Category
CLI commands and flags
Additional Context
Related but not a duplicate: #17425 asked for a similar tree view but was closed for inactivity and is now locked, so I can't comment there. #24537 is a much larger proposal for a whole new dashboard overlay (TUI + Desktop) that lists "the agent tree" as one of many components it would need; this request is narrower and scoped to the existing Agent Panel rather than a new surface.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗