Omniscio

OmniscioGuides400 orphaned tool_result

Claude Code: API Error 400 orphaned tool_result

Last checked against Anthropic's documentation on November 18, 2026. By the Omniscio team. Updated .

What is the exact message?

API Error: 400 orphaned tool_result in conversation history. Run /rewind to recover the conversation.

Anthropic's error reference groups it under one heading, "Tool use or thinking block mismatch", with these variants:

API Error: 400 duplicate tool_use ID in conversation history. Run /rewind to recover the conversation.
API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.
API Error: 400 ... unexpected tool_use_id found in tool_result blocks
API Error: 400 ... thinking blocks ... cannot be modified

What does it mean?

Every tool call in a conversation is a pair: the model asks for a tool, and a result comes back with the same identifier. The API checks those pairs on every request and refuses the whole conversation when one does not match.

Anthropic says it in one line: the sequence of tool_use, tool_result and thinking blocks in history no longer matches what the API expects.

Each variant names the shape it found. An orphaned result has lost its call. A duplicate ID appears twice. A concurrency problem means parallel calls were recorded out of the order the API allows.

Why the history gets damaged

  • An older Claude Code on Opus 4.7 or 4.8. Anthropic records that versions before v2.1.156 can trigger the mismatch during normal tool use, and that /rewind does not clear that one; its instruction there is to run claude update first.
  • Calls ran in parallel. The concurrency variant says so in its own words, and parallel tool use is where the order of results most easily goes wrong.
  • A call was interrupted. A tool that was cancelled, or a turn that was stopped mid-call, can leave a result with no matching call.
  • The conversation was edited or resumed. The thinking-block variant appears when the history no longer carries the blocks the API recorded.

The first is Anthropic's own note. The other three are what each variant's wording points at, and Anthropic's fix is the same for all of them.

How do I fix it?

  1. On Opus 4.7 or 4.8, update first. Run claude update. Anthropic says a version before v2.1.156 can trigger this during normal tool use, and that /rewind does not clear it there.
  2. Run /rewind and step back to a checkpoint before the corrupted turn. Pressing Esc twice opens the same menu, but only while the prompt input is empty: with text in it, the first press clears the text.
  3. Pick Restore conversation if you want your files left as they are now. The other option, Restore code and conversation, also rolls the edited files back to that checkpoint, which is what you want only if you are undoing that work too.

Sending a new message is not the way past it: the history is what the API rejected, so the fix is to step back rather than to wait or retry.

How do I know it is fixed?

  • Your next message gets a real answer instead of the same 400.
  • /status shows the Claude Code version you expect, if you updated.
  • The error does not return on the following turn, which is what tells you the damaged turn is genuinely behind you rather than one message away.

Where these answers come from

Common questions

Will /rewind undo my file edits?

Only if you ask it to. The rewind menu offers Restore conversation, Restore code and conversation, and Restore code; choosing the first keeps your files as they are. Anthropic's checkpointing page lists the limits, including that changes a Bash command made are not tracked.

I updated and it still happens. What now?

Rewind past the turn that produced it, then watch whether it returns. If it keeps coming back on the newest version, /feedback reports it with the session details Anthropic needs.

Does this mean I lost the conversation?

No. Rewinding moves you back to a checkpoint before the damaged turn, and you carry on from there with the earlier conversation intact.