Problem Statement
When orchestrating multiple background agents via the Task tool with run_in_background: true, there is no way to be notified when an agent completes. The orchestrator must manually poll TaskOutput to check status. This makes reactive orchestration impossible — the orchestrator is always polling, never responding.
In our multi-agent system (3 persistent agents coordinating via subagents), we run 3-5 background agents in parallel regularly. The orchestrator currently has no choice but to either:
- Block on each agent sequentially (defeats the purpose of parallelism)
- Poll TaskOutput repeatedly (wastes context window on polling calls)
- Wait for the system-reminder notification (unreliable timing, no hook integration)
We built an entire cron + wake + messaging infrastructure to handle event-driven coordination BETWEEN sessions. But WITHIN a session, we have no event-driven primitive for "agent finished, here's the result, act on it."
Proposed Solution
A PostTask hook (or SubagentStop enhancement) that fires when a background agent completes, with access to:
task_id — which agent finished
agent_type / subagent_type — what kind of agent it was
status — success/failure/timeout
result_summary — the agent's final output (or first N characters)
This would enable:
- Reactive orchestration: launch dependent tasks immediately when blockers complete
- External notification: pipe completions to logging, monitoring, or messaging systems
- Workflow automation: trigger next steps without human/orchestrator polling
Priority
High — this is the missing primitive for anyone building multi-agent orchestration on Claude Code.
Category
Core / Tools
Alternatives Considered
- The current
system-reminder notifications for agent progress are helpful but not hookable — they appear in the conversation but don't trigger any external action.
- Polling TaskOutput works but consumes context window budget on status checks rather than productive work.
- We considered writing agent results to files and using file-watching, but this adds another infrastructure layer for what should be a native primitive.
Problem Statement
When orchestrating multiple background agents via the Task tool with
run_in_background: true, there is no way to be notified when an agent completes. The orchestrator must manually pollTaskOutputto check status. This makes reactive orchestration impossible — the orchestrator is always polling, never responding.In our multi-agent system (3 persistent agents coordinating via subagents), we run 3-5 background agents in parallel regularly. The orchestrator currently has no choice but to either:
We built an entire cron + wake + messaging infrastructure to handle event-driven coordination BETWEEN sessions. But WITHIN a session, we have no event-driven primitive for "agent finished, here's the result, act on it."
Proposed Solution
A
PostTaskhook (orSubagentStopenhancement) that fires when a background agent completes, with access to:task_id— which agent finishedagent_type/subagent_type— what kind of agent it wasstatus— success/failure/timeoutresult_summary— the agent's final output (or first N characters)This would enable:
Priority
High — this is the missing primitive for anyone building multi-agent orchestration on Claude Code.
Category
Core / Tools
Alternatives Considered
system-remindernotifications for agent progress are helpful but not hookable — they appear in the conversation but don't trigger any external action.