[BUG] Image upload fails with API Error 400 "Could not process image" for macOS native screenshots
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?
Environment
OS: macOS 26.2 (Tahoe) - Apple M1 Pro
VS Code Version: 1.106.0
Claude Code Extension Version: 2.1.41
Description
Image uploads fail in Claude Code VS Code extension with error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
The same images upload successfully to:
✅ claude.ai web interface
✅ Claude desktop/mobile apps
Actual Behavior
Upload fails with 400 error from Anthropic API.
!Image
Investigation & Findings
What works vs what fails:
✅ Works:
Images captured with third-party tools (e.g., Shottr)
Native screenshots re-saved through Preview (Tools → Adjust Size → OK → Export)
Images resized/re-encoded via command line tools
❌ Fails:
Standard macOS native screenshots (Cmd+Shift+3/4), even at moderate sizes
File size is NOT the determining factor - a 98KB native screenshot still fails
Pixel dimensions are NOT the determining factor - larger re-encoded images work fine
What Should Happen?
Expected Behavior
Screenshots should upload successfully, as they do in claude.ai web and desktop apps.
Error Messages/Logs
API Error: 400 {"type":"error", "error":("type": "invalid_request_error","message": "Could not process image"},"request_id":"req_011CY6XEqAdvQfYs5shkx3ym"}
Steps to Reproduce
Take a screenshot using macOS native screenshot tool (Cmd+Shift+3 or Cmd+Shift+4)
Open Claude Code chat in VS Code
Attempt to attach the screenshot to a message
Observe error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"}}
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.41
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Root cause hypothesis:
Native macOS screenshots contain metadata or use JPEG/PNG encoding that the extension's image processing pipeline cannot handle, but the claude.ai API itself accepts (proven by web/app success).
When images are re-saved through Preview or other tools, metadata is stripped/normalized and encoding is standardized, allowing upload to succeed.
Workarounds
Re-save through Preview: Open screenshot → Tools → Adjust Size → OK → File → Export → Upload
Use third-party screenshot tool: Tools like Shottr produce compatible images immediately
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗