API Error 400: text content blocks must be non-empty - session becomes unresumable

Resolved 💬 3 comments Opened May 20, 2026 by duidet-byte Closed May 24, 2026

Describe the bug
After a conversation session ends with errors, attempting to resume or continue the session results in repeated API errors. Every message typed triggers the same error and the session cannot be recovered.

Error message
API Error: 400 messages: text content blocks must be non-empty

To reproduce

  1. Have a conversation session that ends with errors
  2. Try to resume or continue typing in that session
  3. Every input returns the 400 error — the session is stuck

Expected behavior
Claude Code should either recover gracefully or start a fresh session, not get stuck in an unrecoverable error loop.

Environment

  • OS: Windows 10
  • Claude Code version: 2.1.144
  • Model: Claude Sonnet 4.6

Additional context
The root cause appears to be that an empty text content block gets written into the session history. When the history is replayed to the API on the next message, the API rejects it with a 400 error every time. Workaround: start a completely fresh session.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗