Summary
The transcript parser at internal/claude/transcripts.go:262 only recognizes subagent dispatches when the tool_use block's name is "Task". In real Claude Desktop / current Claude Code transcripts, subagents are dispatched via the "Agent" tool with an identical input shape (subagent_type, description, prompt, run_in_background). As a result, get_agent_performance, the metrics "Agent Performance" section, and the "Consider using task agents" suggestion all under-report by ~100%.
Evidence
Across the tool_use blocks in my local ~/.claude/projects/ transcripts (30 sampled session files):
tool_use name |
count |
| Bash |
2667 |
| Read |
650 |
| Edit |
544 |
| TodoWrite |
517 |
| Write |
383 |
| Agent |
279 |
| Task |
0 |
Full repo (125 sessions):
input.subagent_type value |
count |
general-purpose |
769 |
Explore |
44 |
claude-code-guide |
3 |
| Total subagent dispatches |
816 |
claudewatch metrics --days 30 for the same data prints:
Agent Performance
──────────────────────────────────────────────────────────────────
No agent tasks found in session transcripts
claudewatch suggest prints:
#1 [MEDIUM] Consider using task agents
Impact: 62.5 | Category: adoption
Agent usage is low (0% of 125 sessions).
…both incorrect — the user dispatched 816 subagents in those sessions.
Sample JSON shape
The Agent tool's input is structurally identical to what the existing taskInput struct already deserializes:
{
"type": "tool_use",
"id": "tu_…",
"name": "Agent",
"input": {
"description": "…",
"subagent_type": "general-purpose",
"prompt": "…"
}
}
Proposed fix
One line in internal/claude/transcripts.go:
-case block.Type == "tool_use" && block.Name == "Task":
+case block.Type == "tool_use" && (block.Name == "Task" || block.Name == "Agent"):
The downstream taskInput unmarshal + pending[block.ID] flow already handles the rest correctly — SubagentType, Description, Prompt, RunInBackground are all populated identically by the Agent tool.
Tests: the existing transcripts_test.go cases can be parameterized over name="Task" / name="Agent" to cover both, or a new fixture added.
Why this matters
Beyond fixing the headline metric, this gap hides subagent-derived stalls from the rest of the analysis surface:
correlate friction --factor uses_task_agent returns the wrong correlation
- per-subagent-type success rates can't be computed (e.g.
Explore vs general-purpose)
suggest keeps recommending "use task agents" to users already using them, which erodes signal trust
Happy to send a PR if useful.
Summary
The transcript parser at
internal/claude/transcripts.go:262only recognizes subagent dispatches when thetool_useblock'snameis"Task". In real Claude Desktop / current Claude Code transcripts, subagents are dispatched via the"Agent"tool with an identicalinputshape (subagent_type,description,prompt,run_in_background). As a result,get_agent_performance, the metrics "Agent Performance" section, and the "Consider using task agents" suggestion all under-report by ~100%.Evidence
Across the
tool_useblocks in my local~/.claude/projects/transcripts (30 sampled session files):nameFull repo (125 sessions):
input.subagent_typevaluegeneral-purposeExploreclaude-code-guideclaudewatch metrics --days 30for the same data prints:claudewatch suggestprints:…both incorrect — the user dispatched 816 subagents in those sessions.
Sample JSON shape
The
Agenttool'sinputis structurally identical to what the existingtaskInputstruct already deserializes:{ "type": "tool_use", "id": "tu_…", "name": "Agent", "input": { "description": "…", "subagent_type": "general-purpose", "prompt": "…" } }Proposed fix
One line in
internal/claude/transcripts.go:The downstream
taskInputunmarshal +pending[block.ID]flow already handles the rest correctly —SubagentType,Description,Prompt,RunInBackgroundare all populated identically by theAgenttool.Tests: the existing
transcripts_test.gocases can be parameterized overname="Task"/name="Agent"to cover both, or a new fixture added.Why this matters
Beyond fixing the headline metric, this gap hides subagent-derived stalls from the rest of the analysis surface:
correlate friction --factor uses_task_agentreturns the wrong correlationExplorevsgeneral-purpose)suggestkeeps recommending "use task agents" to users already using them, which erodes signal trustHappy to send a PR if useful.