Multi-Agent Orchestration, Hooks & Sessions: Claude Architect Domain 1
Coordinator–subagent patterns, context passing, Agent SDK hooks, and session management — the second half of the Claude Architect exam's largest domain.

Lesson 2 of the Claude Certified Architect – Foundations course. This lesson completes Domain 1 (27% of the exam): coordinator–subagent architecture, explicit context passing, lifecycle hooks, workflow enforcement, and session management. Two of the six exam scenarios — the multi-agent research system and the customer support agent — lean heavily on this material.
Previous: Lesson 1 — Agentic Loops
Hub-and-Spoke: The Coordinator–Subagent Pattern
The exam's reference architecture is hub-and-spoke: a coordinator agent manages all inter-subagent communication, error handling, and information routing. Subagents never talk to each other directly.
Why route everything through the hub?
- Observability — one place to see every delegation and result
- Consistent error handling — failures propagate to one decision-maker
- Controlled information flow — the coordinator decides what each subagent needs to know
The coordinator's responsibilities: task decomposition, delegation, result aggregation, and deciding which subagents a query actually needs — a good coordinator dynamically selects subagents rather than always running the full pipeline.
The Classic Failure: Narrow Decomposition
The most heavily-tested Domain 1 failure mode: every subagent executes perfectly, yet the final output misses most of the topic. Root cause — the coordinator decomposed the task too narrowly (e.g., splitting "impact of AI on creative industries" into three visual-arts subtasks, omitting music, writing, and film). Diagnostic habit for the exam: when output coverage is wrong but every agent succeeded, look at what the coordinator assigned, not at the downstream agents.
Countermeasures worth knowing:
- Partition research scope so subagents get distinct subtopics or source types (minimizes duplication and gaps)
- Write coordinator prompts that specify research goals and quality criteria, not step-by-step procedures — this preserves subagent adaptability
- Add an iterative refinement loop: coordinator evaluates the synthesis for gaps, re-delegates targeted queries, re-invokes synthesis until coverage is sufficient
Context Passing: Nothing Is Inherited
The single most important fact about subagents: they do not inherit the coordinator's conversation history. Each subagent starts with an isolated context; everything it needs must be explicitly provided in its prompt.
Practical rules the exam tests:
- Pass complete findings from prior agents directly into the next subagent's prompt (e.g., web results + document analysis into the synthesis agent)
- Use structured formats that separate content from metadata — source URLs, document names, page numbers — so attribution survives the handoff
- Spawn parallel subagents by emitting multiple Task tool calls in a single coordinator response, not across separate turns
- The coordinator's
allowedToolsmust include"Task"or it cannot spawn subagents at all
Hooks: Deterministic Guarantees
Hooks intercept the agent lifecycle in code. The two patterns on the exam:
PostToolUse (result transformation). Intercept tool results before the model sees them. Canonical use: normalizing heterogeneous data from different MCP tools — Unix timestamps vs ISO 8601 dates, numeric vs string status codes — so the agent reasons over one consistent format.
Tool-call interception (policy enforcement). Intercept outgoing tool calls to block policy violations. Canonical use: block any process_refund above $500 and redirect to human escalation.
The framing to internalize: hooks give deterministic guarantees; prompts give probabilistic compliance. A system prompt saying "never refund more than $500" will usually work. A hook that blocks the call always works. When the scenario involves business rules with real consequences, choose the hook.
Workflow Enforcement with Prerequisite Gates
Same logic applies to ordering: if process_refund must never run before get_customer has returned a verified ID, implement a programmatic prerequisite gate that blocks the downstream call. Few-shot examples and "mandatory" language in the system prompt are the classic wrong answers here — they reduce but don't eliminate the failure rate.
Structured Handoffs to Humans
When escalating mid-process to a human who cannot see the transcript, compile a structured handoff summary: customer ID, root cause analysis, amounts involved, recommended action. "Escalate to a human" without the summary forces the human to restart the investigation.
Session Management: Resume, Fork, or Start Fresh
Three session decisions the exam tests:
| Situation | Right move |
|---|---|
| Continuing a named investigation across work sessions, prior context still valid | --resume <session-name> |
| Exploring two divergent approaches from one shared analysis baseline | fork_session — independent branches, shared starting context |
| Prior tool results are stale (code changed since analysis) | Start a new session with a structured summary injected — more reliable than resuming over stale results |
Middle-ground technique: if you resume after modifying files, tell the agent exactly which files changed so it re-analyzes only those, instead of re-exploring the whole codebase.
Hands-On Exercise
Extend Lesson 1's agent into a two-subagent research system:
- Coordinator with
allowedToolsincluding"Task", delegating to a search subagent and an analysis subagent. - Emit both Task calls in one response; measure latency vs sequential.
- Pass the search agent's findings explicitly into the analysis agent's prompt as structured claim–source pairs.
- Add a PostToolUse hook normalizing dates to ISO 8601 across both agents' tool results.
- Add a tool-call interception hook that blocks one operation above a threshold and verify it redirects to an escalation path.
Worked Exam Question
Your escalation path compiles a handoff for human agents, who currently receive: "Customer upset about order issue, please assist." Resolution times for escalated cases are 3x longer than direct-to-human cases. What is the most effective fix?
- A. Compile a structured handoff summary — customer ID, verified identity status, root cause analysis, amounts involved, and recommended action — since the human cannot see the conversation transcript.
- B. Give human agents read access to the raw conversation transcript and let them extract what they need.
- C. Reduce escalations by raising the agent's autonomy threshold so fewer cases reach humans.
- D. Route escalations to more senior human agents who resolve cases faster.
Answer: A. The 3x delay comes from humans re-investigating from scratch. A structured handoff transfers the agent's completed work — identity verification, root cause, figures — so the human starts at the decision point, not the beginning. Option B buries the signal in a wall of transcript; C suppresses the symptom by mishandling cases that genuinely need humans; D spends seniority on a problem information design solves.
Coordinator Design Checklist
Before the exam, be able to audit a coordinator design against this list — most Domain 1 scenario questions describe a violation of one item:
- Does every subagent receive its inputs explicitly in its prompt, with content separated from metadata (sources, dates, page numbers)?
- Does the decomposition cover the full topic scope, with distinct subtopics per agent to avoid both gaps and duplication?
- Are parallel-safe delegations emitted as multiple Task calls in one response, not spread across turns?
- Do delegation prompts state goals and quality criteria rather than step-by-step procedures?
- Is there a refinement loop — someone evaluating output for gaps and re-delegating with targeted queries?
- Do all results and errors flow back through the coordinator, never subagent-to-subagent?
- Are business rules enforced by hooks and prerequisite gates, with prompts reserved for judgment calls?
If a scenario shows healthy subagents and a bad outcome, work the list top-down: the first violated item is almost always the intended answer.
Key Takeaways for the Exam
- Hub-and-spoke: all communication through the coordinator, for observability and controlled flow.
- Coverage failures with healthy subagents → suspect narrow coordinator decomposition.
- Subagents inherit nothing; context is passed explicitly, structured, with metadata separated from content.
- Hooks for guarantees (normalization, policy blocks, prerequisite gates); prompts for guidance.
- Resume when context is valid, fork to compare approaches, start fresh with a summary when context is stale.
Next: Lesson 3 — Tool Design & MCP Integration
Frequently Asked Questions
Do subagents inherit the coordinator's conversation history?
No — and this is the single most-tested fact in multi-agent questions. Every subagent starts with an isolated context containing only what its prompt provides. If the synthesis agent needs the search agent's findings, the coordinator must pass those findings explicitly, ideally as structured data with content separated from metadata (source URLs, document names, dates) so attribution survives the handoff. "The subagent will see the earlier conversation" is always a wrong assumption.
When should I use hooks instead of prompt instructions?
Whenever a rule must hold 100% of the time. Prompt instructions produce probabilistic compliance — usually right, occasionally not — which is fine for tone and judgment but unacceptable for money, compliance, and ordering constraints. A PostToolUse hook deterministically normalizes every tool result; a tool-call interception hook deterministically blocks every over-limit refund. The exam phrase to watch for is "must never" or a financial consequence: both point to programmatic enforcement.
What is the difference between resuming and forking a session?
Resume (--resume with a session name) continues one investigation whose prior context is still valid. Fork (fork_session) branches two or more independent explorations off a shared analysis baseline — comparing testing strategies, say — without re-paying the analysis cost. And when prior tool results have gone stale because the code changed, do neither: start a fresh session and inject a structured summary of the prior conclusions instead.
