Statusline token counts should include subagent/tool-agent token usage
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
The statusline JSON data exposes context_window.total_input_tokens and context_window.total_output_tokens, but these only reflect the main conversation's token usage. When
Claude Code spawns subagents (Explore, Plan, general-purpose, etc.), their token consumption is not included in these totals.
This makes the token count in custom statuslines misleading — the displayed total can be significantly lower than actual usage.
Proposed Solution
Example
In a session where two Explore agents were running:
Running 2 Explore agents…
├─ Search for TDS scripts · 32 tool uses · 127.3k tokens
└─ Search for TDS helper scripts · 22 tool uses · 118.9k tokens
The statusline showed 35.3k tok — only the main conversation tokens — while the agents alone consumed ~246k tokens. The actual session total should have been ~281k tokens.
Meanwhile, cost.total_cost_usd ($6.34) appeared to correctly include agent costs, suggesting the billing side already aggregates across agents.
Expected behavior
context_window.total_input_tokens and context_window.total_output_tokens (or a new field like total_session_tokens) should include tokens consumed by all subagents, matching
how cost.total_cost_usd already works.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗