anthropics / anthropics/claude-code
[BUG] Title: 2.1.26x rejects >200K prompts on Max subscription ("Prompt is too long"); 2.1.257 serves the same 664K prompt
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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?
▎
▎
▎ Claude Max (claude.ai OAuth). Same resumed session, same 663,871-token prompt (~1.2 MB of @-injected files + history), same account, same day.
▎ - 2.1.257: served by claude-fable-5-1, 663,871 input tokens.
▎ - 2.1.269: API invalid_request: Prompt is too long on claude-fable-5-1, claude-fable-5, and claude-opus-4-8[1m] — the last of which carried this same conversation at
▎ 679,998 tokens on 2.1.197 (2026-07-01).
▎ - Not set: CLAUDE_CODE_DISABLE_1M_CONTEXT, ANTHROPIC_BETAS. CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1 made no difference. autoCompactEnabled: false.
▎ - Downgrading to 2.1.257 fixes it immediately. Suspect the 1M-context/Fable changes in v2.1.260–2.1.261. Same class as #43989 / #34158 / #11281.
### What Should Happen?
Letting me continue a >200k token conversation the previous version did fine
### Error Messages/Logs
```shell
⎿ Context limit reached · /compact or /clear to continue · auto-compact is off ·
/config to turn it on
```
### Steps to Reproduce
Take the same >200k conversation without compacting and try to continue, with both installed, one launched with
~/.local/bin/claude-2.1.257
or equivalent, instead of claude (where it will work)
and another with ~/.local/bin/claude-2.1.269
where it will request a compact, essentially negating the 1M context feature of the models
### Claude Model
None
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
2.1.257
### Claude Code Version
2.1.269
### Platform
Anthropic API
### Operating System
Ubuntu/Debian Linux
### Terminal/Shell
Terminal.app (macOS)
### Additional Information
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the resumed 663,871-token conversation with ~/.local/bin/claude-2.1.257 and claude-2.1.269, keeping auto-compaction off. Compare the context-window enforcement behavior around versions 2.1.260–2.1.261 and verify whether the listed environment variables affect it. Done means version 2.1.269 continues the same conversation without requesting /compact.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100