The whole hunk
from line 65, old and new numbered
/
lines
from line 65
6565
6666 <MultiFileExample language="cli" label="CLI">
6767 ```bash CLI
68 ant beta:agents create < coordinator.agent.yaml
68 ant apply engineering-lead.md reviewer.md test-writer.md
6969 ```
7070
71 <File filename="coordinator.agent.yaml">
72 ```yaml
71 <File filename="engineering-lead.md">
72 ```markdown
73 ---
7374 name: Engineering Lead
7475 model: claude-opus-5
75 system: You coordinate engineering work. Delegate code review to the reviewer agent and test writing to the test agent.
7676 tools:
7777 - type: agent_toolset_20260401
7878 multiagent:
7979 type: coordinator
80 agents:
81 - type: agent
82 id: $REVIEWER_AGENT_ID # replace before running command
83 - type: agent
84 id: $TEST_WRITER_AGENT_ID # replace before running command
80 agents: # paths: ant apply substitutes {type: agent, id, version}
81 - ./reviewer.md
82 - ./test-writer.md
83 ---
84
85 You coordinate engineering work. Delegate code review to the reviewer agent and test writing to the test agent.
8586 ```
8687 </File>
88
89 <File filename="reviewer.md">
90 ```markdown
91 ---
92 name: reviewer
93 model: claude-haiku-4-5
94 ---
95
96 You are a code reviewer.
97 ```
98 </File>
99
100 <File filename="test-writer.md">
101 ```markdown
102 ---
103 name: test-writer
104 model: claude-haiku-4-5
105 ---
106
107 You write unit tests.
108 ```
109 </File>
87110 </MultiFileExample>
88111
89112 ```python Python
from line 258
235258* `{"type": "self"}` allows the coordinator to spawn copies of itself. If the session was created with [agent configuration overrides](https://platform.claude.com/docs/en/managed-agents/sessions#override-agent-configuration-for-a-session), those overrides also apply to these copies; roster entries referenced by ID are unaffected.
236259* `{"type": "advisor", "model": "<model id>"}` gives the session's primary thread an advisor it can consult mid-turn. At most one advisor entry per roster. See [Give the session an advisor](https://platform.claude.com/docs/en/managed-agents/multiagent-orchestration#give-the-session-an-advisor).
237260
261In an [`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/scripting#version-controlling-api-resources) agent file (the CLI tab), a roster entry can also be the path to another agent's file, such as `./reviewer.md`. Apply creates that agent first and replaces the path with a pinned `{"type": "agent", "id": ..., "version": ...}` reference.
262
238263The coordinator's configuration, including its `multiagent.agents` roster, is snapshotted when the coordinator is created or updated. Referenced agents stay pinned to the versions resolved at that time and do not automatically pick up later updates to their definitions. To delegate to a newer version of a referenced agent, [update the coordinator](https://platform.claude.com/docs/en/managed-agents/agent-setup#update-an-agent) so its roster references that version.
239264
240265The coordinator can only delegate to one level of agents; referencing an agent that has its own `multiagent.agents` roster fails the create or update request with a validation error. A maximum of 20 unique agents can be listed in `multiagent.agents`, but the coordinator can call multiple copies of each agent.
from line 453
428453
429454 <MultiFileExample language="cli" label="CLI">
430455 ```bash CLI
431 research_agent_id=$(ant beta:agents create --transform id --raw-output < researcher.agent.yaml)
456 ant apply coordinator.md researcher.md
432457 ```
433458
434 <File filename="researcher.agent.yaml">
435 ```yaml
459 <File filename="coordinator.md">
460 ```markdown
461 ---
462 name: coordinator
463 model: claude-opus-5
464 tools:
465 - type: agent_toolset_20260401
466 multiagent:
467 type: coordinator
468 agents: # path: ant apply substitutes {type: agent, id, version}
469 - ./researcher.md
470 ---
471 ```
472 </File>
473
474 <File filename="researcher.md">
475 ```markdown
476 ---
436477 name: researcher
437478 model: claude-haiku-4-5
438479 mcp_servers:
from line 483
442483 tools:
443484 - type: mcp_toolset
444485 mcp_server_name: github
486 ---
445487 ```
446488 </File>
447489
448 <File filename="subagent-coordinator.agent.yaml">
449 ```yaml
450 name: coordinator
451 model: claude-opus-5
452 tools:
453 - type: agent_toolset_20260401
454 multiagent:
455 type: coordinator
456 agents:
457 - type: agent
458 id: $research_agent_id # replace before running command
459 ```
460 </File>
461
462490 ```bash CLI
463 coordinator_id=$(ant beta:agents create --transform id --raw-output < subagent-coordinator.agent.yaml)
464
465491 session_id=$(ant beta:sessions create \
466492 --agent "$coordinator_id" \
467493 --environment-id "$environment_id" \