[BUG]API Error: 400 messages: text content blocks must be non-empty
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 14 comments · opened May 26, 2026 · closed Jul 21, 2026
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?
When submitting an image with no accompanying text in Claude Code's chat,
the API throws: "400 messages: text content blocks must be non-empty"
A fallback text block should be added when only an image is submitted.
Steps to reproduce:
- Open Claude Code chat
- Attach an image without typing any text
- Submit
Expected: Request succeeds with a default prompt
Actual: API Error 400 - text content blocks must be non-empty
What Should Happen?
API Error 400 when sending image with no text in chat
Error Messages/Logs
API Error: 400 messages: text content blocks must be non-empty
Steps to Reproduce
please help
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Opus
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Terminal.app (macOS)
Additional Information
<img width="1460" height="723" alt="Image" src="https://github.com/user-attachments/assets/2d1fd15f-0321-407a-8f96-565d306725f7" />
14 Comments
I need help and I'm not a real coder
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
You might want to update the title of this bug report. It shows up as simply "[BUG]" in search results, so even people who are looking for this precise problem will likely miss it in the results. (Just a bystander here; I can't fix this myself even if I knew how to summarize your report.)
同样的问题,桌面版 Pro 会员用户。会话突然卡死,报
API Error: 400 messages: text content blocks must be non-empty,完全无法继续使用。希望官方尽快修复。Claude told me to submit it as a [BUG]
so do nothing for 3 days and I will be able to resume my session?
Yes, this happened before and I had to start a whole new session. I have too much information in this session to take that route again
That should remain the _beginning_ of the bug title but you should add details. Imagine if every bug in https://github.com/anthropics/claude-code/issues had the same title. It would be absolutely useless for finding bugs you are interested in. Look at some of the others there to see how to properly summarize the topic of the bug report in the title.
understood!! I have changed it
Now that I have changed the title. Do you have any input on how to fix the problem?
This seems to be a duplicate, the duplicate candidates suggest some workarounds like
/rewindor/compactbut no way to avoid this bug. Since this is a duplicate, the recommended action is to upvote one of the earlier questions and allow this bug to be closed automatically when it ages, but since there are several existing reports, I can't say for sure which one.someone know this bug had been fixed?
Yes, they have fixed it
Closing for now — inactive for too long. Please open a new issue if this is still relevant.