claude-code - 💡(How to fix) Fix Session permanently wedged on 400 "thinking blocks cannot be modified" after parallel tool_results

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

API Error: 400 messages.3.content.16: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

Code Example

API Error: 400 messages.3.content.16: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
RAW_BUFFERClick to expand / collapse

What happened

Session got permanently wedged on a 400 thinking-block error. After a turn that returned two parallel tool_result blocks, the next API request failed with:

API Error: 400 messages.3.content.16: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

The session never recovered. ~15 minutes later, a trivial follow-up prompt re-hit the same error at a different index (messages.1.content.39) — the malformed message history kept getting replayed on every turn, so the session was unusable until I /exit'd.

Repro / context

  • Error appears immediately after two adjacent tool_result user messages (parallel tool calls).
  • Looks like a thinking block is being reordered/modified relative to the original assistant response when the history is reconstructed for the next request.
  • Once it occurs the session is stuck — every subsequent turn (including a no-op prompt) replays the bad history and re-errors.

Version

Claude Code 2.1.153

Expected

Thinking blocks should be preserved in their original position/content when replaying assistant messages, especially following parallel tool results — and a single 400 should not permanently wedge the session.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING