[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

  1. make a plan
  2. execute it
  3. 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.

View original on GitHub ↗

18 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8004
  2. https://github.com/anthropics/claude-code/issues/7929
  3. https://github.com/anthropics/claude-code/issues/7991

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

not-a-not-c · 9 months ago
not-a-not-c · 9 months ago

Just tell claude to read a PDF and I'm getting this

hejtmii · 9 months ago

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_use with non-existent!!! tool names.

Here is an extract from the agent messages where you can see that:

  • The LLM first requested tool use for 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...
  • In the next turn, it requested tool uses for tools max_results and search_depth, which are not names of the tools, but rather names of the parameters of tavily_search tool. - 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

em · 9 months ago

I get this constantly. All day, every day.

ckhimji · 9 months ago

WHY CANT THEY FIX THIS ISSUE !!!! I AM LOSING HOURS OF WORK !!!!!!!!!!!!

semikolon · 9 months ago

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

hejtmii · 9 months ago

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.

3rd · 9 months ago

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" />

semikolon · 9 months ago

Yes, this has for me been only with 4.5 as far as I can recall. @hejtmii

semikolon · 9 months ago
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 alt="Image" width="763" height="488" src="https://private-user-images.githubusercontent.com/59587503/497454089-c7cdbdec-9f48-4c02-8ef2-48f65ff9e8b2.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTk1OTIyMTQsIm5iZiI6MTc1OTU5MTkxNCwicGF0aCI6Ii81OTU4NzUwMy80OTc0NTQwODktYzdjZGJkZWMtOWY0OC00YzAyLThlZjItNDhmNjVmZjllOGIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTEwMDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMDA0VDE1MzE1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY3OTA0MDlkOTRhOTc2MmY1NTJhNzQwMzAwMjNmN2MyYjRhNjljOTBhMjY0NGU5ZTM1NWU0ZjZiYWVmOTk4NTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CU3BbJY7DPzFJjdEJnzgImc2w_Q586dLug5ozcMtb54">

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.

semikolon · 9 months ago
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.

Any more responses from Anthropic? @hejtmii

hejtmii · 9 months ago

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

semikolon · 9 months ago
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 :)

semikolon · 9 months ago

Ah, THIS seems to be one of the first issues filed: #6836

github-actions[bot] · 7 months ago

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.

github-actions[bot] · 6 months ago

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.

github-actions[bot] · 6 months ago

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.