[BUG] Context limit reached at ~200K tokens despite 1M context model
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?
Running Claude Code v2.1.75 with Opus 4.6 (1M context) on Claude Max plan. The session hit "Context limit reached · /compact or /clear to continue" at approximately 197K tokens used (20% of advertised 1M context).
Running /context immediately after the limit message confirmed:
claude-opus-4-6[1m] · 197k/1000k tokens (20%)
The model correctly shows [1m] suffix and the denominator is 1,000k, but the practical limit appears to still be enforced around the old 200K boundary.
Environment:
- Claude Code v2.1.75
- Model: claude-opus-4-6[1m] (Opus 4.6 with 1M context)
- Plan: Claude Max
- Platform: Linux (WSL2) 6.6.87.2-microsoft-standard-WSL2
- Session type: Long design review conversation with multiple file reads and edits
What Should Happen?
Session should continue until closer to 1M token limit.
Actual behavior: Session stopped at ~197K tokens with "Context limit reached" message, despite 80% of context remaining unused.
Error Messages/Logs
Context limit reached · /compact or /clear to continue
/context output at time of error:
⛁ ⛁ ⛁ ⛀ ⛁ ⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ claude-opus-4-6[1m] · 197k/1000k tokens (20%)
Estimated usage by category:
⛁ System prompt: 5.9k tokens (0.6%)
⛁ System tools: 9.1k tokens (0.9%)
⛁ Custom agents: 956 tokens (0.1%)
⛁ Memory files: 11k tokens (1.1%)
⛁ Skills: 1.2k tokens (0.1%)
⛁ Messages: 170.3k tokens (17.0%)
⛁ Compact buffer: 3k tokens (0.3%)
⛶ Free space: 799k (79.9%)
The limit appears to be enforced at the old ~200K boundary despite the model being configured for 1M context. The /context command itself correctly reports the 1M limit (1000k denominator) but the session termination threshold was not updated to match.
Steps to Reproduce
- Using Claude Code v2.1.75 with Claude Max plan (Opus 4.6, 1M context)
- Start a long conversation involving multiple file reads and edits (design document review session)
- Model correctly identifies as claude-opus-4-6[1m] throughout the session
- After approximately 197K tokens of conversation, receive "Context limit reached · /compact or /clear to continue"
- Run /context immediately after the limit message
- Output confirms only 20% of context used: "claude-opus-4-6[1m] · 197k/1000k tokens (20%)"
- Session cannot continue despite 800K+ tokens remaining
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.75 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
4 Comments
Related to #34143 but distinct — this is not a request for 1M support, it's a bug where 1M context is enabled (model shows [1m], /context shows 1000k denominator) but the session still terminates at ~200K tokens.
I had this issue and fixed it:
/logoutand close all open Claude Code sessionsreplacing this with
"s1mAccessCache": {}/loginagainI haven't replicated this, so might not work for others, but I now see
Opus 4.6 (1M context) 321562 tokensin my status barResolution: CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE env var silently capping context at 197K
Symptoms
Root Cause
export CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE=197000 was set in ~/.bashrc — originally added as a workaround for issue #18152 (context window management problems approximately a month prior). At that time, the env var helped stabilize sessions. However, when the 1M context window rolled out, this same env var became the problem — it hard-caps the usable context at the client level, overriding everything else including the 1M window.
All 1M plumbing was working correctly:
But CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE=197000 silently overrode the actual limit, causing Claude Code to trigger "Context limit reached" before the API ever saw a request beyond 197K tokens. The UI gave no indication that an env var was responsible for the discrepancy.
Fix
Verification
After the fix, successfully loaded 294K tokens (29% of 1M) in a single session with no "Context limit reached" error — well past the previous 197K ceiling. Session remained fully coherent and functional throughout.
Suggestion for the team
This env var creates a confusing UX — the UI reports 1M context but the session dies at the override limit with no indication that an env var is responsible. Anyone who previously set this variable as a workaround (per #18152 or similar) will silently lose access to the 1M context window. Two ideas:
⚠️ Context limit overridden to 197K by CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE (1M available)
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.