[Bug] Anthropic API Error: Image exceeds 5 MB maximum size limit

Status Open
Maintainer reply None cached
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"}]

View original on GitHub ↗

13 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8202
  2. https://github.com/anthropics/claude-code/issues/2104
  3. https://github.com/anthropics/claude-code/issues/2146

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

smconner · 9 months ago

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

github-actions[bot] · 8 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.

alexandrosk · 7 months ago

The conversation is unusable, at least lets make it rewind to the previous, ssame problem to claude code on the desktop macos app

scotchegg · 7 months ago

Anyone found a way to fix this ? same issue, once it generates teh error there is no way to correct it or skip it

smconner · 7 months ago

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:

scotchegg left a comment (anthropics/claude-code#11564) <https://github.com/anthropics/claude-code/issues/11564#issuecomment-3745408706> Anyone found a way to fix this ? same issue, once it generates teh error there is no way to correct it or skip it — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/11564#issuecomment-3745408706>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABWQMBEU7KHZ7JYZORM7W34GUP27AVCNFSM6AAAAACMAX3LY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONBVGQYDQNZQGY> . You are receiving this because you commented.Message ID: @.***>
VinLucero · 7 months ago

+1 I am experiencing this error in Claude VS Code Extension for IDE and it breaks my workflow

VanDerLars · 6 months ago

+1
Still happens. Annoying af.

jfreal · 5 months ago

Still happening. Really annoying.

NaserElziadna · 5 months ago

still happens and i have already updated to the latest version of claude code

HBT89 · 5 months ago

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

HBT89 · 5 months ago

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.

HBT89 · 5 months ago

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.