Debugging Claude Code subagents and teams
Each subagent renders as its own execution tree with tool traces, tokens, duration, and cost. Nested agents render recursively. Teammate messages are color-coded by sender.
Claude Code now spawns subagents via the Task tool and coordinates teams with TeamCreate, SendMessage, and TaskUpdate. In the terminal, all of this collapses into an unreadable stream.
claude-devtools renders each subagent as an isolated execution tree with its own tool traces, token metrics, duration, and cost. Nested agents (agents spawning agents) render as recursive trees. Teammate messages are color-coded by sender.
You can see the full team lifecycle: initialization, task coordination, direct messages and broadcasts, shutdown requests, and teardown.
When debugging a misbehaving subagent the question is usually one of three:
- Did it get the right prompt? Expand the Task call to see the exact instructions the agent received.
- What tools did it actually run? The execution tree shows every tool call the subagent made, in order, with full inputs and outputs.
- How much did it cost / consume? Each subagent card shows token totals, duration, and cost — useful for finding agents that loop or read more than they should.
Related
Understanding Claude Code context window compaction
Claude Code silently compresses your conversation when context fills. claude-devtools shows the boundary, the token delta, and what was discarded — so you can see exactly what Claude no longer remembers.
Setting up notification triggers
System notifications for .env access, tool errors, and high token usage. Plus custom regex triggers on any field with per-repo scoping — no Claude Code hooks required.