[BUG] Web: image-only message (no text) poisons session with 400 messages: text content blocks must be non-empty, and /rewind doesn't recover it
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
Client: Claude Code on the web (browser)
Browser/OS: chrome windows
Description
When I send a message in a Claude Code web session that contains only a pasted screenshot/image with no accompanying text, the session becomes permanently stuck. Every subsequent request fails with:
API Error: 400 messages: text content blocks must be non-empty
It appears the client creates an empty text content block alongside the image. Because the full conversation history is replayed on each turn, that empty block now sits in the history and causes the API to reject every following request — even new messages that do contain text. The result is that the entire session is unusable from that point on.
Steps to reproduce
Start a Claude Code session on the web.
Send a message containing only an image/screenshot, with no text typed alongside it.
Observe the 400 ... text content blocks must be non-empty error.
Try to continue by typing a normal text message — it still fails with the same error.
Expected behavior
The client should prevent the empty text block from being created (e.g. omit the empty text block, or attach a default placeholder), so an image-only message is a valid request. At minimum, there should be a way to recover the session after it happens.
Actual behavior
The session is permanently blocked. No further messages can be sent.
Recovery attempts that did not work
Typing /rewind in the input does nothing in the web version (it seems to be a CLI-only command).
No visible edit/rewind control on the offending message to remove or fix it.
The only workaround found was abandoning the thread and starting a new session on the same branch.
What Should Happen?
Expected behavior
The client should prevent the empty text block from being created (e.g. omit the empty text block, or attach a default placeholder), so an image-only message is a valid request. At minimum, there should be a way to recover the session after it happens.
Actual behavior
The session is permanently blocked. No further messages can be sent.
Recovery attempts that did not work
Error Messages/Logs
Steps to Reproduce
Actual behavior
The session is permanently blocked. No further messages can be sent.
Recovery attempts that did not work
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
latest
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗