[FEATURE] Expose context breakdown by source in status line JSON
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 status line JSON only provides aggregate token usage (used_percentage, total_input_tokens), with no breakdown by context source. The /context command already computes this breakdown internally (MCP servers, rules files, conversation history, system prompt, etc.), but it is not exposed to external status line scripts.
This makes it impossible to build a segmented context bar — e.g., color-coded blocks where each color represents a different source — which would give users an at-a-glance view of what is consuming their context window, not just how much.
Proposed Solution
Add a context_breakdown array to the context_window object in the status line JSON:
{
"context_window": {
"used_percentage": 44,
"context_breakdown": [
{ "source": "conversation_history", "tokens": 28000, "percentage": 62 },
{ "source": "mcp_servers", "tokens": 10000, "percentage": 22 },
{ "source": "rules_files", "tokens": 4500, "percentage": 10 },
{ "source": "system_prompt", "tokens": 2500, "percentage": 6 }
]
}
}
This is a backwards-compatible addition — no existing fields change.
Alternative Solutions
Parsing the transcript file (transcript_path) is available but only exposes raw token counts per message, not semantic source labels. The /context command is the only place this breakdown exists today, but it requires manual invocation.
Priority
Nice to have
Feature Category
Status line / Terminal UI
Use Case Example
A status line script renders a single-row segmented bar:
[████████░░░░░░░░░░░░] 44%
^^^^blue ^^^yellow ^green
conv mcp rules
Each color segment is proportional to that source's token share, making it easy to spot when MCP servers or rules files are consuming unexpected context budget.
Additional Context
The breakdown data already exists in the /context command implementation — this is purely a matter of surfacing it through the existing status line interface.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗