[BUG] bug in context handling from Claude (context limits warning when /context shows > 80% free
Environment
- Platform (select one):
- [ x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: <!-- -->
- Operating System: <!-- e.g. macOS 15.6 -->
- Terminal: <!-- e.g. Terminal -->
Bug Description
<!-- If I call the /context command, I see I have plenty of context available (80%), but then I on the bottom right you can see context is at 0%. See image.
Basically whenever I /clear all the context, it get immediately reset to 130k+ tokens with a simple "hello Claude". The issue is real and not only visual, as then I get a 400 because of context exceeded. The image explains the bug very well. -->
<img width="3002" height="614" alt="Image" src="https://github.com/user-attachments/assets/5e484a08-362a-49e7-918c-a5c645a3ff36" />
Steps to Reproduce
- <!-- /context -->
- <!-- Compare it with the number of tokens -->
- <!-- See discrapancy -->
Expected Behavior
<!-- If would expect /context to be a reflection of the context left, and I wouldn't expect the context to be problematic after a couple of prompts -->
Actual Behavior
<!-- After /clean, number of token skyrocket to 130000k with the first command and right corner context gets to <10% superfast, while /context is not coherent-->
Additional Context
<!-- By looking at the image you should be able to understand the issue -->
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗