CLI State Corruption After Unexpected Interruption

Resolved 💬 3 comments Opened Jul 27, 2025 by kraln Closed Aug 15, 2025

Bug Description
Interrupted and got into a bad state--only 400s and no way to recover.

Environment Info

  • Platform: linux
  • Terminal: konsole
  • Version: 1.0.61
  • Feedback ID: f9ed41a6-451c-49dd-8f25-0fdb3bc7a897

Errors

[{"error":"Error: Command failed: ps aux | grep -E \"code|cursor|windsurf|idea|pycharm|webstorm|phpstorm|rubymine|clion|goland|rider|datagrip|dataspell|aqua|gateway|fleet|android-studio\" | grep -v grep\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:924:11)\n    at execSync (node:child_process:996:15)\n    at i7 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:865:5106)\n    at St (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1346:2366)\n    at file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1876:7273\n    at async file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1877:1485\n    at async Promise.all (index 12)\n    at async Jw0 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1877:1444)","timestamp":"2025-07-27T06:00:28.584Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.26: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_018hA8vLcC5Y3dsy5wxAqVXS. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at i4.generate (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1317:7796)\n    at DP.makeStatusError (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1334:2101)\n    at DP.makeRequest (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1334:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async UvB.kG1.showErrors (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:14365)\n    at async kG1 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2345:5642)\n    at async UvB (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:14216)\n    at async file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:9271\n    at async bL0 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:1690)\n    at async ne (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:9241)","timestamp":"2025-07-27T06:00:37.585Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.26: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_018hA8vLcC5Y3dsy5wxAqVXS. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at i4.generate (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1317:7796)\n    at DP.makeStatusError (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1334:2101)\n    at DP.makeRequest (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1334:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async UvB.kG1.showErrors (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:14365)\n    at async kG1 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2345:5642)\n    at async UvB (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:14216)\n    at async file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:9271\n    at async bL0 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:1690)\n    at async ne (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2902:9241)","timestamp":"2025-07-27T06:00:57.860Z"},{"error":"Error: 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_018hA8vLcC5Y3dsy5wxAqVXS. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at Qx1 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1818:1355)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1818:6138)\n    at async mX8 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2538:58)\n    at async uX8 (file:///home/jeff/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2528:3307)\n    at async K01 (file:///home/jeff/.claude/local/node_m

Note: Error logs were truncated.

View original on GitHub ↗

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