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

Status Fixed / completed
Reported on v2.1.19
Maintainer reply None cached
Activity 14 comments · opened Jan 25, 2026 · 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 ↗

14 Comments

chiefGui · 7 months ago

Yeah. Same thing here. It just started happening. I have the Max Ultra Pro Megazord Something plan fwiw. It seems to be happening with whatever tool call.

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/13669
  2. https://github.com/anthropics/claude-code/issues/19116
  3. https://github.com/anthropics/claude-code/issues/8677

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

PassivePicasso · 7 months ago

Possible duplicates are old, the current issue seems to be global and not limited to these older incidents

ChrisKader · 7 months ago

I get this when I ask claude why we keep getting this error:

API Error 400 ("Bad Request") in Claude Code typically means the request payload is too large for the API - usually because the conversation context has grown beyond the model's token limit.

In this case, the likely cause is:

  1. The implementation plan is very large - your prompt contains a detailed 9-recommendation plan with extensive code snippets
  2. The exploration agent returned a lot of content - the codebase summary added significant context
  3. Combined, these push the conversation close to or over the context limit

What to do:

  • Start a fresh conversation and tackle the recommendations in smaller batches (e.g., Recommendations 1-3, then 4-6, then 7-9)
  • Alternatively, condense the plan to just the recommendation numbers/titles and let me read the plan file at

redacted/11793834-754d-4be9-846d-16e448aae4d3.jsonl for details as needed

  • Avoid having large exploration results returned inline when you also have a large prompt

Would you like to restart with a smaller batch of recommendations?

ChrisKader · 7 months ago

This is a result of me telling claude to implement a plan, albiet a rather large one, that was created by claude in the same context.

chiefGui · 7 months ago

For context: this is happening on both 2.1.15 and now, after I updated it to 2.1.19, same error. Also happens with clean conversations, etc. Whenever it runs a tool call, things spiral. One can even prompt Hey Claude read this file @file and it'll fail.

Is Anthropic deploying on Saturdays? 👀 Because like, ~30 mins ago Claude (Code) was working just fine.

ChrisKader · 7 months ago

Closing claude (cli) and starting it again and providing 1 recommendation (copy/paste from 1 of the 9 in the orignal plan) results in the same rror.

ChrisKader · 7 months ago
For context: this is happening on both 2.1.15 and now, after I updated it to 2.1.19, same error. Also happens with clean conversations, etc. Whenever it runs a tool call, things spiral. One can even prompt Hey Claude read this file @file and it'll fail. Is Anthropic deploying on Saturdays? 👀 Because like, ~30 mins ago Claude (Code) was working just fine.

I agree. First time I have used it today. Yesterday it seemed fine.

ChrisKader · 7 months ago

Wild. Blew through so much usage over the last week or so on pro. upgraded to max ($100) and still feels "meh". Then when I try to get some kind of "compensation" for usage issues clearly related to bugs within claude code, I get met with silence.

ChrisKader · 7 months ago

Based on the number of issues "duplicate" being opened after this one, I would say its definitely not a one off.

ChrisKader · 7 months ago

Going to close this one as https://github.com/anthropics/claude-code/issues/20692 is much more detailed

PassivePicasso · 7 months ago

@ChrisKader Did you link the wrong issue?

Edit, yep correct ID is #20692

ChrisKader · 7 months ago

Not sure if it matters but fixed! Thank you!

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.