Agent teams: a subagent spawned after a teammate returns is re-parented under that still-alive teammate; its completion never propagates to main

Resolved 💬 1 comment Opened Jun 17, 2026 by trek-e Closed Jun 17, 2026

Environment

  • Claude Code 2.1.178
  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, teammateMode=tmux (also reproduced via "auto" in iTerm2)
  • Observed while running an orchestration workflow where the top-level/lead session spawns two subagents sequentially via the Agent tool.

Summary

With agent-teams enabled, when the lead session spawns subagent A, lets it return, then spawns a second subagent B, B is attached as a child of A (which agent-teams keeps alive as a resumable teammate) instead of as a child of the lead. B's completion then routes to A and is never propagated to main. A blocking Agent() call in the lead waits forever.

This contradicts the documented subagent contract — sub-agents states subagents "report results back to the main agent only," and agent-teams states "when a teammate finishes and stops, they automatically notify the lead." Neither happened.

It is distinct from the documented "Task status can lag" limitation (that's teammates failing to mark shared-task-list items complete; this is a subagent's completion message being misrouted due to re-parenting).

Repro

  1. Enable agent teams (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, teammateMode=tmux).
  2. From the lead session, spawn subagent A via the Agent tool and let it return its result.
  3. From the lead session, spawn a second subagent B via the Agent tool (intended as a sibling of A under main).
  4. Let B complete its work and reach a verdict.

Expected

B's completion is delivered to the lead (main); the blocking Agent() call returns B's result.

Actual

  • The run sits waiting on a completion signal that never arrives.
  • A notification does fire — but stamped with A's task-id, carrying B's result. The result bubbled up one level (to A) and stopped.
  • Manually messaging B returns "had no active task; resumed from transcript", which forces a fresh come-to-rest that finally routes to main.

Agent tree observed from a parallel session (B is a child of A, not a sibling of main):

○ main
  ○ A (subagent)        Committing revised files
  └ ● B (subagent)      Reading inputs            ← re-parented under A

Impact

Any orchestrator that spawns subagents sequentially and blocks on their return hangs indefinitely once agent-teams is enabled. The lead has no signal to recover from — the only escape is manually resuming the stuck subagent.

Note

The manual-resume escape returning "resumed from transcript" suggests the re-parented child's completion depends on a transcript-serialization path rather than the normal notification route to the lead.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗