Repository navigation
Subagents & Agent Teams
One agent hits a wall; many agents don't. The harness runs two delegation models — lightweight subagents and durable Agent Teams.
subagent spawns a fresh child agent with its own context window. The child does the
work and returns only the result — intermediate steps never pollute the parent's context.
-
Continuable (
subagent) — the child can be messaged later, resumed, interrupted. Omitted calls default to background with automatic result delivery. -
One-shot (
subagent_fork) — run it, collect it, forget it. Defaults to foreground. -
run_in_background: truereturns a job id immediately; collect withjob_output, stop withjob_kill. - Drive live children with
send_message,interrupt_agent,list_agents; the child hands results back withreport.
When to delegate: scoped research, an isolated analysis, a file sweep — anything self-contained enough to be described in one standalone prompt. The child does not see the parent conversation, so give it everything it needs.
Teams are a different animal: a Lead keeps a durable journal of membership, messages, acknowledgements, and tasks; teammates are resumable children that survive process restarts.
| Piece | What it gives you |
|---|---|
spawn_teammate |
Create a durable named teammate with its own session. |
send_message |
Send a peer message; delivery is durable — queued, checkpointed, retried on recovery. |
| Delivery modes |
quiet (drop into the target's session silently) vs wakeup (wake the target and surface it). |
wait_agent |
Block until the next Team change (bounded 10s–1h, cancellable). |
followup_task / interrupt_agent
|
Lead-only control over teammate rounds. |
| Task board |
team_task_create / get / list / update with compare-and-set updates — no lost writes between teammates. |
Why it matters for engagements: run a lead coordinating five scoped hunters — one on subdomains, one on JS secrets, one on the API surface — each with durable inboxes and a shared task board, all inside one harness instance. If the process dies, sessions and mailbox state persist and recover.
Enable it: the shipped base bundle keeps Agent Teams disabled; add the Agent Teams profile patch to enable it (and disable the legacy control names at the same time).
| Subagent | Agent Team | |
|---|---|---|
| Lifetime | One task | Survives restarts |
| Communication | Result return + messages | Durable mailbox + task board |
| Coordination | Parent-driven | Lead + journal |
| Best for | Scoped delegation | Parallel crews over long engagements |