[BUG] API Error: 400 - Images in repo larger than 5mb invalidates entire session.

Resolved 💬 1 comment Opened May 1, 2026 by pseudomode Closed Jun 1, 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?

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}

Claude hits a 400 - Could not process image error mid-conversation, the message that triggered it is permanently in the conversation history. Every subsequent message tries to re-process the same broken context. It kills the entire session and evidently can't recover.

What Should Happen?

Claude returned the follow to report bug:
That sounds like a bug

It is. Ideally Claude should:

  1. Skip or gracefully handle the oversized image and continue with the rest of the conversation
  2. Return a clear error message explaining which image failed and why, rather than making the entire session unresponsive

Instead, the 400 error from the API propagates up and permanently corrupts the session state, with no recovery path.

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}

Steps to Reproduce

  1. push an image file larger than 5mb to repo
  2. ask claude to read it
  3. Throws API Error 400

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.104 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗