Read tool sends oversized images to API, then re-sends them on every subsequent message
Bug Description
When Claude Code reads image files that are too large for the API to process, it gets a 400 Could not process image error. However, instead of dropping those images from context or warning the user, it keeps re-sending the same unprocessable images on every subsequent message, causing the same error repeatedly.
This makes the conversation completely stuck — every new user message triggers the same API error because the oversized images are still in context.
Steps to Reproduce
- Have Claude Code read multiple large image files (e.g., high-res product photos)
- The API returns:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}} - Send any follow-up message
- The same error occurs again because the images are still being sent
Expected Behavior
- Claude Code should resize/downsample images before sending them to the API, OR
- If an image fails to process, it should be dropped from context with a warning instead of being re-sent on every subsequent message, OR
- Claude Code should pre-validate image dimensions/size and warn the user before attempting to send
Actual Behavior
The "Could not process image" error repeats on every subsequent message, making the conversation unusable until the user starts a new session.
Environment
- Claude Code CLI
- Model: Opus (1M context)
- Reading local image files via the Read tool
Transcript
⏺ [Claude reads 8 image files]
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
❯ [user sends follow-up]
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
❯ [user sends another message]
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
❯ [user asks to resize]
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
Every subsequent message triggers the same error — the conversation is completely stuck.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗