Claude Extended Thinking — Block Required in Continuation
When continuing a conversation that used extended thinking with tool_use, you MUST include the original thinking blocks in the assistant message history. Stripping them causes 400 errors or breaks the signature verification chain.
When appending an assistant response to messages history for the next turn, include ALL content blocks — thinking, redacted_thinking, text, and tool_use. Never filter to just the text. Signatures on thinking blocks are cryptographically verified; removing them breaks continuation.
The Error Messages You're Seeing
HTTP/1.1 400 Bad Request
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "messages.1.content: assistant message with tool_use
is missing required thinking block from previous turn"
}
}
Variants:
"thinking block signature invalid or missing"
"redacted_thinking block cannot be removed from history"
"When extended thinking is enabled, all thinking blocks
must be preserved in assistant messages"
"Signature mismatch on thinking block"
Understanding Thinking Block Requirements
Claude's extended thinking uses cryptographic signatures to verify continuity. When Claude thinks, then calls a tool, then receives a tool result, then continues thinking — the signature chain proves the thinking wasn't tampered with. Removing thinking blocks between calls breaks the chain.
What Actually Causes This Error
msg.content[0].text — drops thinking blocks.Fixes That Work (Tested Nov 2026)
1Preserve ALL Content Blocks in History
2Serialize With Full Fidelity
3Display vs API Storage Separation
Store TWO versions: (1) full-fidelity for API calls (with thinking + signatures), (2) display-safe for user UI (thinking hidden or shown as collapsible). Never derive the API version from the display version — always keep the original.
Preventing This Error Going Forward
- Never mutate assistant.content when appending to history. Whole list, always.
- Use Pydantic
model_dump()for serialization. Preserves all fields. - Keep API history and display history separate. Don't derive one from the other.
- Round-trip test after any serialization change. Load + resend + verify no error.
- Log content block types on append. Alert if thinking blocks vanish.
Researcher · AI Error Hub
Frequently Asked Questions
Yes — that's the recommended pattern. Store the full content (with thinking) for API continuation; filter out thinking blocks when rendering to the user. Two views of the same source of truth.
Encrypted thinking content that Anthropic returns instead of plain text in specific cases (safety, IP protection). You get an opaque blob with a signature. You must include it in continuation just like regular thinking blocks. You can't decode it, but Claude uses it to maintain continuity.
Simple text-only responses that don't reference tools: technically you can strip thinking blocks and get away with it in one-shot completions. But if there's ANY chance of continuation or tool use, preserve them. Safe default: always preserve.
No, signatures are per-request. Don't try to cache thinking blocks across sessions. Treat them as one-shot payloads tied to their specific conversation continuation.
Yes. Every thinking token stays in the conversation history and counts toward the 200K context. Long agent runs with extensive thinking can blow through context quickly — plan budget accordingly.
Related Errors
Build Reliable Reasoning Agents
Weekly deep dives on extended thinking patterns, agent architectures, and Claude reasoning. 12,000+ developers subscribe.
Subscribe Free →