[BUG] /context reports % against a 200k window on a 1M-context Opus model (false "over 100%" + spurious autocompact warning)
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?
Title: /context reports % against a 200k window on a 1M-context Opus model (false "over 100%" + spurious autocompact warning)
Version: 2.1.153 (Claude Code), model claude-opus-4-8 (Opus 1M / "5× more context")
Summary: /context computes the usage percentage against a 200k denominator even when the active model has a ~1M context window. The meter climbs past 100%
(observed 107%, 213.8k/200k) while the session continues to function normally — which is only possible because the real window is larger than 200k. The
accompanying "Context is N% full / Autocompact will trigger soon" warning fires off the wrong denominator, so it alarms with no real pressure, and
auto-compact (correctly) never triggers.
Expected: /context percentage and the autocompact warning should be computed against the active model's actual context window (~1M for this model), so e.g.
213.8k would read ~21%, not 107%.
Actual: Denominator is pinned at 200k. /context shows 102% → 107% across multiple real model turns; warning persists; no auto-compact (consistent with there
being no real pressure).
Decisive evidence: The session accepts and answers requests at 213.8k tokens with full recall to the start of the conversation. A true 200k-limited model
would reject a 214k-token request, so the real window must exceed 200k — confirming the meter's denominator, not the window, is wrong.
Repro: Run a long Opus-4-8 (1M) session past ~200k tokens; run /context; observe >100% with the session still working and no auto-compaction.
Impact: Cosmetic but misleading — prompts users to /compact and discard history to relieve pressure that doesn't exist.
What Should Happen?
Claude should report the context window properly
Error Messages/Logs
Steps to Reproduce
Just run the context window up past 200k
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.153
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗