[BUG] Corrupted image attachment causes persistent "API Error: 400 Could not process image" on all subsequent messages
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?
Expected Behavior:
- The error should only occur for the message containing the corrupted image
- Subsequent text-only messages should succeed normally
- Ideally, Claude Code should either: (a) gracefully handle unprocessable images with a user-facing warning instead of an API error, or (b) drop the failed image from
conversation context so future messages aren't affected
Actual Behavior:
Every message after the corrupted image attachment fails with API Error: 400 Could not process image, rendering the session completely broken. The only recovery is to
start a new session.
Environment:
- Claude Code version: v2.1.23
- Model: us.anthropic.claude-opus-4-6-v1
- Platform: macOS
What Should Happen?
When a corrupted image file (e.g., a PNG with zeroed-out magic bytes) is attached in a Claude Code session, the API returns 400 Could not process image. This is
expected for the initial message. However, the error persists on all subsequent messages in the session, even when:
- No image is being attached
- The user explicitly states "you don't have to process the image"
- The message is a plain text request unrelated to the image
The corrupted image appears to remain in the conversation context and is re-sent with every subsequent API call, making the entire session unusable.
Steps to Reproduce:
- Open Claude Code (v2.1.23, model: us.anthropic.claude-opus-4-6-v1)
- Have a normal text conversation (works fine)
- Attach a corrupted PNG file (e.g., one with the first 4 bytes zeroed out)
- Observe: API Error: 400 Could not process image
- Send any follow-up plain text message without attaching any image
- Observe: same API Error: 400 Could not process image repeats
Error Messages/Logs
API Error: 400 Could not process image
Steps to Reproduce
Steps to Reproduce:
- Open Claude Code (v2.1.23, model: us.anthropic.claude-opus-4-6-v1)
- Have a normal text conversation (works fine)
- Attach a corrupted PNG file (e.g., one with the first 4 bytes zeroed out)
- Observe: API Error: 400 Could not process image
- Send any follow-up plain text message without attaching any image
- Observe: same API Error: 400 Could not process image repeats
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.23
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
<img width="1699" height="1021" alt="Image" src="https://github.com/user-attachments/assets/4a918835-8db4-4ef1-8fd0-9fa52ae3aad7" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗