[BUG] Context low warning shows 7% when actually 36% free (auto-compact disabled)
Status Closed — not planned
Maintainer reply None cached
Activity 13 comments · opened Dec 21, 2025 · closed Feb 27, 2026
Description
When auto-compact is disabled via /config, the context warning message shows incorrect remaining percentage.
Steps to Reproduce
- Disable auto-compact in
/config - Use Claude Code until context reaches ~63%
- Run
/contextto see actual usage - Observe the warning message in the status bar
Expected Behavior
Warning should reflect actual free space (36.6% in this case).
Actual Behavior
/contextshows: 127k/200k (63% used) with 73k free (36.6%)- Status bar warning shows: "Context low (7% remaining)"
Screenshot of /context:
Context Usage
claude-opus-4-5-20251101 · 127k/200k tokens (63%)
⛁ System prompt: 6.9k tokens (3.5%)
⛁ System tools: 15.8k tokens (7.9%)
⛁ Custom agents: 438 tokens (0.2%)
⛁ Memory files: 9.4k tokens (4.7%)
⛁ Messages: 94.3k tokens (47.2%)
⛶ Free space: 73k (36.6%)
Status bar shows:
Context low (7% remaining) · Run /compact to compact & continue
Analysis
The math doesn't add up:
- 7% of 200k = 14k tokens
- Actual free space = 73k tokens (36.6%)
It seems like the warning system is still calculating as if auto-compact buffer (77k) is reserved, even though auto-compact is disabled.
Environment
- Claude Code version: 2.0.75
- Model: claude-opus-4-5-20251101
- OS: Linux (WSL2)
- Auto-compact: Disabled
Expected Fix
When auto-compact is disabled, the "Context low" warning should use actual free space percentage, not a calculation that assumes the auto-compact buffer is still reserved.
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Same issue as https://github.com/anthropics/claude-code/issues/11335
This is KILLING me, AND it's autocompacting despite the flags being set correctly. CC reports this is precisely this unfixed error, and is robbing me of 30% of my context eveyr darn session.
Bug persists on
2.1.6Bug seems worse with
2.1.7, now it says "Context limit reached" and doesn't allow more requests when the auto-compact limit is reached even though auto-compact is disabledYeah.. same here.. 2.1.7 got worse, I had to rollback to 2.1.6 for now.
I'm experiencing a similar issue in the VSCode extension.
<img width="352" height="524" alt="Image" src="https://github.com/user-attachments/assets/da01c267-d79c-452e-a3fa-38b012e0a461" />
<img width="347" height="252" alt="Image" src="https://github.com/user-attachments/assets/b5a05bd9-8ec0-4304-9d80-0c129dcb4b39" />
Left screenshot:
/context: 93.6k / 200.0k (47%)Right screenshot:
/context: 132.1k / 200.0k (66%)The status bar shows 100%, which would normally indicate the context is full and unusable. However,
/contextreveals 34% free space remaining, and the conversation continues to work normally.This causes confusion because users might think they need to start a new session when there's actually significant context space available.
This issue occurs in both Linux (WSL2, as reported above) and Windows with VSCode extension, suggesting the percentage calculation logic may be a common issue across different environments.
Environment:
---
Update: Here's another case showing a more severe issue.
<img width="257" height="207" alt="Image" src="https://github.com/user-attachments/assets/3b8fa562-62d1-4c3d-829e-1d483e8333c4" />
Screenshot 3:
/context: 169.1k / 200.0k (85%)The error blocks further usage entirely, even though 15% (approximately 31k tokens) of context space is still available according to
/context.Root cause: The status bar/warning counts INPUT + OUTPUT tokens against a ~123k limit, while
/contextcounts INPUT tokens only against 200k.In output-heavy sessions (code generation), Claude's responses consume OUTPUT tokens that
/contextdoesn't show. This explains the discrepancy even with auto-compact disabled.Source code analysis: https://github.com/anthropics/claude-code/issues/12520#issuecomment-3761894473
Note: This fix requires an Anthropic engineer—the statusline/warning logic is in the closed-source core (
cli.js), not the public repo.<img width="854" height="1051" alt="Image" src="https://github.com/user-attachments/assets/a8e02223-876c-45c0-ace6-9da7de2ebfe9" />
Is this a bug? I still have 30, around about 30% left, and the context is full?
I think it's auto-compacting even with auto compact false because my conversations also get lost????
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.