cozempic
cozempic copied to clipboard
claude-opus-4-6 context window incorrectly set to 1M (should be 200K)
Bug
In src/cozempic/tokens.py, the MODEL_CONTEXT_WINDOWS mapping sets claude-opus-4-6 to 1_000_000:
MODEL_CONTEXT_WINDOWS: dict[str, int] = {
"claude-opus-4-6": 1_000_000, # ← incorrect
...
}
Expected
Should be 200_000. Per Anthropic's official documentation:
Claude Opus 4.6 supports a 200K context window (with 1M token context window available in beta)
The 1M context window is a beta-only API feature that requires an explicit header. Claude Code uses the standard 200K window by default.
Impact
All context percentage calculations for Opus 4.6 sessions are 5x too low:
- A session at 60% of 200K reports as 12% of 1M
- Guard daemon token-based thresholds fire 5x too late
- Users get a false sense of headroom
Suggested fix
"claude-opus-4-6": 200_000, # 1M is beta-only via API header; default is 200K
Optionally, could add a --context-window CLI flag or env var for users who have opted into the 1M beta.
Environment
- cozempic 0.7.2
- Claude Code 2.1.50
- macOS Darwin 25.2.0
Good catch — fixed in v0.7.3 (just published).
Changes:
claude-opus-4-6now defaults to 200K (was incorrectly set to 1M)- Added
--context-windowCLI flag for users on the 1M beta:cozempic treat current --context-window 1000000 - Added
COZEMPIC_CONTEXT_WINDOWenv var as an alternative override
pip install --upgrade cozempic to get the fix.