You need an agent and an environment. Creating agents and starting sessions needs the Developer or Admin role; the User role can read session trees and threads. See Organizations and roles. Every session can delegate to copies of its own agent without any setup. You need a roster only to delegate to other agents or to add an advisor.
Choose a pattern
Start with one agent. Add agents only when the work splits into pieces that don’t depend on each other.
A piece is worth a separate agent when it has its own build-and-test loop, its own sources, or its own approach to try. Splitting a short, sequential task costs more and usually finishes later, because each child starts without the parent’s context. Delegation and teams combine: a team member can still delegate a focused sub-task, within the depth limit.
How delegation works
The root delegates with thedelegate_subagent tool, which you see in the transcript. Each child is a separate session with its own conversation, called a thread.
- The task must stand alone. A child receives only the task text, not the parent’s conversation. Name the files, the goal, and what a good result contains.
- Hand work over by file path. Children share the root’s sandbox and environment, so each side can read what the other wrote.
- Children report a result. A child finishes with
submit_result: a status ofdone,partial, orblocked, a summary, and the paths it produced. The parent reads exactly that summary.
Follow-ups, failures, and inspection
Follow-ups, failures, and inspection
- Threads stay reachable. After a child reports, the parent can send it a follow-up with
send_to_agent, and the child continues with its earlier context. The parent can also wait for children withwait_for, stop one withinterrupt_agent, and close an idle one witharchive_thread. - Failures stay contained. A child that fails, or a roster agent that can’t be resolved, returns an error to the parent. Its siblings keep working.
- Everything is inspectable. The console session page and the API show every child session, its thread, and a merged timeline. See Inspect the session tree.
Configure a roster
A roster lists the agents a coordinator can delegate to, and at most one advisor. It’s part of the agent version, so a running session keeps the roster it started with. This coordinator can delegate to a researcher agent and consult one advisor.- Console
- cURL
- In the sidebar, click Agents, then open the coordinator agent.
- On the Configuration tab, find Multiagent.
- Click Add helper agent, then choose the agent under Helper agent.
- Click Add advisor, choose the Advisor model, then click Add.
- Click Save new version.
multiagent. Some fields are omitted.
Roster fields
Roster fields
Each roster entry has these fields:
Use the advisor
The advisor answers questions the agent asks withconsult_advisor. It sees a digest of the session’s recent activity and its own earlier advice, and it returns guidance only. It has no tools, can’t read files, and doesn’t do work. Ask the agent to consult it at decision points, for example: “Before you change the schema, consult the advisor with your migration plan.”
Set delegation limits
Set limits in the coordinator’s roster undermultiagent.limits, not in a session start request. A child carries the root’s limits down the tree. A child agent’s own roster can tighten them but never widen them.
When a limit is reached, the delegation is refused with a tool error that the agent reads, such as “3 threads are already running, the most allowed at once”. The agent then waits for a child to report, reuses an idle child, or archives one. The session itself keeps running.
Limit fields
Limit fields
Inspect the session tree
The tree view shows every session in the tree, every thread, and the first page of one merged timeline. The thread list is the complete list of children, ordered by position in the tree.- Console
- cURL
- In the sidebar, click Sessions, then open the root session.
- The transcript shows each child’s work in its own lane.
- Open the Work tab to see members, the board, and messages between agents.
stop_reason awaiting_subagents is waiting on its children, not stuck. When next_event_id is present, read the rest of the timeline with the events API. See Events.
Example tree response
Example tree response
events is shortened.Track cost across the tree
Every child’s cost counts toward the root session. A session’scostUsd is one total for the whole tree, and a child session returns the same figure as its root. See Usage and cost. Child sessions don’t take a slot under the agent’s max_concurrent_sessions; ordinary root sessions do.
What a child inherits
A copy of the root acts as the root under another name. A different agent from the roster is its own principal and gets only what its own definition grants.
Two rules apply to credentials across the whole tree:
- Environment-variable credentials come only from the vaults granted to the root session. They’re set as plaintext environment variables in the shared sandbox when it starts, every agent in the tree can read them, and nothing adds to them later. To make a variable available, grant its vault to the root session.
- MCP server credentials work for each agent individually. A roster agent’s MCP servers authenticate with its own grants, and the root’s credentials never authenticate a roster agent’s servers.
session_status warning with the code delegated_env_credentials_unavailable and the missing variable names.
What can go wrong
The most common problems:- A child did the wrong thing. Its task depended on context it never received. Write tasks that stand alone: goal, input paths, output path, and what done means.
- “threads are already running” or “live threads” in a tool result. A thread limit was reached. This is expected under load: the agent waits, reuses, or archives children. Raise the limit if the work needs more.
delegated_env_credentials_unavailablewarning in a child. A roster agent expected environment-variable credentials that the root’s vaults don’t provide. Grant that vault to the root session.
Every multi-agent error
Every multi-agent error
Next steps
Teams
Run copies of an agent on a shared task board.
Deliverables and artifacts
Where children write outputs and how they’re kept.
Research team tutorial
Run a research team end to end.
Vaults
Grant credentials to the root and to roster agents.