[BUG] he /context command displays incorrect and inconsistent information about context window usage:
Resolved 💬 2 comments Opened Mar 12, 2026 by roshan-rubrik Closed Apr 9, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The /context command displays incorrect and inconsistent information about context window usage:
- Mismatch with actual usage: Sometimes shows 0k/200k when the visual indicator clearly shows ~50% tokens consumed
- Random percentages: The percentage shown varies unpredictably and doesn't correlate with actual context consumption
- Breakdown doesn't add up: The sum of individual context components (system prompt, conversation, tool results, etc.) doesn't match the reported total
Expected behavior
- The total usage shown should match the visual progress indicator
- Individual component sizes should sum to the reported total
- Values should accurately reflect actual token consumption in the context window
Environment
- OS: macOS (Darwin 25.3.0)
- Claude Code version: 2.1.74
- Model: Claude Opus 4.6
What Should Happen?
I'm expecting correct number to be showin in /context command. 😿
Error Messages/Logs
No error message
Steps to Reproduce
Steps to reproduce
- Start a Claude Code session and work through several tool calls
- Run /context
- Compare the reported numbers with the visual context indicator
- Note the discrepancy between component breakdown and total
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.74
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
This is flaky, sometime it works, sometime it doesn't
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗