Add raw token count fields to statusline input JSON
Feature Request
Description
Add raw token usage fields (e.g. usage.input_tokens, usage.output_tokens, usage.total_tokens) to the JSON that Claude Code pipes to the custom statusline script on stdin.
Motivation
Currently the statusline input JSON only provides cost.total_cost_usd, which shows dollar spend but not raw token counts. Users who want to monitor token consumption directly — for budgeting, tracking context usage trends, or building custom statusline indicators — have no way to access this data.
Proposed fields
{
"usage": {
"input_tokens": 12345,
"output_tokens": 6789,
"total_tokens": 19134,
"cache_read_tokens": 8000,
"cache_write_tokens": 2000
}
}
Use case
Display raw token counts in a custom statusline, e.g.:
◈ Opus 4.7 | [■■■■■■■□□□□□□□□□□□□□] 35% | 19.1k tokens | ↯ high | ⎇ main
This would allow users to track their actual token consumption alongside (or instead of) the dollar-cost display.
Current workaround
None — the data is not exposed to the statusline script at all.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗