[BUG] Image base64 size (8.4 MB) exceeds API limit (5.0 MB). Please resize the image before sending.
Resolved 💬 21 comments Opened Jan 22, 2026 by DineshNarra Closed Apr 13, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
constantly running into the error - Image base64 size (8.4 MB) exceeds API limit (5.0 MB). Please resize the image before sending. ' though the size of the image is less. opening a new window also doesn't fix this.
What Should Happen?
Claude for Vs code asks for screenshot and when i provide one, it throws me an error and gets stuck.
Error Messages/Logs
Steps to Reproduce
<img width="520" height="298" alt="Image" src="https://github.com/user-attachments/assets/f2376597-c979-4181-8e7c-3a594eb7a9b4" />
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
2.1.11
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
21 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is just a new version of the image bug they had previously. Its consistent yet Anthropic won't fix it. it literally breaks all chats, previously one could compact it and it would work again but I dunno a fix now
See my workaround until it’s fixed.
Image base64 size (19.9 MB) exceeds API limit (5.0 MB). Please resize the image before sending. (Same Bug)
I just stopped using images entirely unless its a small snippet. Claude losses context with every compact session yet carry forwards the image size. This requires some fundamental fixing at anthropic. Lets wait for their response on this bug. hope it gets resolved soon.
its frustrating
Its very fustrating and it got better a little bit in recent updates but its still not worth using multi format, however sometimes it helps trumendously for different work flows.
Maybe if they used a real human instead of claude code to fix it...?
same here on latest version. worked fine in the last days but suddenly stopped today
same
Ran into this same bug, please fix it.
PLEASE SOMEONE FIX THIS ASAP
Same here
i have been getting these msg in prompts over the past couple of days
I cannot upload any screenshot without receiving the error: "Image base64 size (5.0 MB) exceeds API limit (5.0 MB). Please resize the image before sending."
Since losing conversation history was a recurring problem for me, I built a bash dashboard to track all Claude Code operational files (CLAUDE.md, MEMORY.md, conversation logs) across projects. It helps you see what Claude knows per project and clean up old session logs.
Zero dependencies, single script: https://github.com/sarob/claude-ops
Fixed the problem : Claude Code Stuck on "Image base64 size exceeds API limit"
What Happened: basically we attached a large image in Claude Code. It got saved into the conversation JSONL file. Now every message fails with the same error because Claude Code re-sends all prior messages (including that image) as context on every API call. Even /compact and /context fail.
How to Fix :
Step 1 : Find your conversation file
Your stuck session ID is visible in the error or window title. The conversation file lives at:
C:\Users\<you>\.claude\projects\<project-hash>\<session-id>.jsonl~/.claude/projects/<project-hash>/<session-id>.jsonlStep 2: Back up the file ( I did , you dont have to really )
cp <session-id>.jsonl <session-id>.jsonl.backupStep 3: Find which line has the oversized image
awk '{print NR, length($0)}' <session-id>.jsonl | sort -k2 -n -r | head -10The largest line(s) are your culprits.
Step 4: Run this fix script ( convert it in your own lang ) :
Step 5: Replace the original
mv <session-id>.jsonl.fixed <session-id>.jsonlStep 6: Reopen the session
Close and reopen Claude Code. The session should work again. Run /compact to clean up context.
What This Does
Finds any image in the conversation where the base64 string > 5MB
Replaces only that image with a small text placeholder
All your text, smaller images, tool calls, AI responses, and context stay intact
Nothing else is touched
<img width="850" height="452" alt="Image" src="https://github.com/user-attachments/assets/e3710ab2-65fe-49b1-8231-8118ed05c87f" />
Sure, technically your solution may work. However, I am realizing an individual conversation with a model should not be that important. Instead, focus your efforts to add strategy and plans to maintain PLANS.md, global and project CLAUDE.md, MEMORY, and SKILLS.md.
A conversation with the model is nothing more than a hallway discussion with a coworker. May be really useful and impact the project. May also be over caffeinated musings that need to be discarded. If your conversation reaches triple digits, dump it and start over.
~ sean
It is amazing that this is still not fixed....
EDIT: even "fork conversation from here" does not work on borked session.
Thank you, it worked for me!
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.