[BUG] API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.16...
Resolved 💬 18 comments Opened Jun 10, 2025 by BenAWise Closed Jun 11, 2025
💡 Likely answer: A maintainer (igorkofman, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: <!-- output of
claude --version--> - Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->
- Terminal: <!-- e.g. iTerm2, Terminal App -->
Bug Description
spits out this error and stops working (I need to start a new instance):
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.16: tool_use ids were found without tool_result blocks immediately after:
toolu_01ENfqixDcscyvWNA4g95Ucw. Each tool_use block must have a corresponding tool_result block in the next message."}}
Steps to Reproduce
- Start Claude in terminal
- Ask it to use web search tool in a prompt
- Interrupt it via 'esc'
Expected Behavior
That I can 'tell it what to do differently'
Actual Behavior
Stops working re: above bug
18 Comments
We've resolve the root cause for this issue in 1.0.21 (claude update and claude --version).
To recover a stuck session hit "esc" twice and rewind back to before the error.
I still have this issue using --continue on latest version and twice esc does not resolve it, I submitted /bug with ID
1421edcf-5be3-4dcc-8723-6259a5ab1e42I have the same issue. usually happens with git commands
for example:
Just received the same 400 API Error:
I'm on 1.0.51
same error. Im in wsl
Still happening! Really annoying.
Same here
Same for me
The same goes for me! What are you doing?! Could you tell us why you closed the issue without resolving it?
Same here with docker-compose file that has some environment variables.
This still happening for me on node v22, when I use it in node v20 it works.
rewinding does not work either. whats the solution here please? i have tried everything and nothing works
Same for me
Just hit this on v1.0.72. No matter why I say, it thinks briefly that hits this error.
same here.
same here. got this error first time 2 times today on MAX plan. I tried to
/exitand go back to the chat withclaude -c, but it didn't work. I didn't hit my limits. Worked/exitand thenclaude codebut I lost all my context.My workaround was to Esc-Esc and rewind the conversation to the stage before the error first occurred.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.