Coordinating Agents¶
One agent can run several others in Roost tabs: it opens a tab per worker, hands each a task, waits for the first one that needs it, reads what the worker reported, answers, and closes the tabs at the end. You watch all of it in the sidebar and can step into any tab.
This is a supported way to use Roost. What Roost supplies is the op
set, through roostctl, and a skill that teaches an agent the
procedure. Roost does not schedule work, keep a list of workers, or
retry anything: the coordinating agent does, and you can read every
command it runs
(DL-37).
Try it¶
- Give your agent the skill. Claude Code in a Roost tab already has
it. For any other agent, or outside Roost, run
roostctl skill installonce (Agent Skill). -
In a Roost tab, ask for it in words that name Roost, since the skill is scoped to Roost on purpose:
-
Watch the workers appear as tabs in the project. Their dots follow their state as they work; the Agents panel lists them.
The agent follows
references/orchestrating-agents.md,
which roostctl skill show orchestrating-agents prints. It was
written by running each command against Claude Code 2.1.337 and
Antigravity CLI 1.5.24.
It needs a roostctl newer than 0.1.0, for wait over several tabs
and open --shell. The reference file tells an agent how to check, and
what to do on an older one.
How it works¶
Four rules carry the whole thing.
Each worker has a report file, and that file is the record. The coordinator gives every worker a brief that names a file. A worker with a result, a question, or a problem it cannot get past appends a numbered section to the file and ends its turn.
A tab's state says when to look, never what happened. The coordinator blocks on every worker at once:
```bash roost-recipe roostctl wait --tab 11,12,13 --state idle --state needs_input --state none --gone --timeout 540 --json
That returns at the first worker whose turn ended (`idle`), that is
waiting on a person or failed (`needs_input`), whose agent exited
(`none`), or whose tab closed (`--gone`), and names it. After every
return, and after every timeout, the coordinator reads every report
file. A report is never lost, because the file is still there whenever
the coordinator looks.
**The coordinator answers by prompting the worker's tab:**
```bash roost-recipe
roostctl tab prompt --tab 12 --until running --timeout 30 --file "$PWD/.roost-run/worker-b-answer-1.md"
The worker does not wait or poll. tab prompt refuses a tab that is
showing a permission or question dialog (exit 1, blocked), so an
answer meant for the agent cannot land on a dialog meant for you.
Notifications are for you. A worker does not use roostctl notify
to reach the coordinator: a notification is not stored, so one raised
while nobody is listening is gone. The coordinator raises one on its
own tab when the run is finished or when it needs your decision.
What you will be asked¶
- Trusting a folder. An agent started in a directory it has not
seen asks whether to trust it. The worker's tab shows
needs_inputand the coordinator stops there unless you told it that it may answer. Starting workers in directories you already trust avoids the question. - Permissions. A worker that asks to run a command shows
needs_inputlike any agent tab. The coordinator reads the dialog and decides, or passes the question to you.
Limits¶
- A report can wait for one timeout. A worker that ends its turn
while a background command of its own is still running keeps reading
running, so the coordinator sees its report at its next timeout rather than at once. The brief tells workers to stop background work before they report. runningis not proof of progress. A worker stuck in a wait that never ends, or stopped by its account's usage limit, can keep readingrunning. The coordinator's check at each timeout compares each tab's last report against the clock and reads the screen of any that has been silent too long.- Shared resources are not arbitrated. Workers in separate git worktrees still share ports, databases and containers. Say in the task who may use what.
- Local tabs only.
waitandtab promptdo not reach a tab on a remote host, so workers run on the machine the coordinator is on. - An agent that reports nothing to Roost reads
nonethroughout, so the coordinator cannot wait on its tab. It reads that worker's report file at each timeout instead, which still works, because the report files are the record, but only at the pace of the timeout. - The block on a dialog is best-effort.
tab promptchecks the tab's state just before it writes; a dialog that appears in the instant between the check and the write still receives the text.
Doing it by hand¶
Nothing here is special to agents. The same verbs work from a script
or a shell, and the CLI reference has every
flag. Do not build the wait out of roostctl events piped into
head -n 1: that pipeline returns at a later event than the first
match, as Automation explains.