[Bug] Anthropic API Error: Image exceeds 5 MB maximum size limit
Status Open
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 13 comments · opened Nov 13, 2025
Bug Description
Im getting API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message
":"messages.0.content.5.image.source.base64: image exceeds 5 MB maximum:
5281812 bytes > 5242880 bytes"},"request_id":"req_011CV6ECjBHCVk4Ugwi1dacW"} after pasting a standard screenshot. Tried several times.
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.0.37
- Feedback ID: 0b3febcc-db8f-4445-bb51-4c10d91c4b66
Errors
[{"error":"Error: Lock file is already being held\n at <anonymous> (/$bunfs/root/claude:87:11857)\n at X (/$bunfs/root/claude:86:5167)\n at <anonymous> (node:fs:243:13)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-13T16:46:48.285Z"},{"error":"TypeError: A boolean was expected\n at unknown\n at <anonymous> (/$bunfs/root/claude:228:36859)\n at new Promise (native:1:11)\n at vO1 (/$bunfs/root/claude:228:36839)\n at BRT (/$bunfs/root/claude:228:80388)\n at async jyT (/$bunfs/root/claude:504:3597)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-13T16:46:50.881Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.0.content.5.image.source.base64: image exceeds 5 MB maximum: 5281812 bytes > 5242880 bytes\"},\"request_id\":\"req_011CV6ECjBHCVk4Ugwi1dacW\"}\n at generate (/$bunfs/root/claude:228:83080)\n at makeRequest (/$bunfs/root/claude:670:5356)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-11-13T16:46:55.347Z"}]
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
It's not a dupe you dumb git bot, go home, you're drunk.
I've encountered this same error, but there's a critical additional problem that makes this bug much more severe than just a failed upload:
The Problem
Once an oversized image gets into the conversation history, the conversation becomes permanently stuck in an infinite error loop and completely unusable.
What Happens
User uploads an image larger than 5 MB (in my case, 7,009,648 bytes)
The upload appears to succeed initially
Every subsequent message in that conversation fails with the same error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.95.content.0.image.source.base64: image exceeds 5 MB maximum: 7009648 bytes > 5242880 bytes"}
The conversation grows to hundreds of messages (608+ in my case), all just error responses
The conversation is completely unusable - you cannot send any new messages
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.
The conversation is unusable, at least lets make it rewind to the previous, ssame problem to claude code on the desktop macos app
Anyone found a way to fix this ? same issue, once it generates teh error there is no way to correct it or skip it
No real fix but a couple work arounds.
1) To recover the conversation (assuming pressing escape twice doesn’t
bring up the rewind function for you) is to create a new conversation and
pick out some unique phrase from the first conversation and tell the new
agent to search the JSONL conversations for that phrase (it will ideally
find the current conversation and the broken one) then tell it to delete
everything after the last prompt.
2) To prevent future occurrences (for future conversations) you have a few
options. The easiest / simplest is to tell Claude about the severity of the
problem and to have it add a line to your global CLAUDE.md file (in all
caps) and to avoid that specific call at all costs.
A more complex way to avoided this is to work with Claire to create a
pre-command hook that runs every time a tool call happens. They are
lightweight (you won’t notice it running) but they can be brittle and have
he next Claude update may break it.
Hope this helps.
On Tue, Jan 13, 2026 at 11:58 PM scotchegg @.***> wrote:
+1 I am experiencing this error in Claude VS Code Extension for IDE and it breaks my workflow
+1
Still happens. Annoying af.
Still happening. Really annoying.
still happens and i have already updated to the latest version of claude code
<img width="786" height="472" alt="Image" src="https://github.com/user-attachments/assets/cd2b2feb-f33f-46e1-8975-c5594635afb6" />
Once you've exceeded it once, it will NOT clear that oversized image out of cache and it just tries to send it over and over no matter what you type.
More detail: Even Rewind Conversation doesn't work.
I also tried to go back and "Fork Conversation" which did not work either, it opened a new window that was blank and didn't even contain a chat box.
What I had to do was go back to my most recent compaction and fork from the input context there.
I tried restarting VSCode. I tried restarting the computer. No matter what, this conversation stayed file-locked with too large a file.
2 weeks later, after login, clearing caches, updating, shutting system down; coming back to this agent it is still stuck with file size issue forever.