Subagent duplicate tool calls with persisted-output

Resolved 💬 3 comments Opened Jan 3, 2026 by keenanwh Closed Feb 18, 2026

Description

Subagents spawned via the Task tool are making duplicate consecutive tool calls, burning tokens unnecessarily.

Environment

  • Claude Code version: Latest (as of 2026-01-03)
  • OS: Windows 10 (MSYS2/Git Bash)
  • Model: Sonnet (subagent), Opus (orchestrator)

Reproduction

  1. Spawn a subagent via Task tool for a multi-step task
  2. Let it run for 10+ minutes with file reads, edits, and bash commands
  3. Observe the output file shows duplicate consecutive tool calls

Observed Behavior

Almost every tool call appears twice in succession with identical parameters:

[Tool: Read] {"file_path":"...Player.cs"}
[Tool: Read] {"file_path":"...Player.cs"}     <-- DUPLICATE
[Tool: Grep] {"pattern":"WithNobleAdded",...}
[Tool: Grep] {"pattern":"WithNobleAdded",...}  <-- DUPLICATE
[Tool: Edit] {"file_path":"...GameStateTests.cs",...} (200+ line edit)
[Tool: Edit] {"file_path":"...GameStateTests.cs",...} (200+ line edit)  <-- DUPLICATE

This affects Read, Grep, Edit, Bash - all tool types.

Suspected Cause

When tools return <persisted-output>Tool result saved to:...</persisted-output>, the subagent may be misinterpreting this as "no result received" and retrying immediately.

Impact

  • 2x token consumption for affected calls
  • Large Edit operations are especially expensive when duplicated
  • 21-minute task consumed excessive tokens

Additional Context

  • No custom hooks affecting Read/Grep (verified)
  • Duplicates are consecutive (not interleaved)
  • Pattern starts after first few calls, not from the beginning

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗