claude-code - 💡(How to fix) Fix [BUG] Image attachment + text message causes messages: text content blocks must be non-empty 400 error [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55118Fetched 2026-05-01 05:45:47
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Observe 400 error: messages: text content blocks must be non-empty Subsequent messages in the same conversation continue to fail with the same error

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

sent a message with an image attachment + text, got messages: text content blocks must be non-empty repeatedly.

<img width="1482" height="1754" alt="Image" src="https://github.com/user-attachments/assets/d6277ce8-0821-4e1c-b691-215b012b23eb" />

What Should Happen?

It should respond or at least help me fix the issue. The chat is completely offline now.

Error Messages/Logs

Steps to Reproduce

Start a new conversation in Claude Code Attach an image to a message Add text to the same message Send Observe 400 error: messages: text content blocks must be non-empty Subsequent messages in the same conversation continue to fail with the same error

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.123 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can likely be fixed by ensuring that the text content of the message is properly formatted and not empty when sending a message with an image attachment.

Guidance

  • Verify that the text content of the message is not empty and is correctly formatted before sending the message.
  • Check if there are any specific requirements for the text content format when sending messages with image attachments in the Claude Code documentation.
  • Try removing the image attachment and sending the message with only text to see if the issue persists.
  • If the issue is specific to the Sonnet model, try switching to a different model to see if the issue is model-specific.

Example

No code snippet is provided as the issue does not contain any code.

Notes

The issue seems to be a regression, as it worked in a previous version. The exact cause of the issue is unclear, but it may be related to changes in the handling of message formatting or image attachments.

Recommendation

Apply workaround: Ensure that the text content of the message is properly formatted and not empty when sending a message with an image attachment, as this is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Image attachment + text message causes messages: text content blocks must be non-empty 400 error [1 comments, 2 participants]