[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
context window"},"request_id":...}
. Once it's hit, not able to compact either because of the same error.

Steps to Reproduce

Not sure.

Additional Context

Seems to be a new issue, never had it before.

View original on GitHub ↗

23 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/6136
  2. https://github.com/anthropics/claude-code/issues/3622
  3. https://github.com/anthropics/claude-code/issues/6315

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

misza-one · 10 months ago

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.

rmujica · 10 months ago

I am hitting the same problem today, never had it before.

SuperCoolAlan · 10 months ago

Same here - this behavior seems to be common since yesterday evening when employing Opus. Opus too stronk

baur-krykpayev · 10 months ago

same here, Opus is not working. Sonnet is working

sahildhankhad · 10 months ago

same here, since updated to the newer version, Opus model just stopped working.

true-byte · 10 months ago

https://status.anthropic.com - it's being investigated.

stefanofalasca · 10 months ago

same for me

ty13r · 10 months ago

Same, happens after I send a screenshot to claude code

ANogin · 10 months ago
https://status.anthropic.com - it's being investigated.

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...

ANogin · 10 months ago
> https://status.anthropic.com - it's being investigated. 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.

itinance · 10 months ago

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.

true-byte · 10 months ago
> > https://status.anthropic.com - it's being investigated. > > > 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.

Unfortunately, I'm unable to compact even after I restart claude.

macfionn · 10 months ago

for now, just change model (/model) to Sonnet 4. Hopefully they will fix this OPUS issue ASAP!

dieFiorav · 10 months ago

same here on 200$ max, combined with random timeouts 5/10 - 10/10 and then 413.. anyone else noticed the huge drop in quality ?

soyrubio · 10 months ago

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.

ty13r · 10 months ago
same here on 200$ max, combined with random timeouts 5/10 - 10/10 and then 413.. anyone else noticed the huge drop in quality ?

$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?

macfionn · 10 months ago

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.

true-byte · 10 months ago

Can this be closed?

mape-k · 10 months ago

I encountered a similar problem. When trying to send an image, I got an error.

github-actions[bot] · 7 months ago

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.

github-actions[bot] · 6 months ago

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.

github-actions[bot] · 6 months ago

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.