claude-code - 💡(How to fix) Fix [Bug] Anthropic API Error 400: Thinking blocks cannot be modified on history reconstruction with Opus 4.8

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

Symptom: API Error 400 "messages.N.content.M: thinking or redacted_thinking blocks in the latest assistant message cannot be modified." Once it fires, every resume re-sends the same message and re-hits the identical 400. The window is unrecoverable except by /rewind to a checkpoint before the poisoned turn.

Fix Action

Fix / Workaround

Bug Description 400 "thinking blocks cannot be modified" permanently kills sessions on Opus 4.8 — duplicate of #63147

Environment: Claude Code VS Code extension, Opus 4.8 (1M context), macOS.

Symptom: API Error 400 "messages.N.content.M: thinking or redacted_thinking blocks in the latest assistant message cannot be modified." Once it fires, every resume re-sends the same message and re-hits the identical 400. The window is unrecoverable except by /rewind to a checkpoint before the poisoned turn.

Trigger (intermittent): fires whenever the harness reconstructs or re-sends an assistant turn that contains an extended-thinking block. Observed in one day through three different paths: (1) parallel Bash calls where one errored and cancelled its siblings, stranding tool_use blocks next to a thinking block; (2) a ScheduleWakeup firing async into a thinking-bearing turn; (3) ordinary single tool calls (a Read, a git show) once a turn was already poisoned. The common factor is not the trigger but the precondition: extended thinking on + any history reconstruction.

This matches #63147: thinking text is persisted as empty while the signature is retained, so signature validation fails on re-send.

Impact on Opus 4.8 specifically: adaptive reasoning generates thinking blocks per-turn and cannot be disabled via config. MAX_THINKING_TOKENS only applies to Opus 4.6 / Sonnet 4.6; alwaysThinkingEnabled and Alt+T are display-only. So there is no user-side mitigation beyond shortening sessions and /rewind. Long working/ritual sessions hit auto-compaction, which reconstructs history and reliably triggers the failure.

Request: preserve thinking blocks verbatim across retry/resume/compaction (don't blank the text while keeping the signature), or expose a real per-session thinking off-switch on 4.7/4.8.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description 400 "thinking blocks cannot be modified" permanently kills sessions on Opus 4.8 — duplicate of #63147

Environment: Claude Code VS Code extension, Opus 4.8 (1M context), macOS.

Symptom: API Error 400 "messages.N.content.M: thinking or redacted_thinking blocks in the latest assistant message cannot be modified." Once it fires, every resume re-sends the same message and re-hits the identical 400. The window is unrecoverable except by /rewind to a checkpoint before the poisoned turn.

Trigger (intermittent): fires whenever the harness reconstructs or re-sends an assistant turn that contains an extended-thinking block. Observed in one day through three different paths: (1) parallel Bash calls where one errored and cancelled its siblings, stranding tool_use blocks next to a thinking block; (2) a ScheduleWakeup firing async into a thinking-bearing turn; (3) ordinary single tool calls (a Read, a git show) once a turn was already poisoned. The common factor is not the trigger but the precondition: extended thinking on + any history reconstruction.

This matches #63147: thinking text is persisted as empty while the signature is retained, so signature validation fails on re-send.

Impact on Opus 4.8 specifically: adaptive reasoning generates thinking blocks per-turn and cannot be disabled via config. MAX_THINKING_TOKENS only applies to Opus 4.6 / Sonnet 4.6; alwaysThinkingEnabled and Alt+T are display-only. So there is no user-side mitigation beyond shortening sessions and /rewind. Long working/ritual sessions hit auto-compaction, which reconstructs history and reliably triggers the failure.

Request: preserve thinking blocks verbatim across retry/resume/compaction (don't blank the text while keeping the signature), or expose a real per-session thinking off-switch on 4.7/4.8.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.156
  • Feedback ID: dc238471-3f29-493b-a188-8e3e678b4952

Errors

[]

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

claude-code - 💡(How to fix) Fix [Bug] Anthropic API Error 400: Thinking blocks cannot be modified on history reconstruction with Opus 4.8