Missing Tool Result Block in Claude Code API Request

Resolved 💬 2 comments Opened Jun 11, 2025 by ohqay Closed Jun 11, 2025

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

Getting this error when trying to send a basic message to Claude Code. Context: I was working on this project a few days ago, came back today and updated Claude Code via npm i -g @anthropic-ai/claude-code, ran claude --continue, and attempted to send a message. The error occurred consistently on multiple attempts. I'm on Claude Max ($200 plan) which is what I use for Claude Code access. It's been a few days since I used claude code so this is definitely not a rate limit issue.

!Image

Environment Info

  • Platform: macos
  • Terminal: tmux
  • Version: 1.0.19
  • Feedback ID: 398b7b55-2534-4ee4-bb2c-bb7ee3efdc3a

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at VZ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:659:3921)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11795\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n    at rJ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10941)\n    at QS (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10022)\n    at R6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:14134)","timestamp":"2025-06-11T21:34:36.705Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.113: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01Y1n5eWKMq86btpFwtY3Z7V. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at g6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1325:12578)\n    at Nw.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1340:2082)\n    at Nw.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1340:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Q11.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:21088)\n    at async Q11 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:12198)\n    at async kw2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:20934)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17098\n    at async eo1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:5146)\n    at async td (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17068)","timestamp":"2025-06-11T21:36:05.867Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.113: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01Y1n5eWKMq86btpFwtY3Z7V. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at g6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1325:12578)\n    at Nw.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1340:2082)\n    at Nw.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1340:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Q11.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:21088)\n    at async Q11 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:12198)\n    at async kw2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:20934)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17098\n    at async eo1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:5146)\n    at async td (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1668:17068)","timestamp":"2025-06-11T21:36:36.866Z"}]

View original on GitHub ↗

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