[Bug] Anthropic API Error: Invalid message structure with thinking blocks

Resolved 💬 5 comments Opened Jan 25, 2026 by AmaxGuan Closed Mar 1, 2026

Bug Description
I got this error message for a whole day, which completely defeated the purpose of subscribing to the max plan for me. API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.0: If an assistant message contains any thinking blocks, the first block must be thinking or
redacted_thinking. Found text."},"request_id":"req_011CXTQVFwbC6qhzKPnpUPJk"}

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.19
  • Feedback ID: b1783a22-4570-442a-a9c5-190842257ab5

Errors

[{"error":"Error: ENOENT: no such file or directory, scandir '/Library/Application Support/ClaudeCode/.claude/skills'\n    at Module.readdirSync (node:fs:1584:26)\n    at file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:1766\n    at yO (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:35112)\n    at Object.readdirSync (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:1736)\n    at _D1 (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2284:369)\n    at file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2284:4279\n    at q (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:6814)\n    at CB2 (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4920:4362)\n    at file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4920:6961\n    at q (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:6814)","timestamp":"2026-01-25T03:37:25.107Z"},{"error":"Error: ENOENT: no such file or directory, scandir '/Users/lguan/.claude/skills'\n    at Module.readdirSync (node:fs:1584:26)\n    at file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:1766\n    at yO (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:35112)\n    at Object.readdirSync (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:1736)\n    at _D1 (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2284:369)\n    at file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2284:4322\n    at q (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:6814)\n    at CB2 (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4920:4362)\n    at file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4920:6961\n    at q (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:6814)","timestamp":"2026-01-25T03:37:25.107Z"},{"error":"Error: LSP server plugin:pyright-lsp:pyright crashed with exit code 1\n    at ChildProcess.<anonymous> (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2258:21508)\n    at ChildProcess.emit (node:events:518:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at ChildProcess._handle.onexit (node:internal/child_process:293:12)","timestamp":"2026-01-25T03:37:25.574Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.3.content.0: If an assistant message contains any thinking blocks, the first block must be `thinking` or `redacted_thinking`. Found `text`.\"},\"request_id\":\"req_011CXTQVFwbC6qhzKPnpUPJk\"}\n    at e7.generate (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:151:37402)\n    at PR.makeStatusError (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:168:2195)\n    at PR.makeRequest (file:///Users/lguan/.nvm/versions/node/v22.15.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:168:5420)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2026-01-25T03:43:11.439Z"}]

View original on GitHub ↗

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