[BUG] claude with model sonnet[1m] doesn't accept single messages > 200.000 tokens
Resolved 💬 9 comments Opened Sep 12, 2025 by freiit Closed Jan 13, 2026
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?
When I try to send a message to claude with model sonnet[1m] in batch mode, I get an api error 400 with the error message, that this execeeds context limit (see below).
What Should Happen?
claude should accept and process the message
Error Messages/Logs
$ cat mylongprompt.md | claude --model=sonnet[1m] -p
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 199139 + 21333 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_xxx"}
Steps to Reproduce
take a long text file and pipe it to "claude --model=sonnet[1m] -p
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
1.0.112
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
_No response_
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗