[BUG] Context Usage Hints Are Inaccurate When Using Sonnet w/ 1M Context
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?
I am using Claude Code with Sonnet 4.5 1M context window, but CC warning me to compact or switch to Sonnet 1M even though I'm already using it and should be nowhere near 100% context usage.
In the screenshot below you can see I got the hint 7% context left · try /model sonnet[1m], and the status line is warning me Context low (7% remaining) · Run /compact to compact & continue, but the status line also (accurately) shows that I'm using Sonnet 4.5 with 1M context window because I have "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5-20250929[1m]" set in my settings.json. The hint message is instructing me to switch to the 1M context variant of Sonnet 4.5, but you can see that's what I'm already using.
I then ran the /context slash command which accurately shows my current session's usage based on 1M context window, which contradicts the hint and status line messages that claim I only have 7% context remaining
<img width="1107" height="518" alt="Image" src="https://github.com/user-attachments/assets/30d8768a-3b2a-4cbe-a0f5-9c5ed709853a" />
It seems like when I use "normal" Sonnet 4.5 (200K context window) the hints and status line are accurate, it's just with Sonnet 4.5 1M context window that the calculations are wrong
What Should Happen?
The hints and status line warnings that instruct me to compact or use Sonnet 1M context should only be generated when the session's context usage is actually approaching 100% as displayed by /context
Error Messages/Logs
Steps to Reproduce
This can be reproduced by using Sonnet 4.5 (with 1M token context) for a long-running session, and once the context usage gets to 200K+ tokens the hints and status line will start warning you to compact even though you're only using <25% of the 1M context window
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.2
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗