claude-code - 💡(How to fix) Fix Opus 4.8: "thinking blocks cannot be modified" (400) on long tool-heavy chats; Opus 4.7 unaffected

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…

On Opus 4.8, long tool-heavy chats eventually fail on every new message with a 400 error about thinking blocks. The same chat works fine when switched to Opus 4.7.

Error Message

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

Once it starts, every subsequent message fails — the conversation is stuck.

Root Cause

On Opus 4.8, long tool-heavy chats eventually fail on every new message with a 400 error about thinking blocks. The same chat works fine when switched to Opus 4.7.

Fix Action

Fix / Workaround

Workarounds (both confirmed)

  1. Model switch: switch to Sonnet, send any reply, switch back to Opus. This forces the client to drop the carried-over (cross-model-invalid) thinking blocks and clears the error.
  2. Manual transcript edit: strip thinking/redacted_thinking blocks from the session .jsonl and re-link parent UUIDs. Fixes it, but new corruption recurs on the next heavy Opus 4.8 turn.

Code Example

API Error: 400 messages.<X>.content.<Y>: `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

Summary

On Opus 4.8, long tool-heavy chats eventually fail on every new message with a 400 error about thinking blocks. The same chat works fine when switched to Opus 4.7.

Error

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

Once it starts, every subsequent message fails — the conversation is stuck.

Environment

  • Claude Code desktop app (current as of 2026-05-29)
  • Model: Opus 4.8 (1M context), thinking level "High"
  • macOS

Key findings

  • Model-specific: happens only on Opus 4.8. Switching the same conversation to Opus 4.7 works reliably, repeatedly.
  • Trigger: large multi-step assistant turns — several tool calls with interleaved thinking, including AskUserQuestion prompts mid-turn. Inspecting the transcript, a single assistant message id spans many blocks (tool_use / thinking / tool_use…) split across turns; the thinking blocks are not in leading position after reassembly.
  • Not context size: occurred at ~50% of a 1M-token window; user reports much larger/heavier sessions without issue on other models.
  • The individual saved thinking blocks look structurally valid (signatures present, no encoding anomalies) — the failure is about the latest assistant turn's thinking block being re-sent in a modified position/context.

Workarounds (both confirmed)

  1. Model switch: switch to Sonnet, send any reply, switch back to Opus. This forces the client to drop the carried-over (cross-model-invalid) thinking blocks and clears the error.
  2. Manual transcript edit: strip thinking/redacted_thinking blocks from the session .jsonl and re-link parent UUIDs. Fixes it, but new corruption recurs on the next heavy Opus 4.8 turn.

Impact

Long Opus 4.8 sessions become unusable until worked around. Staying on Opus 4.7 avoids it entirely.

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