[BUG] Thinking mode 400 error on FIRST tool call in brand new conversation (Opus 4.5)
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?
This is NOT a long-conversation or auto-compact issue. The thinking block error occurs on the very first tool call in a brand new conversation — making thinking mode completely unusable.
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\`."}}
Steps to Reproduce
- Open Claude Code with Opus 4.5 model
- Enable thinking mode (Tab key)
- Send any message that triggers a tool call (e.g. "check my claude version")
- Claude responds with thinking + text + tool_use (first turn works)
- After the tool result returns, Claude tries to respond again → 400 error
This is 100% reproducible. Every single new conversation breaks after the first tool call when thinking is enabled.
Key Difference from Other Issues
Most reported thinking block issues (#12311, #20714, etc.) occur in long conversations or during auto-compact. This issue is different:
- Happens in a brand new conversation (not resume, not long session)
- Fails at
messages.1(the first assistant message) — not messages.33 or messages.125 - Triggers on the first tool call — no compaction involved
- 100% reproducible, not intermittent
This suggests the client is not properly preserving/ordering thinking blocks when constructing the second API request after a tool call, even in the simplest case.
What I've Tried
- Downgrading from v2.1.19 to v2.1.14 — same error
- Removing native install, using npm only — same error
- Running without environment variables (clean
claude --dangerously-skip-permissions) — same error - Disabling
alwaysThinkingEnabledin settings — same error (Tab-toggled thinking still breaks) - Starting fresh conversations with
/exit— same error on every new conversation
Only workaround: Not enabling thinking mode at all. With thinking disabled, everything works fine.
Environment
- Claude Code version: 2.1.19 (also tested 2.1.14)
- Model: claude-opus-4-5-20251101 (Opus 4.5) via Claude Max
- OS: macOS 15.7.2 (arm64, Apple Silicon)
- Node.js: v25.2.1
- npm: 11.6.2
- Installation: npm global (
/opt/homebrew/bin/claude)
Expected Behavior
Thinking mode should work across multi-turn conversations with tool calls without corrupting thinking block ordering.
Actual Behavior
The client fails to preserve thinking block ordering in assistant messages when constructing the follow-up API request after a tool result, causing a 400 error on every conversation where thinking is enabled and a tool is called.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗