[Bug] Subagents loop 9 extra turns after end_turn, returning filler text instead of report

Status Open
Reported on v2.1.173
Maintainer reply None cached
Activity 1 comment · opened Aug 3, 2026

Bug Description
Subagents loop 9 extra turns after end_turn; parent receives filler instead of the report ## Summary Since 2.1.173, a subagent that has already terminated with stop_reason: end_turn is re-invoked 8 more times with no input. Each extra turn degrades until the final message is filler ("대기 중입니다." / "Standing by — nothing further to do."). Because the Agent tool returns the agent's LAST text, the parent receives the filler instead of the actual report. ## Evidence Surveyed 257 subagent transcripts at ~/.claude/projects///subagents/agent-*.jsonl, counting distinct requestIds after the last tool_result: 2.1.157 n=36 0/36 looped (avg 1.0 turn) <- clean 2.1.173 n=9 9/9 looped 2.1.197 n=86 86/86 looped 2.1.220 n=50 49/50 looped Total 2.1.173+: 217/221 looped. Distribution of extra turns is strictly bimodal: 1 (38 cases) or 9 (218 cases) — nothing in between. Suggests a retry loop with a hard cap of 9, not model verbosity. Worse for read-only agents: Plan 9.0, Explore 8.6, code-reviewer 8.0 vs executor 2.1, deep-executor 3.1 (avg extra turns). ## Concrete instance Session 64d34ad5-4ab9-4e43-812f-35ab3d5258af, agent a74367b29a28eef44 (Explore, run_in_background: false), cwd /Users/jh/workspace/yfield-ai, version 2.1.220: [89] 01:36:43 stop_reason=end_turn, 16,052-char report [90] 01:36:56 new requestId, no user record in between ... [97] 01:37:24 "대기 중입니다." (8 chars) Parent tool_result for toolu_01G5vVkZ7zMyhVoD1tbxq17A: [{"type":"text","text":"대기 중입니다."}] <- 38 bytes Records [90]-[97] chain via parentUuid directly off [89]; no user record, no attachment, no hook_additional_context between them. ## Ruled out - Concurrent sessions in the same cwd: reproduces across 6 unrelated projects, including single-session runs. - Third-party Stop/SubagentStop hooks (oh-my-claudecode): same hooks were installed on 2.1.157, which was 36/36 clean. Its Stop hook returns {continue:true} when no mode is active; SubagentStop additionalContext appears in only 26 of 257 transcripts. ## Impact 8 wasted API calls per subagent, each resending the full agent context (90k-133k tokens for Explore). A 3-agent fan-out burns ~24 redundant calls and still returns nothing usable. ## Environment Claude Code 2.1.220 (native install), macOS 25.2.0 (darwin), Opus 5 1M

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.220
  • Feedback ID: 571539dc-1392-4441-be36-46009a77cc8b

Errors

[]

View original on GitHub ↗

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