[BUG] API Error 400
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?
<img width="1887" height="1020" alt="Image" src="https://github.com/user-attachments/assets/5b4c27ac-c0c1-44c5-b5a5-5b2f5a517f33" /> The blocks appear at any moment, whether Claude is taking control of the code or giving me instructions to follow. I use the computer a lot, and since this afternoon it won't work anymore. It says it can't. Claude said : This is an internal bug in Claude Code: the conversation history contains empty text blocks (likely empty tool results) that are sent back to the API with every message, causing a 400 error.
Quick fix: Start a new session (using the “New session” button in the top-left corner). The corrupted history will be discarded.
What Should Happen?
He had to either use a computer to manage the web-based part of my project or run code in PowerShell.
Error Messages/Logs
API Error: 400 messages: text content blocks must be non-empty
Steps to Reproduce
The error occurs randomly at various points during the conversation, without any specific action triggering it.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.1.143
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗