API Error 400: thinking blocks order error on first tool use after clean install

Open 💬 45 comments Opened Jan 25, 2026 by Dixter999

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code throws API Error 400 immediately after ANY tool completes execution, even on a completely fresh install with all cache/config deleted.

Error message:

{"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0: If an assistant message contains any thinking blocks, the first block must be 'thinking' or 'redacted_thinking'. Found 'text'."}}

This happens on EVERY tool use - Bash, Search, Read, etc. The tool executes successfully but the response synthesis fails.

What Should Happen?

Claude Code should successfully process tool results and continue the conversation normally.

Error Messages/Logs

API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0: If an assistant message contains any thinking blocks, the first block must be 'thinking' or 'redacted_thinking'. Found 'text'."},"request_id":"req_011CXT8hZtKJJcTCAUi2eqLJ"}

Steps to Reproduce

  1. Clean install: claude install stable
  2. Delete ALL config:
   rm -rf ~/.claude/cache ~/.claude/debug ~/.claude/projects ~/.claude/todos
   rm -rf ~/.claude/session-env ~/.claude/statsig
   rm -f ~/.claude/settings.json ~/.claude/history.jsonl
  1. Start Claude Code: cd /any/directory && claude
  2. Type simple query: "What files are in this directory?"
  3. Bash tool runs ls successfully
  4. API Error 400 occurs when synthesizing response

Minimal reproduction - no special files or configuration needed.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown - worked earlier today (2026-01-25) before multiple Explore agents were used

Claude Code Version

2.1.7 (Claude Code) - also tested with 2.1.19

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

Timeline:

  1. Claude Code was working normally
  2. Asked complex question that triggered parallel Explore agents
  3. Explore agents completed successfully
  4. Error occurred during "Swooping" (result synthesis)
  5. Error now persists on ALL subsequent sessions, even after:
  • Deleting conversation history
  • Clean reinstall (both stable and latest)
  • Deleting ALL ~/.claude config except credentials
  • Different projects/directories
  • Simple queries without images

Hypothesis: Something in the account/server state got corrupted during the parallel agent session. The error persists across clean installs, suggesting server-side state issue.

View original on GitHub ↗

45 Comments

Manavk2004 · 5 months ago

Same here

dcurran90 · 5 months ago

+1 on this. getting the same thing and it started within the last hour

dsolis-deloryx · 5 months ago

+1

chiefGui · 5 months ago

+1

github-actions[bot] · 5 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/20691
  2. https://github.com/anthropics/claude-code/issues/20689

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

ChrisKader · 5 months ago

to be honest, this is a much better and more detaield issue then mine. https://github.com/anthropics/claude-code/issues/20689

I can close mine and we can continue to pursue it here if that works.

ChrisKader · 5 months ago

Same issue:

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

bradautomates · 5 months ago

Same issue

PassivePicasso · 5 months ago

Also experiencing the same issue via Claude Code for VS Code

ChrisKader · 5 months ago

<img width="913" height="177" alt="Image" src="https://github.com/user-attachments/assets/dd705027-d063-4cf9-bf54-1b4f05c40277" />

Related?

ninjaplans · 5 months ago

Same issue here. Claude Code v2.1.19, macOS, Claude Max (Opus 4.5). Error occurs after tool use completes (e.g., 27 tool uses, 87.5k tokens). Fresh install and cache clearing didn't help.

qzzou · 5 months ago

same issue. started today. CC v2.1.19 macOS, claude max opus. tried /clear and restart CLI. stop at my first prompt which is asking it to read a md file

Read(setup.md)
⎿  Read 20 lines
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0: If an
assistant message contains any thinking blocks, the first block must be thinking or redacted_thinking. Found
text."},"request_id":"req_011CXT8mjjFw7VwsDcDyTQ71"}

mattolson · 5 months ago

I'm getting the same. Just started about 15 minutes ago.

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.17.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. 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_011CXTCprBFh3zECAtZHyC4f"}

Claude says:

Looks like there's a persistent API issue with thinking blocks in the conversation history. That's not something I can fix from my side - it's related to how the client is
  constructing the API messages.

This is happening consistently with Opus 4.5 thinking on v2.1.19 on Linux.

felixDulys · 5 months ago

same issue.

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0: If an assistant message contains any thinking
     blocks, the first block must be `thinking` or `redacted_thinking`. Found `text`."},"request_id":"req_011CXT7C2gffSy6TJrsgWVeV"} 

MacOS Sequoia 15.6.1
Claude code in CLI 2.1.19

ChrisKader · 5 months ago

Disabling "Thinking" in /config seems to help with the error though you loose the "benefits" of Thinking.

marcel · 5 months ago

This is also happening to me without fail.

Downgrading from 2.1.19 to 2.1.15 did not fix the issue, suggesting it is not a CLI issue.

felixDulys · 5 months ago
Disabling "Thinking" in /config seems to help with the error though you loose the "benefits" of Thinking.

Can confirm in my case that disabling thinking in the same chat without clearing context stopped the error.
MacOS Sequoia 15.6.1
Claude code in CLI 2.1.19

chiefGui · 5 months ago

Yep, disabling thinking in /config "fixed" it, but you can feel the difference.

_More concerning than the issue itself, is the realization of how weird it is of not having Claude around, lol._

ChrisKader · 5 months ago
Yep, disabling thinking in /config "fixed" it, but you can feel the difference. _More concerning than the issue itself, is the realization of how weird it is of not having Claude around, lol._

I agree. I am also unsure how the claude cli got to a point where it does not implement the claude api correctly... even with plugins disabled I had the error.

nathandcornell · 5 months ago

Has been happening to me all afternoon. Also tried a fresh install, etc, but no luck

poisons77 · 5 months ago

Same here. Downgrading doesn't resolve the issue.
The only thing that works is disabling thinking in the /config but not really a solution.

kgNatx · 5 months ago

is it possible this is some backend side issue?
---
Environment:

  • Claude Code version: 2.1.19 (also reproduced on 2.1.18)
  • OS: Ubuntu 24 (6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux)
  • Install method: native
  • Account type: MAX

Error message:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.0: If an assistant message contains any thinking blocks, the first block must be `thinking` or `redacted_thinking`. Found `text`."}}

Reproduction steps:

  1. Start claude in any project (fresh or existing)
  2. Complete 1-2 simple tasks successfully
  3. Attempt a more complex task (e.g., creating files, multi-step work)
  4. Error appears, persists for rest of session

Troubleshooting attempted:

  • Cleared project-level .claude/ folder
  • Cleared global ~/.claude/ and ~/.claude.json
  • Re-authenticated
  • Reinstalled Claude Code
  • Tested on fresh /tmp project
  • Downgraded to 2.1.18

Notes:

  • Specific to Opus 4.5 (Sonnet works)
  • Occurs consistently after extended thinking engages
ChrisKader · 5 months ago

I am surprised the status.claude.ai is not showing errors.

poisons77 · 5 months ago

Now the error message suggest to disable thinking, so probably they are already aware and working on it
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.17.content.0.type: Expected thinking or redacted_thinking, but found text. 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"}

jaybutera · 5 months ago
Now the error message suggest to disable thinking, so probably they are already aware and working on it API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.17.content.0.type: Expected thinking or redacted_thinking, but found text. 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"}

Probably Claude, its a Saturday.

poisons77 · 5 months ago

Anyway, if you don't want to disable thinking, just keep prompting "Continue" the error doesn't seem to be systematic, so it can do a part of work, and then interrupt again. It is annoying but if you need to work with thinking activated this is the only solution at the moment.

ChrisKader · 5 months ago
Anyway, if you don't want to disable thinking, just keep prompting "Continue" the error doesn't seem to be systematic, so it can do a part of work, and then interrupt again. It is annoying but if you need to work with thinking activated this is the only solution at the moment.

Yea, I did this for a bit and burned through usage very quickly because a lot of work has to be "redone" just for it to fail again.

cafferychen777 · 5 months ago

Same issue here. This is clearly a regression that started today (Jan 25) — multiple issues (#20691, #20698, #20711, #20717, #20725, #20726) all reported within hours. The thinking block ordering bug affects everyone using thinking mode with tool calls. Please upvote and comment to help get this prioritized!

Shawn-L23 · 5 months ago

same here

poisons77 · 5 months ago

Another workaround is to use agents, it seems they are not affected by the bug.. It seems only the main claude get the error after using tools.

rishabhpoddar · 5 months ago

Seeing this error as well. Version 2.1.19

poisons77 · 5 months ago

It seems the bug has been solved.

ChrisKader · 5 months ago

what is the "oncall" tag for?

cafferychen777 · 5 months ago

Update: The issue appears to be fixed now! 🎉

Just tested extensively with thinking mode enabled (Opus 4.5) — 20+ consecutive tool calls including parallel operations, Task agents, WebSearch, file reads, Bash commands, etc. All succeeded without any 400 errors.

This likely relates to the Jan 22-23 incident on status.claude.com: "Elevated errors: Invalid signature in thinking block" which was marked resolved.

Can others please test and confirm if it's working for you now?

ChrisKader · 5 months ago
Update: The issue appears to be fixed now! 🎉 Just tested extensively with thinking mode enabled (Opus 4.5) — 20+ consecutive tool calls including parallel operations, Task agents, WebSearch, file reads, Bash commands, etc. All succeeded without any 400 errors. This likely relates to the Jan 22-23 incident on status.claude.com: "Elevated errors: Invalid signature in thinking block" which was marked resolved. Can others please test and confirm if it's working for you now?

Testing so far has been error free.

PassivePicasso · 5 months ago

Can also confirm, seems things are working normally again.

felixDulys · 5 months ago

I am no longer having the issue -- was able to visit the same chats that consistently returned errors and could "continue" them with thinking mode on with no error message.

jesperordrup · 5 months ago

Confirmed. It started 16 hours ago.

Version 2.1.19
Ubuntu 24
Installed w wget (not NPM)
Model: opus

I downgraded to 2.1.17 but didn't help
I removed all configs and tried in a new folder. Didn't help.

Using claude with --permission-mode=bypassPermissions -p

bettimms · 5 months ago

Got this very frequently today.

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.7.content.24: Invalid signature in thinking claude code

MacOS Sequoia 15.7.3.
VS Code extension: v2.1.22

ryanmish · 5 months ago

I am getting this often today:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.11.content.21: thinking or redacted_thinking blocks in
the latest assistant message cannot be modified. These blocks must remain as they were in the original
response."},"request_id":"req_011CXjtBS9aLM6ZHhKFVbYig"}

When reading files or using subagents...

bettimms · 5 months ago
I am getting this often today: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.11.content.21: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CXjtBS9aLM6ZHhKFVbYig"} When reading files or using subagents...

Looks like when using subagents.

ron-zhong · 3 months ago

We are also getting this today:

API Error: 400 {"detail":{"error":"{"message":"messages.1.content.0.type: Expected thinking or redacted_thinking, but found text. 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://platform.claude.com/docs/en/build-with-claude/extended-thinking

  • Claude Code VS Code extension: v2.1.87
  • LLM: AWS Bedrock Claude Sonnet 4
  • OS: Ubuntu 24.04.4 LTS
emaysyuk · 3 months ago

I get the same error:

API Error: 400 messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. 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

Claude Code Native 2.1.110

2+2 works fine though, seems like only thinking doesn't work:

<img width="3456" height="434" alt="Image" src="https://github.com/user-attachments/assets/334d1241-2753-466d-afee-cb1e0bf48810" />

emaysyuk · 3 months ago

The workaround that worked for me was to downgrade version to 2.1.86:
curl -fsSL https://claude.ai/install.sh | bash -s 2.1.86

kmadejek-samsung · 2 months ago

I have the exact same problem today (Apr 23).

  • Claude Code: 2.1.118, thinking mode enabled.
  • Ubuntu 24.04.4 LTS.
  • Problem occurs regardless of whether CC is used in VS Code or directly in bash.

----

I was tinkering with Bedrock configuration for an hour, no effect.

Downgrade to 2.1.86 as suggested by @emaysyuk is a viable workaround, problem goes away.
Edit: Even after downgrade, problem still persists when Claude Code is used from VS Code GUI.