[BUG] Keep hitting "Request size exceeds model context window"
Resolved 💬 23 comments Opened Aug 22, 2025 by ANogin Closed Jan 8, 2026
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [X] Other: Anthropic subscription
- Claude CLI version: 1.0.88
- Operating System: Ubuntu 24.04.2
- Terminal: VSCode
Bug Description
Keep hitting API Error: 413 {"type":"error","error":{"type":"invalid_request_error","message":"Request size exceeds model . Once it's hit, not able to compact either because of the same error.
context window"},"request_id":...}
Steps to Reproduce
Not sure.
Additional Context
Seems to be a new issue, never had it before.
23 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
happens more on Opus (default setting)- as a temp workaround i noticed you can set it to sonnet ask something and then change back to "default" model setting. Sonnet seems not causing issues for me at least.
I am hitting the same problem today, never had it before.
Same here - this behavior seems to be common since yesterday evening when employing Opus. Opus too stronk
same here, Opus is not working. Sonnet is working
same here, since updated to the newer version, Opus model just stopped working.
https://status.anthropic.com - it's being investigated.
same for me
Same, happens after I send a screenshot to claude code
The issue that was investigated is marked as closed, but I am still hitting the error. Just now hit it when it explicitly says "Context left until auto-compact: 11%", so clearly there is some mismatch between context window size calculation in Claude code vs the actual API...
Interestingly, after I exited and restarted claude -r, I was able to compact, so maybe the issue is indeed fixed.
seeing this issue on my frontend app many times during recent 8 hours, while 2 other tabs on my backend app are still working properly without any issues.
Unfortunately, I'm unable to compact even after I restart claude.
for now, just change model (/model) to Sonnet 4. Hopefully they will fix this OPUS issue ASAP!
same here on 200$ max, combined with random timeouts 5/10 - 10/10 and then 413.. anyone else noticed the huge drop in quality ?
I started getting error with the message
Prompt too long, which is similar to the ones above but not something I have yet seen elsewhere.$200 max plan sub here and yes…
My lead agent just hallucinated building out an entire phase of infrastructure before I even hit 1 auto-compact. Added mocked data even though it’s explicitly called out in the lead agents Claude.md file and across every sub-agents config. I’ve done everything to try to keep the agents from going off the rails, but somehow no matter what I do to prevent it, it happens.
Has anyone else noticed a noticeable difference in the agent performance from back to back sessions?
Yes! Some of them will lie their ever loving asses off! Others we’ll absolutely give it their all. Night and day difference! I’m thinking it may have something to do with time of day, due to demand across the globe.
Can this be closed?
I encountered a similar problem. When trying to send an image, I got an error.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.