[Feature Request] Include actual context window usage in statusline JSON
Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Dec 15, 2025 · closed Aug 17, 2026
Problem
The context_window field in statusline JSON does not reflect the actual context window usage shown by /context command.
Current behavior
Statusline JSON provides:
"context_window": {
"total_input_tokens": 4042,
"total_output_tokens": 9412,
"context_window_size": 200000
}
Total: ~13K tokens
Expected behavior
/context command shows actual usage: 172K/200K (86%)
Breakdown:
- System prompt: 3.3K
- System tools: 15.7K
- MCP tools: 18.2K
- Memory files: 0.4K
- Messages: 89.5K
- Autocompact buffer: 45K
Request
Please include the actual context window occupancy in the statusline JSON, similar to what /context displays. This would allow custom statusline scripts to show accurate context usage.
Suggested addition:
"context_window": {
"used_tokens": 172000,
"context_window_size": 200000,
"percent_used": 86
}
Environment
- Claude Code version: 2.0.69
- Model: claude-opus-4-5-20251101
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
still happening
still happening
Would also like to see this added.