[BUG] API crashes when attempting to read BMP files via Read tool

Resolved 💬 4 comments Opened Sep 8, 2025 by RobertDaleSmith Closed Dec 5, 2025

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?

Claude Code crashes with API Error 400 when trying to read .bmp files, stating BMP is not a supported media type (only JPEG, PNG, GIF, WEBP
supported)

  • Steps to reproduce: Use Read tool on any .bmp file
  • Expected behavior: Should either read the file as binary data or gracefully handle unsupported image formats
  • Actual behavior: Chat session becomes unresponsive and fails to continue

What Should Happen?

Claude should use an alternative image read tool or bmp support needs to be added to existing read tool. At the very least, the chat should not get stuck in a repeating error loop when this error occurs. Should recover gracefully and move onto another method. Instead my session is lost as any further prompts return same error.

Error Messages/Logs

⏺ Bash(grep -n "k_work_submit" /Users/robert/git/mouthpad_usb/app/src/even_g1.c)
    ⎿  No matches found
    ⎿  Read ../../../EvenDemoApp/assets/images/image_1.bmp (9.6KB)
    ⎿  Read ../../../EvenDemoApp/lib/utils/utils.dart (42 lines)
    ⎿  Read ../../../EvenDemoApp/lib/services/features_services.dart (41 lines)
    ⎿  Read ../../../EvenDemoApp/lib/views/features/bmp_page.dart (80 lines)
    ⎿  Read ../../../EvenDemoApp/lib/controllers/bmp_update_manager.dart (137 lines)
    ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0.image.source.base64.media_type: Input should be 
  'image/jpeg', 
      'image/png', 'image/gif' or 'image/webp'"},"request_id":"req_011CSwXxDmhKB6RKufzA1jtS"}

Steps to Reproduce

  1. Obtain any BMP file (create one, download one, or find one on your system)
  2. Use Claude Code's Read tool to attempt reading the BMP file:
  • Read /path/to/your/file.bmp
  1. Expected Result:
  • API Error 400: "messages.1.content.0.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'"
  • Claude Code chat session becomes unresponsive

The issue occurs with any .bmp file regardless of size or content.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.108 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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