Read tool sends requests exceeding 20MB API limit without pre-checking payload size
Open 💬 30 comments Opened Feb 16, 2026 by tonimelisma
Bug Description
When using the Read tool to read multiple PDF files in a single turn (4 PDFs), Claude Code sends the request without checking whether the cumulative payload exceeds the 20MB API limit. The request fails with:
Request too large (max 20MB). Double press esc to go back and try with a smaller file.
Expected Behavior
Claude Code should validate the cumulative payload size before making the API call. Options:
- Pre-check file sizes before reading and refuse/split if total would exceed the limit
- Read files incrementally and stop before hitting the limit
- At minimum, gracefully handle the error by retrying with fewer files automatically
Steps to Reproduce
- Have multiple large PDF files in the project (4 PDFs totaling >20MB)
- Claude Code attempts to read all 4 files in a single turn via the Read tool
- The API request exceeds 20MB and fails
Actual Behavior
The Read tool blindly attempts to send all file contents without checking cumulative size, hitting the 20MB wall and failing.
Environment
- Claude Code version: 2.1.42
- OS: macOS (Darwin 25.2.0 arm64)
- Node.js: v25.4.0
- Model: Claude Opus 4.6
Additional Context
This bug is compounded by a related issue where the resulting error crashes the conversation with no recovery path (filed separately).
30 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
i also have this error.
me too
this is happening to me over time as well. the "file size" accumulates with a bunch of smaller images returned over an MCP and Claude Code neglects to prune them and / or intelligently decide what goes in
Issue happens on Windows too. Not only MacOS
did anyone find any fix for this ??
i am on linux mint os , and have the same issue !
● Request too large (max 20MB). Double press esc to go back and try with a smaller file.I'm getting this every day now with the 1M context window
I'm getting this every time 😭 with small size files
Issues happening consistently. I'm on max plan. I urge everyone to downgrade when possible and look at switching providers
Same issue here. Can't continue my session anymore. Whenever I send a new message I just get the same error.
Joining this party since I can't really get much work done without hitting this very stupid error. Idk what happened but claude today is not the claude I was working with yesterday. Drastically dumbed down.
this shit is genuinely pathetic man i cant fucking stand anthropic @bcherny get your fucking head out of your ass you clown
@claude fix this bug plz, make no mistakes
@claude this is pretty annoying
Request too large (max 20MB). Double press esc to go back and try with a smaller file. hey claude can u please fix this
Request too large (max 20MB). Double press esc to go back and try with a smaller file.Please fix this !
I'm getting the same over here. Please fix. Even while sending a short message.
same here
I get this pretty often while using the playwright mcp
Max plan user ($200/mo) — this is a daily blocker
I'm hitting this bug multiple times per day as a Max plan subscriber. The irony is brutal: the users paying the most are the ones most affected, because we're the ones running longer, heavier sessions — which is exactly what we're paying for.
The real damage isn't the error — it's the aftermath
The error itself is annoying, but the actual cost is what happens next:
/clear— which nukes all conversation context./clearis a full lobotomy.The trigger is deceptive
The error message blames the current file/image, but the real cause is accumulated conversation payload silently approaching the limit. A 99KB PNG or a short text message tips it over. Users can't predict or prevent it because there's no visibility into how close you are to the limit.
What needs to happen
This is a paying customer telling you: this single bug is the #1 thing degrading my experience with Claude Code. Not missing features, not model quality — this. Please prioritize it.
This is so neglected that the notifications of new comments in the GitHub issue are now as annoying as the issue itself
Can everyone please tag @bcherny on X regarding this issue? This is quite urgent. As a paying user on the $100 plan, I’m experiencing this repeatedly, and it’s impacting usage significantly. Would really appreciate
The best is if they made the agent harness open source so we could fix these ourselves (there are some already)
Otherwise we will need to build our own harness (not to mention our own open weights models)
OK it is, and you can create you own harness. Coming from a frequent rage poster, this is manageable by a well made harness, optimizing MCPs, controlling context bloat, and just restarting the session after it creates a comprehensive hand-off. Have it audit, have another agent audit it against the conversation and move on. You can only expect so much from this awesome tool. After doing those things and restarting my sessions more frequently, 0 instances of this issue. Not to say it does not still exist but it is entirely manageable while they sort it out.
I would still take this over gemini's hack and slash harness.
Interesting, I’ll keep this in mind. Thanks
On Wed, Mar 25, 2026 at 12:02 PM LewAdvSol-Ian @.***>
wrote:
I was able to skip this problem using /compact.
You can get around this issue by:
The slow response from @anthropics should make you pause, though, and consider open source alternatives:
(Not to mention open weights models)
Their models has been degraded. Opus 4.6 among others have been degraded due to financial benefits from the company. I will switch to using a fake credit card. I urge you to do the same
Claude Code full code has been leaked, so now you can fix this on your own if you'd like (just ask Claude to do it)
Facing the same issue when working with PDF and big files as a source.