[Feature Request] Include actual context window usage in statusline JSON
Open 💬 4 comments Opened Dec 15, 2025 by GwonDooHyeon
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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗