[Bug] Anthropic API Error: Missing corresponding tool_use block for tool_result

Resolved 💬 2 comments Opened Jan 25, 2026 by dkreth Closed Mar 1, 2026

Possible Duplicate

I was able to find the following existing bug tickets with the same error message, but they were all on Claude Code version 2.0.76 so thinking this might be a regression of a previously-patched rather than a new bug? I'm on Claude Code version 2.1.19. Feel free to close this as a dupe if it is one.

Open similar bug tickets:

Bug Description

I'm getting the below 400 error when using Claude Code. I had just resumed a forked conversation. Unlike the other existing issues, I haven't performed any context compaction in this session, though I did have it summarize my session in a notes file.

Starting claude code in a new session works fine.

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.84.content.0: unexpected `tool_use_id` found in `tool_result` blocks: toolu_01LhcYGyJiyRymRAPWeoAauC. Each `tool_result`
    block must have a corresponding `tool_use` block in the previous message."},"request_id":"req_011CXUjASgSSfNRJZofrp1GZ"}

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.19
  • Feedback ID: 7c935ff4-8cd2-47b2-8fdf-7b5bfc104d6f

Errors

[{"error":"Error: ENOENT: no such file or directory, scandir '/Library/Application Support/ClaudeCode/.claude/skills'\n    at readdirSync (unknown)\n    at <anonymous> (/$bunfs/root/claude:12:1903)\n    at mW (/$bunfs/root/claude:11:35435)\n    at readdirSync (/$bunfs/root/claude:12:1864)\n    at ILR (/$bunfs/root/claude:2215:380)\n    at ILR (/$bunfs/root/claude:2215:1350)\n    at <anonymous> (/$bunfs/root/claude:2215:4440)\n    at <anonymous> (/$bunfs/root/claude:2215:5171)\n    at A (/$bunfs/root/claude:11:7259)\n    at FZ8 (/$bunfs/root/claude:4862:4342)","timestamp":"2026-01-24T20:01:08.943Z"},{"error":"Error: ENOENT: no such file or directory, scandir '/Users/<username>/.claude/skills'\n    at readdirSync (unknown)\n    at <anonymous> (/$bunfs/root/claude:12:1903)\n    at mW (/$bunfs/root/claude:11:35435)\n    at readdirSync (/$bunfs/root/claude:12:1864)\n    at ILR (/$bunfs/root/claude:2215:380)\n    at ILR (/$bunfs/root/claude:2215:1350)\n    at <anonymous> (/$bunfs/root/claude:2215:4483)\n    at <anonymous> (/$bunfs/root/claude:2215:5171)\n    at A (/$bunfs/root/claude:11:7259)\n    at FZ8 (/$bunfs/root/claude:4862:4342)","timestamp":"2026-01-24T20:01:08.943Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/<username>/.local/share/claude/versions/2.1.19 (expected in multi-process scenarios)\n    at BUR (/$bunfs/root/claude:4003:2091)\n    at YkA (/$bunfs/root/claude:4003:1202)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T20:01:08.957Z"},{"error":"Error: Failed to fetch version from https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/latest: ECONNREFUSED\n    at UW8 (/$bunfs/root/claude:4001:4064)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T21:10:25.238Z"},{"error":"Error: Failed to fetch version from https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases/latest: ECONNREFUSED\n    at UW8 (/$bunfs/root/claude:4001:4064)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T21:10:25.245Z"},{"error":"Error: 1P event logging: 3 events failed to export\n    at queueFailedEvents (/$bunfs/root/claude:639:2077)\n    at async doExport (/$bunfs/root/claude:639:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T21:10:26.812Z"},{"error":"Error: {\"message\":\"Failed to export 3 events\",\"originalLine\":\"639\",\"originalColumn\":\"1336\",\"line\":\"639\",\"column\":\"1336\",\"sourceURL\":\"/$bunfs/root/claude\",\"stack\":\"Error: Failed to export 3 events\\n    at doExport (/$bunfs/root/claude:639:1336)\\n    at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n    at error (/$bunfs/root/claude:1791:25028)\n    at <anonymous> (/$bunfs/root/claude:633:34987)\n    at iMD (/$bunfs/root/claude:633:35531)\n    at <anonymous> (/$bunfs/root/claude:634:17366)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T21:10:26.812Z"},{"error":"Error: Request was aborted.\n    at ZQR (/$bunfs/root/claude:1817:44939)\n    at _rB (/$bunfs/root/claude:5158:1535)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T21:32:13.300Z"},{"error":"AbortError: The operation was aborted.\n    at unknown\n    at abortChildProcess (node:child_process:935:42)\n    at onAbortListener2 (node:child_process:35:24)\n    at abort (unknown)\n    at <anonymous> (/$bunfs/root/claude:5244:2153)","timestamp":"2026-01-25T19:53:53.161Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/claude:161:3940)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-25T20:01:59.941Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.84.content.0: unexpected `tool_use_id` found in `tool_result` blocks: toolu_01LhcYGyJiyRymRAPWeoAauC. Each `tool_result` block must have a corresponding `tool_use` block in the previous…

Note: Content was truncated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗