claude-code - 💡(How to fix) Fix Extended thinking + tool use: signature-only thinking blocks permanently break --resume (400 cannot be modified)

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.N.content.M: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

Root Cause

Signature kept, reasoning text empty. This appears for every thinking block (observed across hundreds of transcripts on this machine), independent of MCP servers or hooks — it reproduces with all hooks/MCP disabled, so it is not caused by any third-party hook modifying the transcript.

Fix Action

Workaround

Strip the hollow thinking content blocks from the transcript (remove thinking-type blocks whose text is empty and re-link the parentUuid chain) before resuming.

Code Example

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

---

{"type": "thinking", "signature": "<long signature present>", "thinking": ""}
RAW_BUFFERClick to expand / collapse

What happened

On sessions that use extended thinking together with tool use, Claude Code persists thinking content blocks to the session transcript (~/.claude/projects/**/<session-id>.jsonl) with their signature intact but the thinking text field empty ("thinking": ""). I'll call these "hollow" thinking blocks.

On --resume, when Claude Code rebuilds the conversation from that transcript and has to replay such a block as part of the latest assistant message, it sends the hollow block to the API, which rejects the request:

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

Every subsequent turn re-sends the same block, so the session becomes permanently unresumablecontinue, a new prompt, anything 400s identically.

Version

Claude Code 2.1.156

Steps to reproduce

  1. Run a session with extended thinking enabled that does interleaved thinking + (ideally parallel) tool use.
  2. Have it end on / be interrupted at an assistant turn that contains a thinking block followed by tool_use.
  3. claude --resume <session-id> -> 400 on the first turn, and on every turn after.

Evidence

Inspecting the transcript JSONL, the thinking blocks are stored as:

{"type": "thinking", "signature": "<long signature present>", "thinking": ""}

Signature kept, reasoning text empty. This appears for every thinking block (observed across hundreds of transcripts on this machine), independent of MCP servers or hooks — it reproduces with all hooks/MCP disabled, so it is not caused by any third-party hook modifying the transcript.

Impact

  • A session that ends on a thinking + tool-use turn is permanently wedged on resume.
  • Affects anyone running extended thinking + tools (a very common configuration).

Workaround

Strip the hollow thinking content blocks from the transcript (remove thinking-type blocks whose text is empty and re-link the parentUuid chain) before resuming.

Suggested fix

Either persist the full thinking text alongside the signature in the transcript, or omit/strip prior-turn thinking blocks when rebuilding history on resume rather than sending a signature-only block that necessarily fails the API's "must remain unmodified" check.

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 Extended thinking + tool use: signature-only thinking blocks permanently break --resume (400 cannot be modified)