[Bug] Parallel Agent calls can lose tool_results
Summary
When Claude Code launches 3 Agent tool calls in a single assistant turn, some tool_result blocks can go missing even though the session itself remains usable.
In the UI this shows up as:
[Tool result missing due to internal error]
In the debug log, the key signal is:
ensureToolResultPairing: repaired missing tool_result blocks
In my case, one assistant message emitted 3 Agent call IDs, but the following user-side tool_results block only contained 1 of them. The other 2 results were effectively dropped and surfaced as internal errors in the UI.
This looks like a parallel Agent result aggregation / pairing bug in Claude Code, not a hook failure and not a prompt issue.
Reproduction
- Use Claude Code CLI on macOS
- In a single assistant turn, launch 3 Agent tool calls concurrently
- Wait for all 3 to finish
- Observe that one or more Agent results may show up as:
[Tool result missing due to internal error]
- Inspect the debug log and see:
ensureToolResultPairing: repaired missing tool_result blocks
My concrete case was a /simplify run that launched 3 review agents in parallel.
Observed behavior
- Assistant turn contains 3 Agent tool uses
- The next user tool_result turn only contains 1 matching
tool_result - Missing results are shown as internal errors in the UI
- Session continues, but the affected Agent outputs are lost
Relevant debug evidence:
ensureToolResultPairing: repaired missing tool_result blocks
And the repaired message structure showed the mismatch explicitly:
assistant(... tool_uses=[call_uHD..., call_Tu..., call_VKK...]);
user(tool_results=[call_VKK...])
So 2 of the 3 tool results were missing from the paired result turn.
Expected behavior
One of these should happen reliably:
- All Agent
tool_resultblocks are preserved and paired correctly, or - The whole multi-Agent turn fails cleanly with a structured error, without dropping individual results
The system should not silently lose a subset of parallel Agent results and then repair the turn with missing blocks.
Why I think this is not a hook/config issue
In this session:
PreToolUse:Agenthooks succeededPostToolUse:Agenthooks succeeded- The affected agents did run
- OAuth/API requests continued successfully afterward
There was also a separate log entry:
Auth error: No API key available
But this appears unrelated, because OAuth checks completed and subsequent API calls still succeeded. The failure pattern here is specifically about parallel Agent tool_result pairing, not auth.
Environment
- Claude Code CLI:
2.1.85.29d - Platform: macOS
- OS:
Darwin 25.3.0 - Shell:
zsh
Workaround
Current workaround on my side:
- Avoid 3 parallel Agent calls
- Use 2+1 instead
- If a result is missing, rerun only the missing Agent(s) serially
- If serial rerun still fails, fall back to the main thread
Related issue
This looks related to, but distinct from, anthropics/claude-code#31328.
That issue is about session corruption / resume problems after dropped entries.
This issue is about a live parallel Agent turn where the session stays usable, but some Agent results are lost and surfaced as internal errors.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗