Bug Report API Error: 400 `tool_use` ids were found without `tool_result` blocks immediately after...

Resolved 💬 59 comments Opened Jun 10, 2025 by GratefulDave Closed Jun 11, 2025
💡 Likely answer: A maintainer (igorkofman, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
This happens randomly and persists forcing me to restart new Claude Code instance.

Refactor S3_manager according to best practices and @docs/refactoring.md

⎿  Read docs/refactoring.md (1605 lines)
⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5: tool_use ids were found without tool_result blocks immediately after: toolu_01FRvEykWmCgrgJ22mvBbKhV. Each tool_use block must have a corresponding tool_result block in the next message."}}

continue

⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5: tool_use ids were found without tool_result blocks immediately after: toolu_01FRvEykWmCgrgJ22mvBbKhV. Each tool_use block must have a corresponding tool_result block in the next message."}}

UPDATE documentation

⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5: tool_use ids were found without tool_result blocks immediately after: toolu_01FRvEykWmCgrgJ22mvBbKhV. Each tool_use block must have a corresponding tool_result block in the next message."}}

Environment Info

  • Platform: macos
  • Terminal: pycharm
  • Version: 1.0.17
  • Feedback ID: 39ad9130-c5ee-477f-bac9-ece2e0554c1e

Errors

[{"error":"AbortError: The operation was aborted\n    at abortChildProcess (node:child_process:716:27)\n    at onAbortListener (node:child_process:786:7)\n    at process.processTicksAndRejections (node:internal/process/task_queues:85:11)","timestamp":"2025-06-10T07:36:15.666Z"},{"error":"MCPContentTooLargeError: MCP tool \"read_file\" response (30206 tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size.\n    at is1 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:7798)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async vX2 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12473)\n    at async Object.call (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:8729)\n    at async iZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:19166)\n    at async WK1 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:17752)\n    at async cZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16794)\n    at async uZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16423)\n    at async NO (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:15452)\n    at async NO (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16278)","timestamp":"2025-06-10T07:40:15.927Z"},{"error":"MCPContentTooLargeError: MCP tool \"read_multiple_files\" response (26545 tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size.\n    at is1 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:7798)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async vX2 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12473)\n    at async Object.call (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:8729)\n    at async iZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:19166)\n    at async WK1 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:17752)\n    at async cZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16794)\n    at async uZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16423)\n    at async NO (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:15452)\n    at async NO (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16278)","timestamp":"2025-06-10T07:55:01.437Z"},{"error":"MCPContentTooLargeError: MCP tool \"read_file\" response (28285 tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size.\n    at is1 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:7798)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async vX2 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:12473)\n    at async Object.call (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1376:8729)\n    at async iZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:19166)\n    at async WK1 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:17752)\n    at async cZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16794)\n    at async uZ5 (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16423)\n    at async NO (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:15452)\n    at async NO (file:///Users/davidandrews/.nvm/versions/node/v23.10.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1896:16278)","timestamp":"2025-06-10T07:56:05.926Z"},{"error":"Error: Language not supported while highlighting code, falling back

Note: Error logs were truncated.

View original on GitHub ↗

59 Comments

AnthonyRonning · 1 year ago

I also got this today, never had it before.

● Bash(just bump-patch)
  ⎿  Error: sh: line 1: jq: command not found
     error: Recipe `get-version` failed on line 55 with exit code 127
     error: Recipe `bump-patch` failed with exit code 127

● Let me fix the get-version command to not rely on jq:
  ⎿  Interrupted by user
  ⎿  Interrupted by user
  ⎿  Interrupted by user

> actually if we need jq then add it to our nix flake
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.19: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_0162edssqab1kYwpztdNfXru. Each `tool_use` block must have a 
     corresponding `tool_result` block in the next message."}}

> actually if we need jq then add it to our nix flake
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.19: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_0162edssqab1kYwpztdNfXru. Each `tool_use` block must have a 
     corresponding `tool_result` block in the next message."}}
ahmedibrahim085 · 1 year ago

same here just after I Interrupted it.

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.107: tool_use ids were found without tool_result blocks immediately after: toolu_01KmrrFZotoAEWYjC1yroyu6. Each tool_use block
must have a corresponding tool_result block in the next message."}}

jri-klaay · 1 year ago

Same. Has anyone found a way to recover from it other than restarting Claude Code?

galenward · 1 year ago

I get this from time to time as well. You can hit double escape and go to the previous prompt (eliminating some context) and start there again.

igorkofman collaborator · 1 year ago

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.

kalaomer · 1 year ago

Hello, I'm using version 1.0.24 but same error happened.

API Error: 400 {"type":"error","error":{"type":"
    invalid_request_error","message":"messages.242: 
    `tool_use` ids were found without `tool_result` 
    blocks immediately after: 
    toolu_01WdYmA1KgSce5nbUcbTJZz9. Each `tool_use` 
    block must have a corresponding `tool_result` 
    block in the next message."}}
khalidDaoud · 1 year ago

same here
Claude Code Status v1.0.25
Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.27: tool_use ids were found without tool_result blocks immediately
after: toolu_01GCg6SKLPsVVW15sNuJ6jwa. Each tool_use block must have a corresponding tool_result block in the next message."}}

zachberk · 1 year ago

Getting this error with Claude Code v1.0.25 too:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.223: tool_use ids were found without tool_result blocks immediately after:
toolu_011zra4NRpA4xYVjvA4dof9t, toolu_012hVvD4ueHGNKsqDVMzZcMn, toolu_013N1NakAhCnQfVHqdb9d2qn, toolu_014iJS1MNuMPJx76oUTxbfWW, toolu_01AnA7aMdVE4zHxNpGKdKkkm,
toolu_01BCxWTT6ZjfgrK4kLZH3j7k, toolu_01C8R3r9LfjHrnmeg9mnytGx, toolu_01KrY5mzWPFJQq6V4Xeo7FR2, toolu_01P3Ssb9FFnoPmfstk2TnV9X, toolu_01TgLj2ktFpkR43rfoEh11Vv,
toolu_01X38MMqvXBuJkroJmjmv6na, toolu_01XxH41RgMndShaFJnyPoW4p. Each tool_use block must have a corresponding tool_result block in the next message."}}

ESRogs · 1 year ago

Just got the "tool_use block must have a corresponding tool_result block in the next message" error on 1.0.29.

igorkofman collaborator · 1 year ago

What account type are you using? Does quitting and claude --resume ing the
conversation restore it?
Do new conversations work?
What was happening when the error occurred?

On Wed, Jun 18, 2025 at 10:13 PM Eric S. Rogstad @.***>
wrote:

ESRogs left a comment (anthropics/claude-code#1894) <https://github.com/anthropics/claude-code/issues/1894#issuecomment-2986632912> Just got the "tool_use block must have a corresponding tool_result block in the next message" error on 1.0.29. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/1894#issuecomment-2986632912>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSWQX3LEUA7MHF6OMFEYL3EJBGLAVCNFSM6AAAAAB677MV3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOBWGYZTEOJRGI> . You are receiving this because you modified the open/close state.Message ID: @.***>
Rasit-Vatan · 1 year ago
What account type are you using? Does quitting and claude --resume ing the conversation restore it? Do new conversations work? What was happening when the error occurred? […](#)

i just got the same problem.
max($100) account.
--resume doesn't work but new conversations are fine.

I was using it just fine. Then I copy pasted a console output to ask something about it and now that conversation is bugged. 2x esc doesn't work. /compact doesn't work. Tried logout + login but its still broken.

apstndb · 1 year ago

Session File Investigation Report

I investigated session files that couldn't be resumed and found evidence directly related to this issue.

Findings

Tool Use/Result Mismatch:

Session file: 482cb242-01c9-4149-8c8a-b9b24fdc9844.jsonl
Tool use blocks: 47
Tool result blocks: 44
Missing: 3 tool_result blocks

Root Cause:

  • User interruptions ([Request interrupted by user for tool use]) left tool_use blocks without corresponding tool_result blocks
  • These orphaned tool_use blocks prevent session resumption with the exact error: "tool_use ids were found without tool_result blocks"

Impact:

  • Sessions with mismatched counts cannot be resumed
  • Users must start new sessions, losing context

This confirms the issue is caused by incomplete tool_use/tool_result pairs in session files, particularly after user interruptions.

w0wl0lxd · 1 year ago

This issue can also be caused by conflicting tool calls/overlapping functionality when one supersedes the other.

jwaes · 1 year ago

same in Claude Code Status v1.0.33 ... the double esc and going back up to 10 positions before the error ... and no way to recover ...

spruik-co · 1 year ago

Hi guys, just received the same issue;

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1: tool_use
ids were found without tool_result blocks immediately after: toolu_01YDDsf7nQsBk9SSLHe41TUW. Each
tool_use block must have a corresponding tool_result block in the next message."}}

No way to reovery sessions and I lose all of my context.

^ This was using Claude Code on Debian WSL instance (Windows).

igorkofman collaborator · 1 year ago

Could you resume the affected session and submit a report using /bug? That
will really help us debug.
Thanks

On Thu, Jun 26, 2025 at 6:40 AM spruik-co @.***> wrote:

spruik-co left a comment (anthropics/claude-code#1894) <https://github.com/anthropics/claude-code/issues/1894#issuecomment-3008541295> Hi guys, just received the same issue; ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1: tool_use ids were found without tool_result blocks immediately after: toolu_01YDDsf7nQsBk9SSLHe41TUW. Each tool_use block must have a corresponding tool_result block in the next message."}} No way to reovery sessions and I lose all of my context. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/1894#issuecomment-3008541295>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSWQXQM7UVJURQVMCXORT3FPZ4TAVCNFSM6AAAAAB677MV3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBYGU2DCMRZGU> . You are receiving this because you modified the open/close state.Message ID: @.***>
spruik-co · 1 year ago

Hi @igorkofman - I had to step back 3/4 messages in terms of context and was able to continue. I didn't have to shut Claude down. Messaging the same thing wouldn't clear the error.

/bug

⎿  Error submitting bug report

:)

igorkofman collaborator · 1 year ago

Oh no! Try /bug again if it happens again. Are you on 1P or 3P?

On Thu, Jun 26, 2025 at 7:43 AM spruik-co @.***> wrote:

spruik-co left a comment (anthropics/claude-code#1894) <https://github.com/anthropics/claude-code/issues/1894#issuecomment-3008746052> Hi @igorkofman <https://github.com/igorkofman> - I had to step back 3/4 messages in terms of context and was able to continue. I didn't have to shut Claude down. Messaging the same thing wouldn't clear the error. /bug ⎿ Error submitting bug report :) — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/1894#issuecomment-3008746052>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSWQV7VB62RZAXPZGPU333FQBIBAVCNFSM6AAAAAB677MV3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBYG42DMMBVGI> . You are receiving this because you were mentioned.Message ID: @.***>
felixniemeyer · 1 year ago

I also was stuck this way today.
Going back to a message before getting stuck (hit esc+esc) allowed me to continue.

jleechan2015 · 1 year ago

Still running into this on 1.0.24. Can we change the logic so it stops hard failing on badly formatted messages in context?

Anyone have workarounds?

drhuston1 · 1 year ago

Someone please fix this.
⎿ API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message
or start a new session for Claude Code to assist with a different task.
⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.223: tool_use ids were found without tool_result blocks immediately after:
toolu_vrtx_01QhEAXjsVvt3yhEWBT5NwE2. Each tool_use block must have a corresponding tool_result block in the next message."}}

skarnz · 1 year ago

just ran into this as well. was pushing claude hard to spin up as many agents as it could on a large project. mostly just using a google workspace MCP so tons of tool calls, not even on the coding yet. realllly need this to be fixed though because my claude-trace wasnt running for part of this conversation and i need access to that context.

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.77: tool_use ids were found without tool_result blocks immediately after: toolu_01iqwqSIs6FNbADrKQ9VpRj, toolu_01UeyEQwpjQVbsB3ttjekocp. Each tool_use block must have a corresponding tool_result block in the next message."}}

FahrlyAdmin · 1 year ago

This usually happens when we interupt claude while thinking and then send directly another message but the interuption before didnt really "intreupt" and it was yet still thinking or doing. thats what I was noticing.

camspilly · 1 year ago

Getting the same exact thing, I can't just abandon the chat I have though

ccchow · 1 year ago

1.0.48 hit the same issue today.

mikem-coalesce · 1 year ago

esc-esc back a few steps with some new instructions seems to work around it. "note that we already implemented the task you were going to work on next, please proceed to task XYZ"

alandotcom · 1 year ago

Ran into the same issue. No amount of escaping fixed it. Had to start a new thread.

christianpeirson · 1 year ago

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.4: tool_use ids were found without tool_result blocks immediately after: toolu_01PtJEAkLM3EvK7EhJ8QgZWC. Each tool_use block must have a
corresponding tool_result block in the next message."}}

Same issue

snapfast · 1 year ago

15 July 2025

 API Error: 400 
    {"type":"error","error":{"type":"invalid_request_error","message":"messages.6: `tool_use` 
    ids were found without `tool_result` blocks immediately after: 
    toolu_01WJjaQpXMi27SfHirJfLVpa. Each `tool_use` block must have a corresponding 
    `tool_result` block in the next message."}}
  ⎿  API Error (529 {"type":"error","error":{"type":"overloaded_error","message":"Overloaded"}}) · Retrying in 36 seconds… (attempt 9/10)
webdevtodayjason · 1 year ago

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.42: tool_use ids were found
without tool_result blocks immediately after: toolu_01T4rbEocUEcU3L1i8PmXfFF. Each tool_use block must have a corresponding
tool_result block in the next message."}}

owen109 · 1 year ago

Same issue here, just started happening

LeFrenchie · 1 year ago

Same here :
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.93: tool_use ids were
found without tool_result blocks immediately after: toolu_011ENGhpjqmGzx2brsmEzm9C. Each tool_use block must
have a corresponding tool_result block in the next message."}}

jasonmadigan · 1 year ago

Seeing this with 1.0.53

jsykesdev · 12 months ago

I upgraded to Max and almost immediately starting seeing this today. Completely stuck.

ivan-velikanov · 12 months ago

I got auto upgraded to 1.0.55 started seing this error. Tried esc esc a couple of times, it did not work/mitigate the issue.

Edit: mitigation found. i exported the chat (/export), and then cleared (/clear) the chat, exited and restarted. and then i loaded the exported file, and it was able to resume.

delikat · 12 months ago

seeing this constantly on v1.0.55. accessing models through Bedrock

amin24e · 12 months ago
/export

this worked for me

SM-Fahim · 11 months ago

this seems to be an issue with how claude code calls different tools. I tried various solutions nothing worked. then broke the prompt into two steps and it worked.
Mine had a step to read a pdf where it was throwing the error. So I asked to read the pdf only, do nothing else. it did. then asked to do the rest of the tasks. This worked.

earvinpiamonte · 11 months ago
this seems to be an issue with how claude code calls different tools. I tried various solutions nothing worked. then broke the prompt into two steps and it worked. Mine had a step to read a pdf where it was throwing the error. So I asked to read the pdf only, do nothing else. it did. then asked to do the rest of the tasks. This worked.

This worked for me. I'm working on two PDFs when I hit the Error 400. I asked CC to read the PDFs one by one. No errors thrown. Both PDFs are around 700 KB.

Calderic · 11 months ago

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"messages.46: tool_use ids were found without tool_result
blocks immediately after: toolu_01JziDqf9NcYUugm1fc1daKD. Each
tool_use block must have a corresponding tool_result block in the
next message."}}

Version 1.0.62 still has this issue, and I would waste tokens by going back to the context.

isaaclxy · 11 months ago
u there?

⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.62:
tool_use ids were found without tool_result blocks immediately after:
toolu_01WJKPLGyEY1QkoU9iYURBPB. Each tool_use block must have a corresponding
tool_result block in the next message."}}

Version 1.0.65 - got this after working with claude for a long time (4-5 compacts despite use of subagents)

pro-vi · 11 months ago

Best way around this is to double press ESC and return to a previous checkpoint where the error hasn't shown up. Keep going back until it works.

StuMason · 11 months ago
Best way around this is to double press ESC and return to a previous checkpoint where the error hasn't shown up. Keep going back until it works.

this "fixed" it for me, thanks @pro-vi

AzyCrw4282 · 11 months ago

skipping contexts and going back doesnt work either. i suspect if its on the same session then you will be getting the same error.

testacode · 11 months ago

<img width="882" height="402" alt="Image" src="https://github.com/user-attachments/assets/2e4e0680-6b59-468c-9f13-d85174623090" />still happening

iraghavdotc · 11 months ago

⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.26:
tool_use ids were found without tool_result blocks immediately after:
toolu_01WCJ9UZqgL4CG8n2LDBp6gt. Each tool_use block must have a corresponding tool_result block
in the next message."}}

SVWebo · 11 months ago

> /clear

/export then /clear then dump the text file into Claude Code..

Worked for me. Thanks.

helLf1nGer · 11 months ago
> /clear /export then /clear then dump the text file into Claude Code.. Worked for me. Thanks.

This works well, thanks

dwenaus · 11 months ago

This happens to me in a very specific context. I built a PostToolUse hook that injects context right after reading a file (Read operation feedback:...), often claude reads many files quickly in succession. in these cases, the error can sometimes occur, not always. An example: 10 files are read in quick succession, this fires off 10 hooks to a separate tool, let's say read #5 returns some context to inject into claude, but at the same time claude is still processing the others. The API error occurs.

igorkofman collaborator · 11 months ago

Thanks for the report @Deryk - this should be fixed in tomorrow's build.
We've also recently rolled out a change that addresses this error being
triggered by transient network errors. I've seens the rate of these errors
drop dramatically with v1.0.83+ but are continuing to monitor.

On Mon, Aug 18, 2025 at 7:19 PM Deryk Wenaus @.***>
wrote:

dwenaus left a comment (anthropics/claude-code#1894) <https://github.com/anthropics/claude-code/issues/1894#issuecomment-3198990722> This happens to me in a very specific context. I built a PostToolUse hook that injects context right after reading a file (Read operation feedback:...), often claude reads many files quickly in succession. in these cases, the error can sometimes occur, not always. An example: 10 files are read in quick succession, this fires off 10 hooks to a separate tool, let's say read #5 <https://github.com/anthropics/claude-code/issues/5> returns some context to inject into claude, but at the same time claude is still processing the others. The API error occurs. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/1894#issuecomment-3198990722>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AADSWQQOMCNWWUI5TQ6JZ6D3OKCSFAVCNFSM6AAAAAB677MV3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOJYHE4TANZSGI> . You are receiving this because you were mentioned.Message ID: @.***>
AndyLue · 11 months ago

restart ,and fine

gbanick · 10 months ago

New install/ new account 3 messages in and got

version = 1.0.90 (Claude Code)

 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_01EiVsiFbEUjkXEEiAQwhcnB. Each tool_use block must have a corresponding tool_result block in the next message."},"request_id":"req_011CSTdjKmarmCxXw14UHiZC"}

elAndyG · 10 months ago

i was able to get it to trigger by running /context mid process to see the context blocks, then, when it was done "noodling" it happened.

BartVB · 10 months ago

Same here. v1.0.90 via Homebrew. Here it also b0rked right after I ran '/context'.

auxvirtua · 10 months ago

This occurred for me when I ran into my 5 hour limit, upgraded from Pro to Max and returned to Claude Code. Restarting Visual Studio Code fixed the issue.

ldorigo · 10 months ago

This still happens for me as well. Often after reading one or more PDFs.

jodinathan · 10 months ago

happened while running task-master.

antonkoenig · 10 months ago

It happened very early. I started claude, started a task and then the hint about /memory showed up. I looked at the /memory options, while it was working on a task. Then I pressed the "esc" key. It canceled both, the task and the /memory dialog. Then it was stuck in this state. Pressing "esc" twice and forking the conversation did not work. A new claude session works.

github-actions[bot] · 10 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.