Claude API: thinking block is bound to a different conversation
Claude API 400 Invalid signature in thinking block: earlier history was edited. Make history append-only; use drop_block with the beta header as a stopgap.
messages.{i}.content.{j}: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Remove the block, or set `thinking.block_binding.prefix_mismatch_behavior` to "drop_block".The system prompt, tools or messages before a replayed thinking block differ from what they were when the block was produced, so the API returns 400 invalid_request_error. The fix is to make your conversation history append-only; to save the request right now, send the beta header with "drop_block".
[1] Check whether your account and model are affected. The check exists only on Claude Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5. The official docs say accounts created on or after 2026-08-31 00:00 UTC are checked by default, while older accounts are checked only on requests that set prefix_mismatch_behavior. That is why the same code works on an old account and breaks only on a new one. The docs recommend building append-only regardless of account age.
[2] Read the end of the message to find what changed. The leading messages.{i}.content.{j} is the first failing block, and the message usually ends with a sentence naming what changed (system, the tools list, the first differing message). That sentence is for people and logs and its wording can change, so do not string-match it in code. First rule out two similar cases.
| Message | Cause |
|---|---|
Stops after `Invalid signature in thinking block` | The signature itself was truncated, altered or sent back empty. drop_block does not help |
... cannot be modified. These blocks must remain as they were in the original response. | The thinking block content was edited |
Ends with `That setting requires the thinking-binding-controls-2026-08-01 value in the anthropic-beta header.` | This case, sent without the beta header |
[3] Find the code that edits the prefix. The common rows from the docs' "what counts as an edit" table:
| Invalidates later blocks | Fine |
|---|---|
Rebuilding the top-level system on each request | Appending messages at the end |
| Re-rendering date or environment info in the first user message | Changing effort, max_tokens, tool_choice, metadata |
Clearing or shortening an old tool_result, re-encoding an old image | Moving cache_control markers |
Adding, removing or renaming a tool in tools | Server-side compaction or context editing |
| Removing a thinking block from the middle and keeping later ones | Removing thinking blocks from the start, the end, or all of them |
| An image or document URL whose bytes change | A rotating signed URL returning the same bytes |
Resending the same body fails the same way every time, so plain retries do not help.
[4] Replace each edit with an append. The replacements the docs pair with each edit:
- Instead of changing
system, add instructions with a mid-conversation system message. - Put changing context (date, environment) in the newest turn instead of editing the first message.
- To clear old tool results, trim on the server (
clear_tool_uses_20250919, betacontext-management-2025-06-27). Shorten results before the first time you send them. - To change the tool list, use
tool_additionandtool_removalblocks. - Send images and documents by Files API
file_idor base64.
All of these assume you send assistant turns back exactly as returned, thinking blocks included (even ones with an empty thinking field). Mid-conversation system messages and tool changes are not available on every model, so check the docs' support list.
[5] If you must save the request now, use drop_block. Add the beta header and put block_binding in the thinking config.
$ curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: thinking-binding-controls-2026-08-01" \ -H "content-type: application/json" \ -d '{"model": "claude-fable-5-1", "max_tokens": 16000, "thinking": {"type": "adaptive", "block_binding": {"prefix_mismatch_behavior": "drop_block"}}, "messages": [...]}'Sending block_binding without the header returns a 400 ending in block_binding: Extra inputs are not permitted. Add the header or remove the field. On Sonnet 5.5 and Haiku 5.5, block_binding works only with thinking: {"type": "adaptive"}; with between_tools on Sonnet 5.5 or disabled on Haiku 5.5, keep history append-only or strip thinking blocks from the edited turn on.
[6] If you cannot send the header, strip thinking blocks once. Remove every thinking and redacted_thinking block from the history (at minimum the named block and everything after it), leave the other blocks in place, and retry once. Do not put removed blocks back; restoring one invalidates the blocks produced while it was gone.
If you build a library or proxy, pass the caller's anthropic-beta values and block_binding through unchanged, and do not move a role: "system" message into the top-level system. For other thinking-related 400s, see Fix Claude API 400 "thinking.type.enabled is not supported".