CertSafari
    Anthropic Claude Certified Architect – Professional (CCAR-P)· Lessons

    Domain 1 · Lesson 4/38

    Configuring coordinators and subagents in Managed Agents, the Agent SDK and Claude Code

    Design multi-agent systems and orchestration strategies

    13 min read
    2.83% of exam
    3 sources
    Published 19 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Configure a coordinator and predefined subagents in a Managed Agents multiagent block
    • Choose between subagents, dynamic workflows and an advisor in Managed Agents
    • Define specialised subagents with AgentDefinition in the Agent SDK
    • Choose between subagents, agent teams and dynamic workflows in Claude Code

    1.Managed Agents: the multiagent block

    A coordinator works the same way on every platform. It delegates to subagents, and each subagent runs in an isolated context and returns only a condensed result (see the companion page on designing multi-agent systems). What changes from platform to platform is where you declare the coordinator, its specialists and the alternatives to subagents. In Claude Managed Agents, you declare them in the multiagent block of the agent definition. With type multiagent_20261001, subagents and dynamic workflows are both on by default, and you can also give the session an advisor.

    The table below talks about threads, so one definition first. Each agent in a session runs in its own session thread: a context-isolated event stream with its own conversation history. The agent that the session runs reports in the primary thread, the session-level event stream, and every delegated agent gets an additional thread spawned at runtime. Whether a thread can be messaged again after its agent reports is what separates subagents from workflow runs.

    The three ways a Managed Agents session can involve other agents
    ApproachWho directs the workChoose it whenWatch for
    SubagentsThe agent delegates and reads each report. A subagent's thread persists, so the agent can send follow-upsThe agent needs to follow up with a subagent, or needs listed specialists with their own system prompts and toolsDelegation is one level deep, with at most 25 child threads per session, idle ones included
    Dynamic workflowsA program the agent writes runs many agents in phases in the background and combines their resultsMost work that needs several agents: audits, migrations, deep research, cross-checkingNo follow-ups to a run's threads, and every agent uses tokens, so set a session budget
    AdvisorOne agent does the work and consults an advisor model mid-turnOne agent should do the work, with stronger judgment at planning or final reviewOnly the primary thread can consult it, and consultations are billed at the advisor model's rates

    You decide which of these the agent may use, and the agent decides when to use them. Steer that decision in the system prompt, for example by telling the agent when to start a workflow run. The coordinator below is a lead that lists two specialists by ID. Its system prompt is a short routing brief: send review work to the reviewer and test writing to the test writer. The reviewer and test writer are separate agents running claude-haiku-5-5, each with its own one-line system prompt.

    A coordinator agent definition that lists two predefined subagents and routes work to themyaml
    ---
    name: Engineering Lead
    model: claude-opus-5-5
    tools:
      - type: agent_toolset_20260401
    multiagent:
      type: multiagent_20261001
      subagents:
        type: enabled
        predefined_agents:
          - type: agent
            id: $REVIEWER_AGENT_ID
          - type: agent
            id: $TEST_WRITER_AGENT_ID
    ---
    
    You coordinate engineering work. Delegate code review to the reviewer agent
    and test writing to the test agent.

    Checkpoint 1 of 5· Fill the gap

    The Engineering Lead must hand review and test writing to two specialists you have already created, each with its own system prompt, and must be able to send them follow-up questions after they report. Which key under the multiagent block completes this definition?

    ---
    name: Engineering Lead
    model: claude-opus-5-5
    tools:
      - type: agent_toolset_20260401
    multiagent:
      type: multiagent_20261001
       ? :
        type: enabled
        predefined_agents:
          - type: agent
            id: $REVIEWER_AGENT_ID
          - type: agent
            id: $TEST_WRITER_AGENT_ID
    ---
    
    You coordinate engineering work. Delegate code review to the reviewer agent
    and test writing to the test agent.

    Sources1

    2.Predefined and inline agents, and the limits on them

    Each subagent is either predefined or inline. A predefined agent is one you have already created and listed. It runs with its own model, system prompt, tools, MCP servers and skills. An inline agent isn't saved anywhere. The coordinator, or a workflow, defines it at the moment it hands out the work, and it uses the coordinator's model, tools, MCP servers and skills. Inline agents are on by default, so unless you turn them off, the coordinator can create helpers you never reviewed.

    Inline agents have no definition of their own, so you can't use one to narrow their access. They take on the MCP servers and tools of the agent the session runs. To give a specialist tools the coordinator doesn't have, make it a predefined agent. In the GitHub example, only a predefined researcher declares the GitHub MCP server, so the coordinator never has access to it. To allow only the agents you list, set inline_agents to {"type": "disabled"} under subagents and under workflows. Each setting with inline agents off needs at least one agent in its list, or the request fails with a 400 error.

    Inline agents turned off: the agent may delegate to one listed agent and to copies of itself, and a workflow may use version 2 of another agentjson
    {
      "multiagent": {
        "type": "multiagent_20261001",
        "subagents": {
          "type": "enabled",
          "inline_agents": { "type": "disabled" },
          "predefined_agents": ["agent_01J8XkN5uT3vHpLqRfWdY2", { "type": "self" }]
        },
        "workflows": {
          "type": "enabled",
          "inline_agents": { "type": "disabled" },
          "predefined_agents": [
            { "type": "agent", "id": "agent_01Lm4cV8yQ2tNs7XbKdR5h", "version": 2 }
          ]
        }
      }
    }

    The two predefined_agents lists are separate. Listing an agent under subagents does not make it available to workflows, and the reverse is also true. Four rules apply to both lists:

    • Pinning: when you create or update the coordinator, each referenced agent is pinned to its version at that moment. Later edits to that agent don't reach the coordinator until you update the coordinator's list.
    • One level: listing an agent that has its own multiagent block fails with a 400 validation error.
    • Up to 20 agents per list: the coordinator can still run several copies of each one, within the session's thread limit.
    • Same inference geography: every listed agent must pin the same inference_geo as the coordinator, or none of them may pin one.

    Checkpoint 2 of 5· Check yourself

    A helper needs to call the GitHub MCP server, but the coordinator must never get GitHub access itself. Which setup gives only the helper that access?

    Checkpoint 3 of 5· Check yourself

    After the Engineering Lead coordinator is created, you edit the reviewer agent it lists and save a new version. The coordinator itself is left unchanged. What happens when the lead next delegates review work?

    Sources1

    3.Agent SDK: defining subagents with AgentDefinition

    In the Claude Agent SDK, the coordinator is the agent that query() runs, and you declare its specialists in the agents option. Each one is an AgentDefinition keyed by name. There are two other routes. You can write agents as markdown files in .claude/agents/ directories. And Claude can call the built-in general-purpose subagent through the Agent tool without you defining anything. Include Agent in the coordinator's allowed_tools so it can delegate without asking for approval.

    One specialist in the agents option: when to use it, its brief, a read-only tool list and a model overridepython
    "code-reviewer": AgentDefinition(
                        # description tells Claude when to use this subagent
                        description="Expert code review specialist. Use for quality, security, and maintainability reviews.",
                        # prompt defines the subagent's behavior and expertise
                        prompt="""You are a code review specialist with expertise in security, performance, and best practices.
    
    When reviewing code:
    - Identify security vulnerabilities
    - Check for performance issues
    - Verify adherence to coding standards
    - Suggest specific improvements
    
    Be thorough but concise in your feedback.""",
                        # tools restricts what the subagent can do (read-only here)
                        tools=["Read", "Grep", "Glob"],
                        # model overrides the default model for this subagent
                        model="sonnet",
                    ),
    AgentDefinition fields that carry the design decisions
    FieldRequiredDesign role
    descriptionYesTells the coordinator when to use this subagent, which makes it the routing signal
    promptYesThe subagent's system prompt: its role, expertise and constraints
    toolsNoAllowed tools. If omitted, the subagent inherits every tool available to subagents
    disallowedToolsNoRemoves named tools. mcp__server removes every tool from that MCP server
    modelNoPer-agent model: an alias such as 'haiku', 'inherit', or a full model ID
    maxTurnsNoCaps agentic turns. At the limit, the output comes back marked as partial

    The same example defines a second specialist, test-runner, with Bash, Read and Grep. It gets Bash because running tests is its job. The reviewer stays read-only. Each specialist gets the tools its brief calls for, and no more.

    Checkpoint 4 of 5· Fill the gap

    This code-reviewer specialist must be able to inspect the codebase but never change it. Which tool name completes its tools list without breaking that guarantee?

    "code-reviewer": AgentDefinition(
                        # description tells Claude when to use this subagent
                        description="Expert code review specialist. Use for quality, security, and maintainability reviews.",
                        # prompt defines the subagent's behavior and expertise
                        prompt="""You are a code review specialist with expertise in security, performance, and best practices.
    
    When reviewing code:
    - Identify security vulnerabilities
    - Check for performance issues
    - Verify adherence to coding standards
    - Suggest specific improvements
    
    Be thorough but concise in your feedback.""",
                        # tools restricts what the subagent can do (read-only here)
                        tools=["Read", "Grep", " ? "],
                        # model overrides the default model for this subagent
                        model="sonnet",
                    ),

    Sources2

    4.Claude Code: subagents, agent teams or a dynamic workflow

    Claude Code offers several ways to run work in parallel. Three of them are coordination patterns, and each one fits a different kind of work.

    Choosing a coordination pattern in Claude Code
    PatternWhat it isUse it when
    SubagentsDelegated workers inside one session that do a side task in their own context and return a summaryA side task would flood the main conversation with search results, logs or file contents you won't need again
    Agent teamsMultiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and off by defaultClaude should split a project into pieces, assign them, and keep the workers in sync
    Dynamic workflowsA script that runs many subagents and cross-checks their resultsThe job outgrows a handful of subagents, or findings need to be verified against each other

    The main difference is how the workers communicate. Subagents talk only to the session that started them, and each returns a single summary, so they suit isolated side tasks such as investigating one bug across dozens of files. Teammates in an agent team are peer sessions. They share a task list and message one another, which helps when pieces of a project depend on each other's progress. That shared state also brings back the coordination cost that subagents avoid. A dynamic workflow takes coordination out of the conversation entirely: a script runs the subagents and checks their results against each other, for jobs too big to manage one turn at a time. Agent teams are a Claude Code feature. They are experimental and must be turned on before use.

    Checkpoint 5 of 5· Check yourself

    In Claude Code, you want to find out why one test fails intermittently. That means reading CI logs and dozens of source files. You need only the root cause back, and the main conversation should stay focused on your feature work. Which coordination pattern fits?

    Sources3

    Practise it for real

    Create a Managed Agents coordinator that delegates code review and test writing to two predefined subagents. You write each agent as a markdown file, ant apply creates the agents from those files, and claude-lock.json records the ID it assigned to each file under a .resources map keyed by file path.

    1. 1.Write reviewer.md and test-writer.md, each with a name, model: claude-haiku-5-5 and a one-line system prompt. Run ant apply reviewer.md test-writer.md.

      Why: Predefined subagents must exist before a coordinator can list them by ID, and ant apply is the command that creates them from the files.

      You should see: claude-lock.json now holds an ID for each file under .resources.

    2. 2.Read the IDs with jq -er '.resources["./reviewer.md"].id' claude-lock.json, and do the same for test-writer.md.

      Why: The coordinator's predefined_agents list references agents by ID, and the lock file is where those IDs are recorded.

      You should see: Two agent IDs in shell variables.

    3. 3.Write engineering-lead.md with model claude-opus-5-5, a multiagent block of type multiagent_20261001 that lists both IDs under subagents.predefined_agents, and a routing system prompt. Run ant apply on all three files.

      Why: The coordinator definition pins both subagents at their current versions and tells the lead when to use each.

      You should see: The lead agent is created. Listing an agent that has its own multiagent block would fail with a 400 instead.

    4. 4.Create a session with client.beta.sessions.create(agent=lead_agent.id, environment_id=environment.id) and ask for a review and tests. Here client is your API client, lead_agent is the lead you just created, and environment is an existing environment for the session to run in; have these ready before this step.

      Why: Delegation happens at runtime: the lead decides when to call each subagent.

      You should see: The lead reports in the primary thread, and each delegated subagent appears as its own session thread.

    Stuck? Get a nudge

    If you also want to block helpers you didn't define, set subagents.inline_agents to {"type": "disabled"}. Your list already has entries, so the 400 error won't trigger.

    Sources

    (3)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Delegation is one level deep, and a session can have at most 25 child threads at a time, idle ones included.”
      ↩︎ Managed Agents: the multiagent block
      “each agent runs in its own session thread, a context-isolated event stream with its own conversation history.”
      ↩︎ Managed Agents: the multiagent block
      “A subagent's thread stays available until you archive it, so the agent can send it follow-up messages.”
      ↩︎ Managed Agents: the multiagent block
      “The agent can't send follow-up messages to a run's threads, and the server archives each one by the end of its run.”
      ↩︎ Managed Agents: the multiagent block
      “An inline agent has no agent definition, so it uses the MCP servers and tools of the agent that the session runs.”
      ↩︎ Predefined and inline agents, and the limits on them
      “subagents.predefined_agents and workflows.predefined_agents are two separate lists.”
      ↩︎ Predefined and inline agents, and the limits on them
      “Inline agents are on by default under both settings.”
      ↩︎ Predefined and inline agents, and the limits on them
      “The predefined_agents list of subagents can list up to 20 unique agents.”
      ↩︎ Predefined and inline agents, and the limits on them
      “Referenced agents stay pinned to the versions resolved then and don't pick up later updates to their definitions.”
      ↩︎ Exam trap 1
      “Referencing another agent that has multiagent set fails the create or update request with a 400 validation error.”
      ↩︎ Exam trap 2
      “Referenced agents stay pinned to the versions resolved then and don't pick up later updates to their definitions.”
      ↩︎ Checkpoint
    2. 2.
      “Filesystem-based: define agents as markdown files in .claude/agents/ directories.”
      ↩︎ Agent SDK: defining subagents with AgentDefinition
      “Claude can invoke the built-in general-purpose subagent at any time via the Agent tool without you defining anything”
      ↩︎ Agent SDK: defining subagents with AgentDefinition
      “intermediate tool calls and results stay inside the subagent; only its final message returns to the parent.”
      ↩︎ Checkpoint
    3. 3.
      “Delegated workers inside one session that do a side task in their own context and return a summary”
      ↩︎ Claude Code: subagents, agent teams or a dynamic workflow
      “Multiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and disabled by default”
      ↩︎ Claude Code: subagents, agent teams or a dynamic workflow
      “A script that runs many subagents and cross-checks their results, for work too big to coordinate one turn at a time”
      ↩︎ Claude Code: subagents, agent teams or a dynamic workflow

    Ready to test yourself?

    Practise the 12 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.