Stuck retry loop: `400 thinking blocks cannot be modified` on large interleaved-thinking turns using AskUserQuestion

Resolved 💬 3 comments Opened May 28, 2026 by BrightLiao Closed Jun 30, 2026

Claude Code version: 2.1.153 (latest at time of report)
Platform: macOS (Darwin 25.4.0)
Model: claude-opus-4-7

Summary

On long single turns that contain many interleaved thinking blocks plus a large number of parallel tool calls, and that use the AskUserQuestion tool, Claude Code gets permanently stuck in a retry loop emitting:

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.

The error repeats on every retry and on manual "continue" — the session cannot recover on its own.

What I observed (from local transcripts)

  • The failing assistant message is a single API response (one requestId) containing 40–65 content blocks.
  • Structure is thinking blocks interleaved between many tool_use blocks (Bash/Read), e.g. thinking, text, tool_use×9, thinking, tool_use×9, thinking, ... , AskUserQuestion, thinking, tool_use×3.
  • The turn used the AskUserQuestion tool.
  • After the question was answered (and after manually typing "continue"), every subsequent request failed with the same error → infinite retry loop.
  • Not caused by model switching (single model throughout) and not caused by context compaction (no compact/summary markers in the transcript).

Likely cause

When re-sending the conversation after the AskUserQuestion answer / on retry, the client appears to not preserve one of the interleaved thinking blocks byte-for-byte (ordering or content), so the API signature check rejects it. The client then retries with the same broken payload, so it never recovers.

Expected behavior

Interleaved thinking blocks should be re-sent unmodified so the signature check passes; failing that, the client should not loop on an identically-failing payload.

Reproduction pattern

  1. Trigger a long turn with many parallel tool calls and interleaved thinking.
  2. Have the model call AskUserQuestion within that turn.
  3. Answer the question / continue → 400 thinking-block error, repeating.

Impact

The session becomes unusable; only /clear or rewinding before the AskUserQuestion turn recovers it.

(Affected messageIds / session IDs available on request — omitted here as they're account-linked.)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗