Image File Type Handling Error in Claude Analysis

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 5 comments · opened Mar 8, 2025 · closed May 7, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
When examining a repo containing a jpg image, Claude tried to examine the jpg as if it were script or code file. This resulted in an API

Error: Read(file_path: "small.jpg")…
  ⎿  Read image
⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.10.content.0.tool_result.content.0.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'"}}

Environment Info

  • Platform: linux
  • Terminal: konsole
  • Version: 0.2.35
  • Feedback ID: cdd646b1-71f4-4298-b431-c84d38722240

Errors

[{"error":"Error: Command failed: /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg --files --glob *.md /home/ian/.claude/commands\nrg: /home/ian/.claude/commands: IO error for operation on /home/ian/.claude/commands: No such file or directory (os error 2)\n\n    at genericNodeError (node:internal/errors:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:519:28)\n    at ChildProcess.emit (node:domain:488:12)\n    at maybeClose (node:internal/child_process:1105:16)\n    at Socket.<anonymous> (node:internal/child_process:457:11)\n    at Socket.emit (node:events:519:28)\n    at Socket.emit (node:domain:488:12)\n    at Pipe.<anonymous> (node:net:340:12)","timestamp":"2025-03-08T17:47:20.338Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.10.content.0.tool_result.content.0.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'\"}}\n    at w5.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:514:2499)\n    at V5.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:7207)\n    at V5.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:8150)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-03-08T17:49:11.716Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.10.content.0.tool_result.content.0.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'\"}}\n    at w5.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:514:2499)\n    at V5.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:7207)\n    at V5.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:8150)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-03-08T17:49:44.844Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.10.content.0.tool_result.content.0.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'\"}}\n    at w5.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:514:2499)\n    at V5.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:7207)\n    at V5.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:518:8150)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-03-08T17:49:56.825Z"}]

View original on GitHub ↗

5 Comments

timougue · 1 year ago

Same error here

L422Y · 1 year ago

This is occurring on macOS (Sequoia 15.0.1 24A348) as well, and with any sort of media - error occurs with jpg, jpeg, png, and pdf files

FYI: I closed out of my session, and updated, opened and it appears that it's working again... didn't expect that would work for an API error

bcherny collaborator · 1 year ago

Should be fixed on the latest!

CraftedMark · 1 year ago

Im still getting this issue

⏺ playwright - Take a screenshot (MCP)(fullPage: true, filename: "craftai-solutions-full-page.png")
⎿ ### Result
Took the full page screenshot and saved it as /var/folders/3j/ht9c52790x70skjp_pnldsqm0000gn/T/playwright-mcp-output/
2025-07-30T01-30-14.730Z/craftai-solutions-full-page.png
… +14 lines (ctrl+r to expand)

⎿  [Image]
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.8.image.source.base64.data: At
least one of the image dimensions exceed max allowed size: 8000 pixels"}}

github-actions[bot] · 1 year ago

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.