claude-code - 💡(How to fix) Fix Background-Agent completion notifications drop silently when ≥3 parallel run_in_background agents dispatched

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When the Agent tool is invoked with run_in_background: true for 3+ parallel agents in a single message (Opus model, long-running multi-tool work in the 20–90 minute range), the first 1–2 agents fire completion notifications normally to the parent agent, but the trailing agents complete silently — TaskStop <task-id> returns "task not found" indicating the harness has already garbage-collected the long-running task even though the work landed (filesystem evidence + green test suite confirm completion).

Net cost per affected dispatch wave: 20–40 minutes of false-wait in the parent agent + manual filesystem audit to confirm silent completion.

Root Cause

When the Agent tool is invoked with run_in_background: true for 3+ parallel agents in a single message (Opus model, long-running multi-tool work in the 20–90 minute range), the first 1–2 agents fire completion notifications normally to the parent agent, but the trailing agents complete silently — TaskStop <task-id> returns "task not found" indicating the harness has already garbage-collected the long-running task even though the work landed (filesystem evidence + green test suite confirm completion).

Net cost per affected dispatch wave: 20–40 minutes of false-wait in the parent agent + manual filesystem audit to confirm silent completion.

Fix Action

Fix / Workaround

Net cost per affected dispatch wave: 20–40 minutes of false-wait in the parent agent + manual filesystem audit to confirm silent completion.

Single message dispatching 4 parallel Opus background agents:

Workaround currently in use

Code Example

Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID a, ~26 min
Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID b, ~60 min
Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID c, ~30–90 min
Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID d, ~30–90 min
RAW_BUFFERClick to expand / collapse

Summary

When the Agent tool is invoked with run_in_background: true for 3+ parallel agents in a single message (Opus model, long-running multi-tool work in the 20–90 minute range), the first 1–2 agents fire completion notifications normally to the parent agent, but the trailing agents complete silently — TaskStop <task-id> returns "task not found" indicating the harness has already garbage-collected the long-running task even though the work landed (filesystem evidence + green test suite confirm completion).

Net cost per affected dispatch wave: 20–40 minutes of false-wait in the parent agent + manual filesystem audit to confirm silent completion.

Reproducer (S82 canonical, 2026-05-17)

Single message dispatching 4 parallel Opus background agents:

Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID a, ~26 min
Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID b, ~60 min
Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID c, ~30–90 min
Agent({ subagent_type: "general-purpose", run_in_background: true, ... }) // task ID d, ~30–90 min

Observed outcome:

  • Task a (~26 min): ✅ completion notification fired normally
  • Task b (~60 min): ✅ completion notification fired normally
  • Task c (~30–90 min): ❌ silent completion, TaskStop c → "task not found"
  • Task d (~30–90 min): ❌ silent completion, TaskStop d → "task not found"

Filesystem audit (git status --short against expected new-file list) confirmed both silent tasks landed their work cleanly. Full test suite passed against the union of all 4 agents' changes.

Sprint history (4-sprint observation)

SprintDateParallel countSilent completions
S792026-05-1342/4
S802026-05-1531/3
S812026-05-1642/4
S822026-05-1742/4

Pattern is reliable: trailing agents in waves of ≥3 consistently exhibit silent completion.

Workaround currently in use

  1. Cap parallel background-agent dispatches at 2 per wave. If a wave needs >2 build agents, run sequential waves of 2 each.
  2. Filesystem-watch checkpoint at ~30 min and ~60 min after dispatch — run git status --short against the expected new-file list per item.

Environment

  • Claude Code CLI (VSCode native extension)
  • Model: claude-opus-4-7 (Opus 4.7 1M context)
  • OS: macOS Darwin 23.0.0
  • Tasks are general-purpose subagents doing multi-tool R3 build work (file reads, edits, bash commands)

Suggested investigation

Likely candidate: the task GC threshold may be tied to either (a) parent-agent message count between dispatch and check-in, or (b) absolute wall-clock independent of parent-agent activity. If the trailing agents exceed the threshold before the parent next sends a message, the notification path is unreachable when they finally complete.

Impact

Approximately 2 hours of cumulative parent-agent context-window pressure across S79–S82 on a sprint-orchestrating use case (Claude Code driving an internal 17-agent SDLC pipeline). The workaround (cap = 2) doubles the wall-clock for sprints that legitimately need 4-way parallel R3 build dispatches.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Background-Agent completion notifications drop silently when ≥3 parallel run_in_background agents dispatched