Expose /context per-category breakdown to status line scripts
Problem
The /context slash command shows a useful breakdown of context-window usage by category — System prompt, System tools, MCP tools, Memory files, Skills, Messages, Free space. This data is computed internally and rendered in the TUI only.
Status line scripts receive a JSON payload on stdin with context_window.current_usage.{input,cache_creation,cache_read,output}_tokens — aggregate counts only. There's no way to surface the per-category breakdown in a custom status line, even though Claude Code already computes it.
Request
Add the /context per-category breakdown to the status line JSON payload, e.g.:
"context_window": {
...
"category_breakdown": {
"system_prompt": 4100,
"system_tools": 12700,
"mcp_tools": 1900,
"memory_files": 10500,
"skills": 1200,
"messages": 9400,
"free_space": 962200
}
}
Why
Power users who pay attention to context economy want this visible at all times, not on-demand via /context. Today the only signal in the status line is total tokens and the cost-tiered input/cache/output split, which doesn't tell you what is consuming the window.
Alternative
A claude context --json CLI subcommand would also work — status line scripts could shell out to it.
Version
Claude Code 2.1.138
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗