400: text content blocks must be non-empty on resumed sessions
Resolved 💬 3 comments Opened May 15, 2026 by johnson21023GH Closed May 18, 2026
Bug Report
Version: 2.1.142 (also reproduced on 2.1.128)
Date: 2026-05-15
Description
Since today (~2026-05-15), resuming sessions triggers 400 API errors. This affects multiple unrelated projects.
Two error variants observed:
API Error: 400 messages.64.content.3.text: cache_control cannot be set for empty text blocksAPI Error: 400 messages: text content blocks must be non-empty
Steps to Reproduce
- Have an existing session with some conversation history
- Resume the session (
Resumed session >) - Send any message → 400 error
Root Cause (suspected)
The Anthropic API appears to have tightened validation to reject empty text content blocks (text: ""). Claude Code's conversation history (likely after compaction) contains empty text blocks that were previously tolerated by the API.
Expected Behavior
Claude Code should filter out empty text content blocks before sending requests to the API.
Workaround
Start a new session instead of resuming. Old sessions with existing empty blocks in history will consistently fail.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗