Image pasting error: "Image does not match the provided media type image/png"

Resolved 💬 3 comments Opened Jul 8, 2025 by helpimfalling Closed Jan 5, 2026

Sorry if this issue sucks it's my first time writing one (err, having claude write one...), feel free to let me know what else is needed to triage it.

Description

Sometimes after pasting an image into Claude Code and sending a message, subsequent messages consistently fail with an API error related to image media type validation. I verified the image I tried to paste is a PNG.

Error Message

Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.12.content.0.image.source.base64.data: Image does not match the provided media type image/png"}}

<img width="890" height="1832" alt="Image" src="https://github.com/user-attachments/assets/a8a738d7-60a2-406a-93ec-e1fc05a67d15" />

Steps to Reproduce

  1. Paste an image into Claude Code
  2. Send the message with the image
  3. Attempt to send any subsequent message
  4. Error occurs repeatedly for all new messages

Environment

  • OS: macOS 15.5
  • Claude Code Model: claude-Opus-4-20250514

Expected Behavior

Images should be processed correctly without affecting subsequent message sending.

Actual Behavior

After pasting an image, all subsequent messages fail with the media type validation error, making Claude Code unusable until potentially restarted.

Impact

This is a blocking issue that prevents continued use of Claude Code including compacting the conversation after pasting an image. Will allow clearing.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗