[FEATURE] Expose full context usage in statusline API
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 API currently only exposes conversation tokens (total_input_tokens + total_output_tokens), not the full context window usage including system overhead.
The context_window object passed to statusline scripts contains:
{
"total_input_tokens": 4589,
"total_output_tokens": 7738,
"context_window_size": 200000
}
This shows ~6% usage (12k/200k tokens).
Proposed Solution
Expected Behavior
The /context command shows the true breakdown:
- System prompt: 3.2k tokens
- System tools: 32.4k tokens
- MCP tools: 37.4k tokens
- Custom agents: 10.9k tokens
- Memory files: 3.0k tokens
- Messages: 1.2k tokens
- Total: 133k/200k (67%)
Feature Request
Please expose the full context usage in the statusline API, e.g.:
{
"total_input_tokens": 4589,
"total_output_tokens": 7738,
"context_window_size": 200000,
"total_used_tokens": 133000 // <-- new field
}
Use Case
I want to display a context usage progress bar in my statusline that accurately reflects how much context remains before needing to compact. Currently it shows ~6% when actual usage is ~67%, making it misleading.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗