Repository navigation
[Bug] Anthropic API Error: Invalid message format with thinking blocks #20691
Copy link
Copy link
Open
Labels
area:apibugSomething isn't workingSomething isn't workingplatform:macosIssue specifically occurs on macOSIssue specifically occurs on macOSstaleIssue is inactiveIssue is inactive
Description
Bug Description
cant use claude code constnatly getting ⏺ Read(docker/docker-bake.hcl)
⎿ Read 89 lines
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.0: If an
assistant message contains any thinking blocks, the first block must be thinking or
redacted_thinking. Found text."},"request_id":"req_011CXT8bUDaez2FNQumfnTPe"}
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.19
- Feedback ID: c0f6e016-cc3b-433a-b286-27c4f4c46282
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-25T00:13:23.635Z"},{"error":"Error: EACCES: permission denied, open '/nix/store/in0m73y8lbimzsvwkfy1q6ncivcshxlc-home-manager-files/.claude.json.tmp.51302.1769300003955'\n at writeFileSync (unknown)\n at BF (/$bunfs/root/claude:5244:631)\n at qoB (/$bunfs/root/claude:5244:5059)\n at DA (/$bunfs/root/claude:5244:2646)\n at Mz8 (/$bunfs/root/claude:6111:9765)\n at <anonymous> (/$bunfs/root/claude:6144:5321)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-25T00:13:23.955Z"},{"error":"Error: EACCES: permission denied, open '/nix/store/in0m73y8lbimzsvwkfy1q6ncivcshxlc-home-manager-files/.claude.json.tmp.51302.1769300004049'\n at writeFileSync (unknown)\n at BF (/$bunfs/root/claude:5244:631)\n at qoB (/$bunfs/root/claude:5244:5059)\n at B4 (/$bunfs/root/claude:5257:227)\n at SmB (/$bunfs/root/claude:4307:8674)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-25T00:13:24.049Z"},{"error":"Error: EACCES: permission denied, open '/nix/store/in0m73y8lbimzsvwkfy1q6ncivcshxlc-home-manager-files/.claude.json.tmp.51302.1769300010505'\n at writeFileSync (unknown)\n at BF (/$bunfs/root/claude:5244:631)\n at qoB (/$bunfs/root/claude:5244:5059)\n at DA (/$bunfs/root/claude:5244:2646)\n at <anonymous> (/$bunfs/root/claude:5940:7816)\n at SA (/$bunfs/root/claude:546:62518)\n at Ne (/$bunfs/root/claude:546:75470)\n at l2 (/$bunfs/root/claude:546:75354)\n at Ne (/$bunfs/root/claude:546:76254)\n at l2 (/$bunfs/root/claude:546:75354)","timestamp":"2026-01-25T00:13:30.505Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.5.content.0: If an assistant message contains any thinking blocks, the first block must be `thinking` or `redacted_thinking`. Found `text`.\"},\"request_id\":\"req_011CXT8bUDaez2FNQumfnTPe\"}\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-25T00:14:46.610Z"},{"error":"Error: EACCES: permission denied, open '/nix/store/in0m73y8lbimzsvwkfy1q6ncivcshxlc-home-manager-files/.claude.json.tmp.51302.1769300086635'\n at writeFileSync (unknown)\n at BF (/$bunfs/root/claude:5244:631)\n at qoB (/$bunfs/root/claude:5244:5059)\n at DA (/$bunfs/root/claude:5244:2646)\n at oV8 (/$bunfs/root/claude:5933:16798)\n at N_0 (/$bunfs/root/claude:5933:16921)\n at V_0 (/$bunfs/root/claude:5938:527)\n at <anonymous> (/$bunfs/root/claude:5938:52464)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-25T00:14:46.635Z"},{"error":"Error: EACCES: permission denied, open '/nix/store/in0m73y8lbimzsvwkfy1q6ncivcshxlc-home-manager-files/.claude.json.tmp.51302.1769300086638'\n at writeFileSync (unknown)\n at BF (/$bunfs/root/claude:5244:631)\n at qoB (/$bunfs/root/claude:5244:5059)\n at DA (/$bunfs/root/claude:5244:2646)\n at oV8 (/$bunfs/root/claude:5933:16798)\n at N_0 (/$bunfs/root/claude:5933:16921)\n at V_0 (/$bunfs/root/claude:5938:527)\n at <anonymous> (/$bunfs/root/claude:5938:52464)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-25T00:14:46.638Z"}]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:apibugSomething isn't workingSomething isn't workingplatform:macosIssue specifically occurs on macOSIssue specifically occurs on macOSstaleIssue is inactiveIssue is inactive
Activity
github-actions commentedon Jan 25, 2026
Found 2 possible duplicate issues:
thinkingorredacted_thinking, but foundtext. #11191This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
SeanHollen commentedon Jan 25, 2026
Not to just make a "me too" post, but since this is new, I'll add my information.
Claude doctor
A few things to clarify, how this is different than other reports:
/compact/context, I didn't run itclaude --version: 2.1.19 (Claude Code)Last messages seen before the error:
cafferychen777 commentedon Jan 25, 2026
Same issue here — #20717. This appears to be a regression from today (Jan 25). At least 7 issues reported in the last few hours: #20691, #20692, #20698, #20711, #20717, #20725, #20726. Thinking mode is completely unusable with tool calls. If you're affected, please upvote and comment on the related issues to help get this fixed!
Alyfish commentedon Jan 25, 2026
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.0: If
an assistant message contains any thinking blocks, the first block must be
thinkingorredacted_thinking. Foundtext."},"request_id":"req_011CXTTUY143pJroriaiunm9"} seeing the same errorcafferychen777 commentedon Jan 25, 2026
Update: This issue appears to be fixed now!
Tested with thinking mode + Opus 4.5 — multiple tool calls all succeeded without 400 errors. Please test on your end and confirm!
silverwind commentedon Feb 15, 2026
redacted_thinkingerors are till happening with opus 4.6. Switching/modelto sonnet works and it can continue the work after but switching back to opus gives the error again, so opus is in a persistent broken state after this error.