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

Resolved 💬 14 comments Opened Jan 25, 2026 by ChrisKader Closed Jan 25, 2026

Bug Description
I keep getting "If an assistant message contains any thinking
blocks, the first block must be thinking or redacted_thinking. Found text." errors.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.19
  • Feedback ID: 74a044d8-6cbf-4c5b-881a-3ae9836f777a

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-24T23:37:16.579Z"},{"error":"MaxFileReadTokenExceededError: File content (35585 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at wPB (/$bunfs/root/claude:3890:3052)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T23:38:15.259Z"},{"error":"MaxFileReadTokenExceededError: File content (35334 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at wPB (/$bunfs/root/claude:3890:3052)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T23:38:22.597Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.0.type: Expected `thinking` or `redacted_thinking`, but found `tool_use`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking\"},\"request_id\":\"req_011CXT6Qq3gHBhgeyNNaJrdp\"}\n    at generate (/$bunfs/root/claude:144:37450)\n    at makeRequest (/$bunfs/root/claude:161:5435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T23:46:08.649Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.15.content.0: If an assistant message contains any thinking blocks, the first block must be `thinking` or `redacted_thinking`. Found `text`.\"},\"request_id\":\"req_011CXT6bXsccATyzbGcbFBhr\"}\n    at generate (/$bunfs/root/claude:144:37450)\n    at makeRequest (/$bunfs/root/claude:161:5435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T23:48:33.788Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.19.content.0: If an assistant message contains any thinking blocks, the first block must be `thinking` or `redacted_thinking`. Found `text`.\"},\"request_id\":\"req_011CXT6jmDGcdeP8DEFJ3pYL\"}\n    at generate (/$bunfs/root/claude:144:37450)\n    at makeRequest (/$bunfs/root/claude:161:5435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T23:50:25.441Z"},{"error":"Error: Marketplace 'everything-claude-code' is already installed. Please remove it first using '/plugin marketplace remove everything-claude-code' if you want to re-install it.\n    at Xw (/$bunfs/root/claude:812:181)\n    at async <anonymous> (/$bunfs/root/claude:4227:45216)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-01-24T23:53:22.098Z"},{"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-24T23:53:46.503Z"},{"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 (/…

Note: Content was truncated.

View original on GitHub ↗

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