[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.
14 Comments
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.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Possible duplicates are old, the current issue seems to be global and not limited to these older incidents
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:
What to do:
redacted/11793834-754d-4be9-846d-16e448aae4d3.jsonlfor details as neededWould you like to restart with a smaller batch of recommendations?
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.
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 @fileand it'll fail.Is Anthropic deploying on Saturdays? 👀 Because like, ~30 mins ago Claude (Code) was working just fine.
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.
I agree. First time I have used it today. Yesterday it seemed fine.
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.
Based on the number of issues "duplicate" being opened after this one, I would say its definitely not a one off.
Going to close this one as https://github.com/anthropics/claude-code/issues/20692 is much more detailed
@ChrisKader Did you link the wrong issue?
Edit, yep correct ID is #20692
Not sure if it matters but fixed! Thank you!
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.