Unrecoverable session after dropped tool_result — rewind/restore/summarize all fail
When a tool_result is dropped mid-conversation, the session enters a permanently unrecoverable state. All built-in recovery mechanisms fail with the same 400 error.
What happened
- A Bash tool call (
git log --oneline | wc -l) executed but returned(No output)— the tool_result appears to have been dropped or malformed - Every subsequent message fails:
API Error: 400 due to tool use concurrency issues /rewindoffers three options: Restore conversation, Summarize from here, Never mind- All three fail with the same 400 error
- The session is permanently unusable — no recovery path works
Root cause
The Anthropic API requires every tool_use block to have a matching tool_result. When a result is dropped, the conversation history becomes structurally invalid. The recovery mechanisms (rewind, restore, summarize) reconstruct the API conversation from the same broken history, reproducing the invalid tool_use/tool_result sequence.
Even amputating 200+ entries from the session JSONL does not fix it, suggesting the broken pair may be embedded in compacted/summarized history that amputation cannot reach.
Expected behavior
At minimum one of these should work:
/rewind"Restore conversation" should inject a synthetic tool_result for any orphaned tool_use blocks/rewind"Summarize from here" should discard the raw history and start fresh from a summary, skipping broken tool pairs- Claude Code should detect orphaned tool_use blocks before sending to the API and auto-repair them
Impact
- Session is permanently dead — $50+ of context and work history lost
- All commits were on disk (no code lost), but session continuity is destroyed
- Related issues: #20555, #37452, #21321 — but those don't address the recovery failure
Environment
- Claude Code v2.1.84
- macOS
- Model: Opus 4.6
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗