API Error 400: thinking blocks order error on first tool use after clean install
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
- Clean install:
claude install stable - 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
- Start Claude Code:
cd /any/directory && claude - Type simple query: "What files are in this directory?"
- Bash tool runs
lssuccessfully - 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:
- Claude Code was working normally
- Asked complex question that triggered parallel Explore agents
- Explore agents completed successfully
- Error occurred during "Swooping" (result synthesis)
- 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.
45 Comments
Same here
+1 on this. getting the same thing and it started within the last hour
+1
+1
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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.
Same issue:
Platform: darwin
Terminal: Apple_Terminal
Version: 2.1.19
Feedback ID: 74a044d8-6cbf-4c5b-881a-3ae9836f777a
Same issue
Also experiencing the same issue via Claude Code for VS Code
<img width="913" height="177" alt="Image" src="https://github.com/user-attachments/assets/dd705027-d063-4cf9-bf54-1b4f05c40277" />
Related?
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.
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
thinkingorredacted_thinking. Foundtext."},"request_id":"req_011CXT8mjjFw7VwsDcDyTQ71"}I'm getting the same. Just started about 15 minutes ago.
Claude says:
This is happening consistently with Opus 4.5 thinking on v2.1.19 on Linux.
same issue.
MacOS Sequoia 15.6.1
Claude code in CLI 2.1.19
Disabling "Thinking" in
/configseems to help with the error though you loose the "benefits" of Thinking.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.
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
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.
Has been happening to me all afternoon. Also tried a fresh install, etc, but no luck
Same here. Downgrading doesn't resolve the issue.
The only thing that works is disabling thinking in the /config but not really a solution.
is it possible this is some backend side issue?
---
Environment:
Error message:
Reproduction steps:
claudein any project (fresh or existing)Troubleshooting attempted:
.claude/folder~/.claude/and~/.claude.json/tmpprojectNotes:
I am surprised the status.claude.ai is not showing errors.
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
thinkingorredacted_thinking, but foundtext. Whenthinkingis enabled, a finalassistantmessage must start with a thinking block (preceeding the lastmost set oftool_useandtool_resultblocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disablethinking. Please consult our documentation athttps://docs.claude.com/en/docs/build-with-claude/extended-thinking"}
Probably Claude, its a Saturday.
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.
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!
same here
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.
Seeing this error as well. Version 2.1.19
It seems the bug has been solved.
what is the "oncall" tag for?
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.
Can also confirm, seems things are working normally again.
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.
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
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
I am getting this often today:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.11.content.21:
thinkingorredacted_thinkingblocks inthe 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.
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-thinkingI get the same error:
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" />
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.86I have the exact same problem today (Apr 23).
----
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.