[BUG] "invalid_request_error" `tool_use` ids were found without `tool_result` blocks immediately after
Resolved 💬 18 comments Opened Sep 25, 2025 by villesau Closed Jan 9, 2026
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?
I am very often getting following errors:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.14: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01FHK3mQCv3d7USH5JoiFPjH. Each
`tool_use` block must have a corresponding `tool_result` block in the next message."},"request_id":"req_011CTVPfkaZenCkkA67VZfjx"}
What Should Happen?
this should not happen
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.14: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01FHK3mQCv3d7USH5JoiFPjH. Each
`tool_use` block must have a corresponding `tool_result` block in the next message."},"request_id":"req_011CTVPfkaZenCkkA67VZfjx"}
Steps to Reproduce
- make a plan
- execute it
- eventually this will happen. in this case, I also edited older message which might or might not impact.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v1.0.124
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
This happens many times a day.
18 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Looks like a regression of https://github.com/anthropics/claude-code/issues/1894
Just tell claude to read a PDF and I'm getting this
Hi, we came across this too, using CopilotKit framework. We are seeing these errors randomly for last 1-2 weeks, previously it seemed to work fine.
Our investigation shows that the Claude model (at least Sonnet 4) sometimes returns
tool_usewith non-existent!!! tool names.Here is an extract from the agent messages where you can see that:
tavily_search, but with invalid (empty) parameters violating the tool schema - First model bug, I would assume that tool use requests should be validated against the tool schema...max_resultsandsearch_depth, which are not names of the tools, but rather names of the parameters oftavily_searchtool. - Second model bug, using parameter names as tool names...<img width="822" height="605" alt="Image" src="https://github.com/user-attachments/assets/32e8591c-4cda-4d6b-a079-8427ae4c0df7" />
I would say the model should not be allowed to produce tool use with name outside of the names of the tools provided in the request, as well as not be allowed to generate arguments for . It seems like the root cause a model bug to me...
Not sure if there is a repo where I could report the bug for the model itself, so putting it here for now...
The agent framework we are using is not robust enough to handle it gracefully, I assume many of them aren't robust in the same way, simply ignoring requests for non-existent tools, producing the same errors eventually as a symptome.
More details about the problem at the agent framework side here:
https://github.com/CopilotKit/CopilotKit/issues/2504
I get this constantly. All day, every day.
WHY CANT THEY FIX THIS ISSUE !!!! I AM LOSING HOURS OF WORK !!!!!!!!!!!!
This is a disaster and an emergency. It's preventing me from doing real work.
Occuring in pretty much every session I'm running, sooner or later.
I have PostToolUse hooks active - I wonder if that's the culprit?
The PostToolUse output is being sent as USER MESSAGES back to CLAUDE as if I am sending new messages FOR EVERY NEW TOOL USE.
UNACCEPTABLE.
Please somebody from the Claude Code team - reach out if you want help debugging this.
Collection of other similar bug reports:
#8187 #8077 #8201 #8303 #8325 #8425 #8507 #8612 #8652 #8670 #8746 #8763 #8783 #8790 #8817 #8818 #8821 #8847 #8867 (my report) #8887 #8893 #8894 #8895 #8897 #8903
JFYI: I (earlier) contacted Anthropic team regarding the issue on the model side and they say they are aware of the issue at the model side and working on it (whatever that means).
They also ask if the same happens with Claude 4.5 (we didn't have a chance to try it), so if everyone knows, please share it.
Yes, it happens with 4.5 as well, and sometimes it gets stuck in a state where it can't be interrupted.
Seems related to having hooks configured, for me it happens in every session.
<img width="763" height="488" alt="Image" src="https://github.com/user-attachments/assets/c7cdbdec-9f48-4c02-8ef2-48f65ff9e8b2" />
Yes, this has for me been only with 4.5 as far as I can recall. @hejtmii
Yes for me it often gets into a state of uninterruptable looping based on subsequent tool uses triggering "user messages" which simply contain PostToolUse hook outputs. Insanity.
Any more responses from Anthropic? @hejtmii
Hi Everyone, @semikolon
JFYI here is the last info from Anthropic I got just yesterday:
Hi Martin,
Thank you for your follow-up and for sharing the GitHub issue thread showing this error persists in Claude Sonnet 4.5.
To answer your question about tracking this issue's status: Our status page (status.anthropic.com) is specifically reserved for incidents that meet certain impact thresholds - such as sustained failure rates affecting a significant percentage of API requests or widespread service disruptions. Individual bugs like this tool_use/tool_result validation error, even when affecting multiple customers, typically don't meet those thresholds for status page posting. We currently don't have a public-facing bug tracker where you can monitor the status of specific bugs in real-time.
That said, I can provide you with a more detailed update on this issue: Our Claude Code engineering team is actively investigating this bug and has identified three distinct root causes. One of these has already been mitigated, and the team is working through the remaining causes with active pull requests in progress. The GitHub thread you linked shows this is primarily affecting Claude Code users, and the team is treating this as a priority issue.
If you're experiencing this error in Claude Code specifically, there are a couple of workarounds that may help while the fixes are being finalized:
• Use the /rewind command to recover from the error state
• If the issue persists, running /share and providing the transcript to the team via the GitHub issue would help with debugging
If you're encountering this in direct API usage (outside of Claude Code), please share specific request IDs from your error responses when you have them available, as that would be valuable additional context for the engineering team.
Let me know if you have questions.
We have now added request IDs to our internal logs so when we encounter it again, we will likely be able to sent it to them for detailed examination
Thank you so much for the update. This is super bad timing for me since I'm finishing up a really important project, so I've been feeling frustrated. Tempting to switch from CC to Codex or something but I have built familiarity with CC now and a narration hooks system and integration with Graphiti (local graph database) etc etc so I'd really rather not switch away. Makes me sort of impatient :)
Ah, THIS seems to be one of the first issues filed: #6836
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.