Remote control: image base64 data arrives empty, causing API 400 error
Bug Description
When using Claude Code via remote control (Claude app UI connecting to a CLI instance), images attached to messages arrive with empty base64 data. The image content block structure is preserved (type: "image", source.type: "base64", media_type: "image/png"), but source.base64 is an empty string.
This causes the Anthropic API to reject the request with:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.91.content.1.image.source.base64: image cannot be empty"}}
Steps to Reproduce
- Run Claude Code on a remote machine (e.g., VPS)
- Connect to it via the Claude app's remote control feature
- Send a message with an image attachment (paste or attach)
- The API call fails with the 400 error above
Evidence
Inspecting the session .jsonl file shows the image blocks arrive with zero-length base64:
Line 221, content[1]: source_type=base64, media_type=image/png, base64_len=0
Line 249, content[1]: source_type=base64, media_type=image/png, base64_len=0
The text content in the same message arrives fine — only the image binary data is dropped.
This happens even in fresh sessions (immediately after /clear), ruling out context compaction as the cause.
Environment
- Claude Code version: 2.1.76
- OS: Windows Server 2025 Datacenter 10.0.26100
- Connection method: Remote control via Claude app UI
- Image format: PNG (pasted from clipboard)
Expected Behavior
Image base64 data should be transmitted intact through the remote control protocol, just as text content is.
Workaround
Save images to a synced folder and use the Read tool to view them, or use a separate web UI that handles images via direct file upload.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗