Skip to content

CCAR-P · Domain 1: Solution Design and Architecture · 18% of the exam

Task 1.4: Orchestrator and Subagent Decomposition

Judging how a multi-step job is split between an orchestrator and subagents against observability and error-recovery needs, and spotting where task boundaries, control flow or the merging of results will break.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.

Question 1 · choose 1

A pull-request service built on the Python Claude Agent SDK decomposes each review: the coordinator delegates to a reviewer subagent, the reviewer dispatches one verifier subagent per finding, and the coordinator writes its report from the reviewer's summary of verified findings.options = ClaudeAgentOptions( allowed_tools=["Read", "Grep", "Bash", "Agent"], agents={ "reviewer": AgentDefinition( description="Reviews the diff and returns verified findings", prompt=REVIEWER_PROMPT, tools=["Read", "Grep", "Agent"], ), "verifier": AgentDefinition( description="Reproduces one finding and reports whether it holds", prompt=VERIFIER_PROMPT, tools=["Read", "Bash"], ), }, )Reports often mark findings as unverified, and verifier reports then show up in the coordinator's conversation after the report is written. What should change?

  1. AAdd env={"CLAUDE_CODE_DISABLE_BACKGROUND_TASKS": "1"} to the options, so that Claude waits for subagents to finish before it continues
  2. BSet background=True in the verifier's definition, so that each verifier reports to the reviewer when it completes
  3. CSet maxTurns higher in the reviewer's definition, so that it keeps running until every verifier's report has arrived
  4. DSet model="inherit" in the verifier's definition, so that each verifier runs inside the reviewer's own context
Show the answer and why
  • AAdd env={"CLAUDE_CODE_DISABLE_BACKGROUND_TASKS": "1"} to the options, so that Claude waits for subagents to finish before it continues

    Correct

    Subagents start in the background by default, and in the SDK a spawning subagent waits only for foreground nested subagents.

  • BSet background=True in the verifier's definition, so that each verifier reports to the reviewer when it completes

    Incorrect

    A background nested subagent that outlasts its spawner reports to the main conversation, which is the symptom here.

  • CSet maxTurns higher in the reviewer's definition, so that it keeps running until every verifier's report has arrived

    Incorrect

    maxTurns caps the reviewer's turns; it doesn't make the reviewer wait for background verifiers.

  • DSet model="inherit" in the verifier's definition, so that each verifier runs inside the reviewer's own context

    Incorrect

    model only picks which model the verifier runs on; it doesn't change whether the reviewer waits for it.

With nothing configured, a subagent starts in the background. Nested subagents are allowed by default, and in claude -p and the Agent SDK the spawning subagent waits only for a foreground nested subagent; a background nested subagent that outlasts it reports to the main conversation instead. Setting CLAUDE_CODE_DISABLE_BACKGROUND_TASKS to 1 makes Claude wait for subagents to finish before it continues, so the verifiers' results reach the reviewer before it summarizes.

Question 2 · choose 2

A nightly incident job runs `claude -p --agent coordinator`. The decomposition says the coordinator may delegate only to the triage and reporter subagents, and triage must read logs itself and never delegate further. The current definitions in .claude/agents/ have these tools lines:# coordinator.md tools: Agent, Read # triage.md tools: Agent(log-reader), Read, BashTraces show the coordinator starting general-purpose subagents and triage starting subagents of several types. Which TWO changes enforce the task boundaries? (Choose TWO.)

  1. AChange the coordinator's tools line to Agent(triage, reporter), Read, so that only those two types can be spawned
  2. BRemove Agent from the tools line in triage.md, keeping Read and Bash so that it reads the logs itself
  3. CKeep Agent(log-reader) in triage.md and drop Read and Bash, so that delegating to log-reader is all triage can do
  4. DAdd triage and reporter to the coordinator's skills field, so that both are preloaded at startup
  5. ESet background to true in triage.md, so that triage runs detached and can't start subagents of its own
Show the answer and why
  • AChange the coordinator's tools line to Agent(triage, reporter), Read, so that only those two types can be spawned

    Correct

    For an agent running as the main thread with --agent, the Agent(type) list is an allowlist of spawnable types.

  • BRemove Agent from the tools line in triage.md, keeping Read and Bash so that it reads the logs itself

    Correct

    A subagent whose tools omit Agent can't spawn subagents of its own.

  • CKeep Agent(log-reader) in triage.md and drop Read and Bash, so that delegating to log-reader is all triage can do

    Incorrect

    Inside a subagent definition the type list in parentheses is ignored, so triage could still spawn any type.

  • DAdd triage and reporter to the coordinator's skills field, so that both are preloaded at startup

    Incorrect

    The skills field preloads skills into an agent's context; it doesn't choose which subagent types can be spawned.

  • ESet background to true in triage.md, so that triage runs detached and can't start subagents of its own

    Incorrect

    background decides whether Claude waits for the subagent; it doesn't remove the subagent's ability to spawn.

The Agent(agent_type) syntax restricts which subagent types can be spawned only for an agent running as the main thread with claude --agent. In a subagent definition, listing Agent lets that subagent spawn subagents of its own while the depth limit allows it, and any type list inside the parentheses is ignored. To keep a subagent from spawning, omit Agent from its tools list.

Question 3 · choose 1

A team asks Claude Code to run one dynamic workflow for a codebase audit: agents look for missing authorization checks in every route, a release manager approves the findings, fix agents then patch the approved routes, and Claude reports the result. Where will this design fail?

  1. AAt the approval: a run can't take user input midway, so each stage needs its own workflow
  2. BAt the fixes: workflow agents can't edit files, so patches go back to the main session
  3. CAt the report: every agent's result lands in Claude's context, which overflows on a large audit
  4. DAt the audit: workflow agents skip the session's permission checks, so their calls go unreviewed
Show the answer and why
  • AAt the approval: a run can't take user input midway, so each stage needs its own workflow

    Correct

    A run pauses on its own only for agent permission prompts and a usage-limit wait; sign-off needs a workflow per stage.

  • BAt the fixes: workflow agents can't edit files, so patches go back to the main session

    Incorrect

    Agents read, write and run commands; only the script itself has no filesystem or shell access.

  • CAt the report: every agent's result lands in Claude's context, which overflows on a large audit

    Incorrect

    Intermediate results stay in script variables; Claude's context holds only the final answer.

  • DAt the audit: workflow agents skip the session's permission checks, so their calls go unreviewed

    Incorrect

    Agents' tool calls receive the same permission checks and sandboxing as any other tool call in the session.

A dynamic workflow is a script that a runtime executes outside the conversation. The script holds the loop and the intermediate results, agents do the reading, writing and commands under the session's permission checks, and Claude's context receives only the final answer. A run takes no user input midway: it pauses on its own only for agent permission prompts and a usage-limit wait, so a sign-off between stages means running each stage as its own workflow.

Practice domain 1 →Practice all domains →