Skip to content

CCAR-F : Agentic Architecture & Orchestration (Domain 1)

Domain 1 : Agentic Architecture & Orchestration

20 questionsmedium

This study guide is designed for candidates preparing for the Anthropic Claude Certified Architect – Foundations (CCAR-F) exam. Domain 1, Agentic Architecture & Orchestration, represents 27% of the total exam weight, making it the most significant competency area. This domain validates an architect’s ability to design, implement, and manage autonomous workflows, multi-agent coordination, and the technical mechanisms that allow Claude to interact with external tools and systems at an enterprise scale.

The Foundations of Agentic Systems and Architecture

GenAI has evolved from simple chat interfaces to production-grade agentic systems. An agentic system differs from a standard LLM implementation by its ability to act autonomously within a defined environment. In the Claude ecosystem, an agent is characterized by its ability to engage in a continuous execution loop: receiving a request, selecting a tool, executing that tool, and refining its next action based on the result.

Architects must move away from rigid, pre-configured decision trees. Instead, agentic architecture relies on model-driven decisions where Claude determines the necessary path based on real-world inputs and the tools available to it. This transition requires a deep understanding of the lifecycle of an agentic loop and the technical indicators that govern state transitions.

Implementing the Core Agentic Loop: Mechanism and Execution

The agentic loop is the fundamental lifecycle of an autonomous workflow. It is not a single-turn interaction but a multi-stage process that repeats until a specific objective is met. The standard lifecycle follows a structured flow:

  1. Request Submission: The application submits a prompt and context to Claude.
  2. State Evaluation: Claude processes the input and returns a response.
  3. Stop Reason Inspection: The application must programmatically inspect the stop_reason provided by the API.
  4. Tool Execution: If the stop_reason indicates a tool is required, the application executes the tool code.
  5. Context Integration: The output of the tool is appended back into the conversation history.
  6. Iteration: The updated history is sent back to Claude, beginning the loop again.

In production environments, this loop must be bounded. Architects must implement safe termination limits, such as a maximum number of iterations, to prevent infinite loops and uncontrolled token consumption.

Handling stop_reason: ‘tool_use’ vs ‘end_turn’ in Claude

The most critical technical indicator in an agentic loop is the stop_reason. The Claude API utilizes this field to communicate whether the model has finished its task or is requesting an action.

  • tool_use: When Claude identifies that a specific tool is required to fulfill the user’s request, it returns a stop_reason of tool_use. The response will contain a tool_use block with the tool’s name and the parameters Claude has generated for it. The conversation protocol is strict: the application must return a tool_result message for every tool_use block before Claude can generate another response. Failing to do so or sending a new user message instead will result in a validation error.
  • end_turn: This indicates that Claude has completed its response or fulfilled the task and does not require further tool execution. This is the signal for the agentic loop to terminate successfully.

Architects must ensure their orchestration logic is built to differentiate between these two states deterministically. Handling these reasons correctly ensures the conversation remains syntactically valid and allows the model to “auto-correct” if it receives a descriptive error back from a tool execution.

Advanced Orchestration: The Coordinator-Subagent Topology

For complex enterprise tasks, a single-agent approach often leads to context bloat and reasoning failures. The preferred architectural design is the hub-and-spoke or coordinator-subagent pattern.

In this topology, a central coordinator agent acts as the primary intelligence hub. It analyzes the incoming request, performs task decomposition, and invokes specialized subagents to handle specific domains (e.g., a “Search Subagent,” a “Code Subagent,” or a “Synthesis Subagent”).

The Task Tool and allowedTools

Delegation in this model is executed via a specialized Task tool. The coordinator agent does not simply “talk” to subagents; it invokes them as if they were programmatic tools. For a coordinator to successfully spawn subagents, its configuration parameter allowedTools must explicitly include “Task.”

This allows the coordinator to:

  • Decompose a high-level goal into smaller, manageable subtasks.
  • Assign those subtasks to subagents with specific skill sets.
  • Monitor the progress of subagents and synthesize their outputs into a final response.

Subagent Context Isolation and Information Injection

A frequent point of failure in multi-agent systems is the assumption that subagents share the same memory as the coordinator. In the Claude Agent SDK, subagents operate with isolated conversation contexts. They do not automatically inherit the coordinator’s history, past findings, or metadata.

To ensure subagents are effective, the architect must programmatically inject relevant information directly into each subagent’s prompt. This includes:

  • Specific findings from previous search iterations.
  • Metadata synthesized by other subagents.
  • The specific constraints or rules the subagent must follow.

Failure to perform this explicit injection results in subagents producing incomplete or irrelevant results, as they lack the “big picture” available to the coordinator.

Task Decomposition Strategies: Prompt Chaining vs. Adaptive Decomposition

How an architect chooses to break down a task significantly impacts system reliability and latency. There are two primary strategies:

Prompt Chaining (Static Pipelines)

Prompt chaining involves sequential passes where the output of one agent becomes the input for the next in a fixed, mandatory workflow. This is best for predictable, high-volume tasks such as a multi-aspect Pull Request review. By using separate passes for style, security, and documentation, the architect prevents “attention dilution” and ensures each aspect is reviewed rigorously. Static chains are highly reliable for deterministic workflows.

Adaptive Decomposition (Dynamic Exploration)

Adaptive decomposition allows the model to generate new subtasks dynamically as it discovers information. The coordinator might generate an initial investigation plan and then, based on the findings of a search subagent, spawn new subtasks that weren’t part of the original plan. This is ideal for research or troubleshooting tasks where the path to a solution is not known upfront.

Programmatic Prerequisites vs. Prompt Guidance

When designing agentic workflows, architects must decide between enforcing rules through prompt instructions (guidance) or through programmatic gates (prerequisites).

  • Prompt Guidance: Using instructions like “Only access the database if the user provides an ID” is vulnerable to prompt injection and model hallucinations. It is a “soft” constraint.
  • Programmatic Prerequisites: A more robust approach is to implement prerequisite gates. Before the agent is even allowed to execute a tool, the application code checks for necessary variables or states. If the prerequisites are not met, the application blocks the tool call and returns a validation message to the agent. This ensures that out-of-bounds inputs are handled prior to model execution, significantly increasing system security and reliability.

Data Normalization via Agent SDK Hooks (PostToolUse)

Enterprise systems often interact with heterogeneous data sources that provide information in conflicting formats. For example, three different database tools might return dates as UNIX timestamps, ISO 8601 strings, and custom system logs. Presenting this raw, inconsistent data to Claude can cause parsing failures or reasoning errors.

The Claude Agent SDK provides lifecycle hooks, such as PostToolUse, to address this. A PostToolUse hook can intercept the output of a tool call before it is appended to the conversation context. This allows the architect to:

  • Normalize Data: Convert various date formats into a single standard.
  • Validate Payloads: Ensure the tool output matches the expected JSON schema.
  • Enforce Limits: Truncate overly large outputs that might cause context bloat.
  • Anonymize PII: Strip sensitive information before the model sees the data.

By normalizing data at the hook level, the architect maintains a clean, high-utility context for Claude, leading to more accurate and deterministic outcomes.

Designing for Reliability: Escalation Triggers and Exception Handling

No agentic system is perfectly autonomous; architects must design clear escalation paths for when an agent encounters an edge case or fails to progress.

Deterministic Validation vs. Self-Reported Confidence

A major architectural anti-pattern is relying on Claude’s self-reported confidence scores to trigger human escalation. LLMs are notoriously poorly calibrated regarding their own accuracy. Instead, escalation should be triggered by deterministic validation metrics, such as:

  • Consecutive tool failures or syntax errors.
  • Empty database returns despite valid parameters.
  • Schema validation mismatches in structured output pipelines.
  • Execution timeouts or transient fault thresholds.

Structured Error Propagation

When a tool execution fails, the system must return a structured error payload to Claude rather than a silent failure or a raw system error. A well-designed error response should include:

  • isError: Set to true.
  • errorCategory: Distinguishing between transient (network), validation (input), or permission failures.
  • isRetryable: A Boolean flag indicating if Claude should attempt the call again with modified inputs.

Passing a descriptive syntax error back to the model often allows it to auto-correct its next tool call, whereas a raw timeout should be handled by a transient retry logic within the application code itself to save reasoning cycles.

Session State Management and Context Preservation

Managing state across long-running or interrupted sessions is a core requirement for enterprise applications. Claude provides several mechanisms for session management:

  • —resume: This command allows a system to pick up a session from its last known state, maintaining continuity without re-processing the entire initial context.
  • fork_session: Used to isolate context generation paths. This is particularly useful in automated workflows or complex research where an architect wants to explore a specific reasoning path without polluting the “main” session history.
  • Context Compaction (/compact): As a session grows, the token count can lead to high latency and retrieval inaccuracies (the “lost-in-the-middle” effect). The /compact command compresses the active session log, preserving summaries of past actions and current objectives while discarding redundant terminal outputs or intermediate tokens.
  • Session State Preservation: In scenarios like Customer Support Agents, architects must ensure that transient faults do not result in the loss of session state. This involves persisting the conversation history to an external database and reloading it based on a session ID.

Scaling for Enterprise Performance: Parallel Execution and Batching

To meet Service Level Agreements (SLAs), architects must optimize for both cost and latency.

Parallel Subagent Execution

In a hub-and-spoke system, the coordinator can spawn multiple subagents to work in parallel. For example, a research system could simultaneously search the web, query internal documentation, and analyze a codebase. This significantly reduces the total turnaround time compared to a sequential execution model.

Message Batches API

For high-throughput asynchronous workloads, such as a structured data extraction pipeline processing 50,000 documents, the Message Batches API is the preferred design choice.

  • Cost: Organizations receive a 50% discount on tokens.
  • Latency: Requests are processed within a 24-hour window.
  • SLA Modeling: Architects must calculate the submission frequency to meet specific turnaround times. For a 30-hour SLA, batches must be submitted at least every 6 hours ($6 + 24 \le 30$).
  • Constraints: Note that the Batch API generally does not support multi-turn interactive tool calling, making it suitable for extraction rather than interactive agents.

Architectural Anti-Patterns to Avoid

Anti-PatternRiskCorrected Pattern
Broad Tool AccessIncreases selection errors and latency; introduces security vulnerabilities.Least-Privilege Scoping: Limit agents to specific tools required for their role.
Self-Assessed ConfidenceLLMs are overconfident and poorly calibrated, leading to error leakage.Deterministic Gates: Use quantitative metrics (timeouts, schema errors) for escalation.
Prompt-Based SecurityInstructions to “be safe” are easily bypassed via injection.Programmatic Prerequisites: Enforce safety and compliance through application-level code.
Single Large ContextLeads to reasoning degradation and “lost-in-the-middle” failures.Decomposition: Break complex tasks into focused, sequential, or parallel steps.
Flat Multi-Agent NetworkCauses execution locks and untraceable error propagation.Hub-and-Spoke Topology: Use a centralized coordinator to manage communication.

Short-Answer Questions

1. What is the primary difference between the tool_use and end_turn stop reasons in a Claude API response? Answer: tool_use indicates the model is requesting the execution of an external tool with specific parameters, whereas end_turn indicates the model has completed its response or task and no further action is required.

2. Why is context isolation a critical consideration when designing coordinator-subagent patterns? Answer: Subagents do not automatically inherit the conversation history of the coordinator, so relevant findings and metadata must be explicitly injected into their prompts to ensure they have the necessary context to perform their tasks.

3. What is the function of the PostToolUse hook in the Claude Agent SDK? Answer: It intercepts the output of a tool call before it is added to the conversation history, allowing the architect to normalize data formats, validate payloads against schemas, or anonymize sensitive information.

4. How does the use of programmatic prerequisite gates improve upon simple prompt guidance for security? Answer: Programmatic gates enforce hard constraints in the application logic that the model cannot bypass via prompt injection, ensuring that tools are only called when specific, validated conditions are met.

5. Under what circumstances should an architect choose a sequential prompt chain over a dynamic adaptive decomposition? Answer: Sequential chains should be used for predictable, mandatory workflows (like standard PR reviews) to ensure consistency, while adaptive decomposition is better for exploratory tasks where subtasks are determined by real-time discovery.

6. What technical configuration is required for a coordinator agent to spawn and manage subagents? Answer: The coordinator must have access to a specialized “Task” tool, and this tool must be explicitly listed in the agent’s allowedTools configuration parameter.

7. What is the benefit of the /compact command in long-running development sessions? Answer: It reduces context bloat and token costs by compressing the session log into summaries of past modifications and objectives while discarding redundant output tokens.

8. Why is “self-reported confidence” considered an unreliable metric for human escalation in agentic systems? Answer: LLMs are often poorly calibrated and may report high confidence even when hallucinating or failing, making deterministic validation metrics (like schema mismatches) a more reliable trigger for escalation.

9. How can an architect use XML tags to improve the reliability of multi-part inputs? Answer: XML tags create explicit machine-readable boundaries between different types of content (e.g., user profiles vs. reference documents), preventing the model from conflating instructions and improving its ability to target specific data.

10. In a multi-agent system, how does a “synthesis subagent” obtain the findings from a “search subagent”? Answer: The coordinator agent must collect the search findings and programmatically include them in the prompt provided to the synthesis subagent, as there is no shared memory between the two.

Open-Ended Design Questions for Reflection

  1. Scenario: You are designing an agent to manage a corporate database. How would you structure the allowedTools and programmatic prerequisites to ensure the agent can retrieve information for any employee but can only modify records for employees within its own department?
  2. Scenario: A multi-agent research system is experiencing high latency. Upon inspection, you find that the coordinator is transferring 80k tokens of context to every subagent for every task. Propose a context management strategy to reduce this latency without losing critical information.
  3. Scenario: You have a tool that occasionally encounters transient network timeouts. Describe the architectural difference between handling this failure within the tool’s code versus passing the error back to Claude to handle as part of the agentic loop.
  4. Scenario: Compare the use of a single monolithic tool that “manages files” versus five granular tools (Read, Write, Edit, Grep, Glob). In what scenarios would the monolithic approach be a better or worse architectural choice?
  5. Scenario: An agentic workflow is being integrated into a CI/CD pipeline using Claude Code. Explain how you would use the --json-schema and --output-format json flags to ensure the agent’s final report can be parsed by a downstream automated deployment script.

Glossary of Key Terms

  1. Agentic Loop: The continuous cycle of model request, state evaluation, tool execution, and context update that defines autonomous AI behavior.
  2. stop_reason: An API response field that indicates why the model stopped generating text (e.g., to use a tool or because it finished the turn).
  3. Coordinator-Subagent Pattern: A hub-and-spoke multi-agent topology where a central hub manages specialized sub-agents for task decomposition and execution.
  4. Context Isolation: The architectural property where subagents do not share or inherit the conversation history of the coordinator or other agents.
  5. Task Tool: The specialized mechanism used by a coordinator agent to delegate subtasks to subagents.
  6. allowedTools: A configuration parameter that defines the specific set of tools an agent is authorized to invoke.
  7. PostToolUse: A lifecycle hook in the Agent SDK used to intercept and process tool outputs before they reach the model.
  8. Data Normalization: The process of converting heterogeneous data formats from multiple sources into a single, consistent standard.
  9. Prerequisite Gates: Hard-coded programmatic checks that must be satisfied before an agent is permitted to execute a tool.
  10. Prompt Chaining: A static, sequential workflow where multiple model passes are used to process information in stages.
  11. Adaptive Decomposition: A dynamic orchestration strategy where the model generates and assigns subtasks based on real-time discovery.
  12. Context Compaction: The process of summarizing long conversation histories to fit within token limits and maintain reasoning accuracy.
  13. fork_session: A command used to create an isolated path for context generation without affecting the main session history.
  14. Deterministic Validation: The use of quantitative, rule-based metrics (rather than LLM intuition) to verify the correctness of an output or trigger escalation.
  15. Prompt Injection: A security vulnerability where malicious content within a user’s data attempts to override the model’s system instructions.
  16. Hub-and-Spoke: An architectural topology characterized by a central coordinator managing multiple specialized “spoke” agents.
  17. Message Batches API: An asynchronous API used for high-volume tasks that offers cost savings in exchange for higher latency.
  18. isRetryable: A Boolean flag returned in tool error responses that instructs the model whether it should attempt to call the tool again.
  19. —resume: A session management command that allows a system to continue a previous conversation from its last stored state.
  20. Attention Dilution: A degradation in model performance that occurs when it is forced to process too many complex, unrelated instructions in a single pass.

Leaderboard

No scores saved yet. Be the first!

20 Questions — Domain 1 : Agentic Architecture & Orchestration

Expand any question to reveal the correct answer and explanation.

  1. 1 A solution architect is designing a customer support agent that must process high-value refunds. To ensure strict adherence to a policy that requires human approval for any refund exceeding $500, which implementation strategy should be prioritized for maximum reliability?

    Consider the difference between probabilistic and deterministic enforcement mechanisms.

    Implement a programmatic tool call interception hook that validates the refund amount before execution.

    Programmatic hooks provide deterministic enforcement of business rules that cannot be bypassed by the model's output generation.

    • Include the $500 threshold as a strict negative constraint in the system prompt.

      Prompt-based constraints are probabilistic and can be bypassed through prompt injection or model hallucinations.

    • Configure the agent to output a 'requires_approval' boolean field in its structured JSON response.

      Relying on the agent to self-report its need for approval is unreliable as the model may incorrectly calculate the value or ignore the rule.

    • Use a few-shot prompting approach with several examples of the agent correctly escalating large refunds.

      While few-shot prompting improves accuracy, it does not provide the absolute guarantee required for financial compliance.

  2. 2 In a multi-agent research system, a 'Synthesis' subagent consistently fails to include data retrieved by the 'Web Search' subagent. The developer confirms the search logs contain the missing information. What is the most likely architectural failure?

    Recall the isolation principles governing subagent conversation histories.

    The coordinator failed to explicitly inject the findings of the 'Web Search' subagent into the 'Synthesis' subagent's prompt.

    Subagents operate with isolated contexts and do not automatically inherit conversation history; the coordinator must programmatically pass findings.

    • The subagents are not sharing the same persistent memory or scratchpad file.

      While scratchpads exist, the primary issue in this pattern is usually the explicit flow of data between isolated instances.

    • The 'Web Search' subagent has a smaller context window than the 'Synthesis' subagent.

      Context window size might cause truncation but would not explain a total failure to transfer data already confirmed in logs.

    • The coordinator is using a sequential pipeline rather than a hub-and-spoke topology.

      A sequential pipeline would still pass inputs to the next stage; the error lies in the data passing mechanism itself.

  3. 3 An architect needs to minimize the total execution latency for a system that must analyze 10 different documents in parallel. What is the most efficient way to orchestrate this using the Claude Agent SDK?

    Think about how tool calls are emitted and processed in a single model turn.

    Instruct the coordinator to emit 10 separate Task tool calls within a single response turn.

    Emitting multiple tool calls in one turn allows the application to spawn parallel subagents, reducing latency to the duration of the longest single task.

    • Loop through each document sequentially within a single agentic loop iteration.

      Sequential processing results in additive latency where the total time equals the sum of all individual analysis times.

    • Use the Message Batches API to process the documents asynchronously.

      The Message Batches API is optimized for throughput and cost but has an SLA of up to 24 hours, which increases latency.

    • Deploy 10 identical agents and use a load balancer to distribute the documents.

      This approach introduces unnecessary infrastructure complexity compared to the SDK's native parallel tool-calling capabilities.

  4. 4 A production agentic loop enters an infinite cycle where it calls the same tool repeatedly with identical parameters. Which debugging step is most likely to identify the root cause based on the standard agentic loop lifecycle?

    The model's reasoning depends entirely on the context provided in each iteration.

    Verify if the application is correctly appending the tool_result back to the conversation history.

    If tool results are not appended to the context, Claude will perceive the state as unchanged and attempt to call the tool again.

    • Check if the max_tokens parameter is set high enough to allow the agent to finish.

      Insufficient max_tokens would cause truncation, not a repetitive loop with identical tool calls.

    • Monitor the stop_reason to see if it is stuck on 'end_turn'.

      'end_turn' would terminate the loop; the repetition implies the stop_reason is consistently 'tool_use'.

    • Increase the temperature of the model to encourage more diverse tool selection.

      Increasing temperature is a stochastic fix that does not address the underlying architectural failure of state preservation.

  5. 5 When implementing a hub-and-spoke multi-agent system, what configuration is mandatory for the coordinator agent to successfully spawn subagents?

    Identify the specific tool required for subagent delegation in the Claude Agent SDK.

    The coordinator's allowedTools configuration must explicitly include 'Task'.

    The 'Task' tool is the specific primitive used by the Agent SDK to initiate subagent lifecycles.

    • The system prompt must define a 'spawning' role.

      While roles are helpful for prompting, they are not a functional requirement for the SDK's spawning mechanism.

    • The coordinator must be running on a model with at least $200,000$ tokens of context.

      Spawning subagents is a feature of the orchestration logic and is not limited by a specific context window size.

    • The coordinator must use 'tool_choice': 'any' to ensure it delegates tasks.

      Forcing tool use can be useful, but the presence of the 'Task' tool in allowedTools is the fundamental requirement.

  6. 6 A solution architect is designing a PostToolUse hook to process data from three different MCP servers that return timestamps in Unix, ISO 8601, and custom system string formats. What is the primary benefit of this design?

    Focus on the impact of data consistency on LLM reasoning and parsing.

    It prevents parsing failures and reasoning errors by providing Claude with a normalized standard format.

    Normalization via hooks ensures the model receives consistent data, preventing it from struggling with heterogeneous formats from different tools.

    • It reduces the token cost by compressing the timestamp data.

      While normalization might change token count slightly, its primary purpose is structural consistency, not compression.

    • It allows the agent to bypass the agentic loop and finish the task faster.

      Hooks occur within the loop iterations and do not change the fundamental loop lifecycle.

    • It enables the model to automatically retry tool calls that return malformed data.

      Hooks are for processing successful calls; error recovery for malformed data is typically handled via schema validation or retry logic.

  7. 7 During a research task, a multi-agent system's coordinator discovers that its search subagent has returned two conflicting estimates for a market's size: $\$50B$ from a blog post and $\$35B \pm \$7B$ from a financial report. What is the most resilient architectural pattern for handling this conflict?

    Consider how to preserve information integrity and attribution in complex workflows.

    Require subagents to return structured metadata with findings, enabling the coordinator to preserve both values with explicit attribution.

    Preserving provenance through structured data allows downstream logic or human reviewers to evaluate the conflicting evidence accurately.

    • Instruct the synthesis agent to average the two numbers to provide a single balanced estimate.

      Averaging creates a value unsupported by any source and destroys the integrity of the underlying data.

    • Configure the system to automatically discard the older estimate based on the publication date.

      Recency does not always correlate with accuracy, and silent deletion of data leads to loss of important context.

    • Use a prompt instruction telling the coordinator to 'pick the most credible source' and ignore others.

      This forces a premature collapse of data and relies on the model's subjective judgment, which may be uncalibrated.

  8. 8 A developer is building a system where a specific sequence of tools must be executed: first 'verify_user', then 'process_payment'. How can the architect best enforce this order using tool_choice?

    Look for the method that provides deterministic control over model-driven decision making.

    Force 'verify_user' using 'tool_choice' on the first turn, then release to 'auto' for the subsequent turn.

    Using forced tool_choice ensures the critical first step is taken deterministically before allowing the model to decide the next action.

    • Set 'tool_choice' to 'any' and rely on prompt instructions to define the sequence.

      'tool_choice': 'any' forces the model to pick a tool but does not dictate *which* tool, leaving the sequence vulnerable to model error.

    • Use a PostToolUse hook to block 'process_payment' if 'verify_user' hasn't occurred.

      While hooks can block actions, they do not guide the model to the correct next step as effectively as tool_choice configuration.

    • Consolidate both actions into a single 'verify_and_pay' tool.

      This reduces flexibility and violates the principle of separation of concerns, making the system harder to maintain and debug.

  9. 9 In the event of a system crash during a multi-agent research pipeline that has processed 15 out of 20 documents, what is the most reliable recovery strategy?

    Evaluate the risk of using 'stale' session history versus 'fresh' context injection.

    Extract completed findings into a structured checkpoint file, start a fresh session, and inject the findings as context.

    Starting fresh with a structured manifest ensures the agent has a clear, reliable understanding of the current state without stale session baggage.

    • Use the --resume flag on the crashed session to pick up exactly where the agent left off.

      Resuming a crashed session may leave the agent with stale tool results or a corrupted internal state.

    • Use fork_session to create a new branch from the last recorded message before the crash.

      Forking still relies on the potentially unreliable history of the parent session that experienced the crash.

    • Restart the entire pipeline from scratch to ensure maximum data fidelity.

      While safe, this is highly inefficient and costly, ignoring the possibility of state-based recovery.

  10. 10 A coordinator agent needs to delegate a task to a subagent that requires more adaptability than a rigid set of instructions can provide. Which prompting strategy is most effective?

    Compare 'how-to' instructions versus 'what-to-achieve' objectives.

    Replace procedural instructions with high-level research goals and clear quality criteria.

    Goal-oriented prompts give agents the autonomy to dynamically adjust their approach to meet the desired outcome.

    • Provide a step-by-step procedural manual in the subagent's system prompt.

      Rigid procedures prevent the agent from adapting when a specific step fails or when the environment changes.

    • Use a few-shot prompt with 10 examples of the subagent performing identical tasks.

      Few-shot is good for format, but if the actual task differs slightly from the examples, the agent's adaptability remains limited.

    • Instruct the coordinator to generate the exact search queries the subagent must use.

      Over-specifying queries limits the subagent's ability to explore emerging topics or alternative search paths.

  11. 11 An architect notices that an agent with access to 25 tools often selects the wrong one. Which change to the agentic architecture would best improve tool selection reliability?

    Think about the relationship between decision complexity and model accuracy.

    Implement scoped tool access, providing the agent only with tools relevant to its specific role or turn.

    Reducing the tool count (e.g., from 18 down to 4-5) significantly improves selection accuracy by decreasing the decision space.

    • Write longer, more detailed descriptions for every tool in the schema.

      While descriptions help, too many tools still increase cognitive load and selection complexity for the model.

    • Add a few-shot prompt demonstrating correct tool selection for every possible scenario.

      This would likely exceed context limits or introduce noise, as covering 25 tools would require a massive prompt.

    • Force the model to always search for a tool description before using it.

      This adds unnecessary latency and does not address the underlying problem of having too many options simultaneously available.

  12. 12 What is the primary architectural role of the 'Coordinator' in a hub-and-spoke multi-agent system?

    Focus on the 'hub' aspect of the hub-and-spoke topology.

    To manage all inter-subagent communication, task decomposition, and result aggregation.

    The hub-and-spoke model centralizes orchestration in the coordinator to ensure controlled information flow and observability.

    • To provide a high-performance compute environment for subagent execution.

      The coordinator manages logic and routing, not the underlying hardware or compute resources.

    • To act as a persistent database for long-term storage of agent findings.

      Storage is usually handled by external systems or resources, not the coordinator agent instance itself.

    • To directly execute all API calls and tools requested by the subagents.

      Subagents typically execute their own tools; the coordinator manages the higher-level delegation of those subagents.

  13. 13 A solution architect is evaluating the 'Lost in the Middle' effect in a long-context conversation. How does this effect influence the design of multi-agent handoffs?

    Think about how LLMs prioritize information based on its position in the context window.

    It emphasizes the need to aggressively trim or summarize context before handing off to a downstream agent.

    Trimming ensures that only high-priority, relevant information is provided, keeping it at the 'heads' or 'tails' of the context for better retrieval.

    • It suggests that architects should always pass the full conversation history to every agent.

      Passing full history increases the risk of the model missing critical info tucked in the middle of a large context block.

    • It means that agents are more likely to forget the first few instructions in a system prompt.

      The effect primarily impacts the retrieval of information from the middle of long input data, not the system prompt instructions.

    • It implies that agents should avoid using XML tags, as they get lost in long contexts.

      XML tags actually help structure context and do not specifically contribute to the 'lost in the middle' effect.

  14. 14 Which stop_reason signal indicates that the application must execute a tool and return the result to Claude to continue the conversation?

    Recall the two primary stop_reason values used in agentic loop control flow.

    'tool_use'

    'tool_use' indicates that Claude has generated a tool request that the application must fulfill and append back to the context.

    • 'end_turn'

      'end_turn' signifies that the model has completed its response and is waiting for user input or ending the loop.

    • 'max_tokens'

      'max_tokens' means the response was truncated because it reached the set output limit.

    • 'stop_sequence'

      'stop_sequence' means the model encountered a custom string that was configured to terminate the generation.

  15. 15 In a research pipeline, the 'Search' subagent returns an error because a specific URL is unreachable. What is the best way to propagate this error back to the coordinator?

    Consider what information the 'brain' (coordinator) needs to solve the problem.

    Return structured error metadata including the failure type, the attempted query, and whether the error is retryable.

    Structured errors enable the coordinator to decide whether to try a new query, skip the source, or alert the user.

    • Return a generic 'Search failed' string as the tool result.

      Generic errors hide valuable context that the coordinator could use to make a recovery decision.

    • Return an empty success message to keep the pipeline moving without interruption.

      Silent failures are an anti-pattern that can lead to incomplete or inaccurate final reports.

    • Terminate the entire research process immediately to prevent inaccurate synthesis.

      Total termination is extreme for a single transient failure; the system should attempt to recover if possible.

  16. 16 An architect is designing an agent that interacts with an external database. To prevent the agent from guessing the correct user ID when multiple matches are returned, which pattern should be implemented?

    Identify the pattern for resolving high-ambiguity situations in production.

    Implement a tool interface that returns a 'multiple_matches' flag and requires the agent to ask the user for clarification.

    Requiring clarification for ambiguity is a core reliability pattern that prevents hallucinations and incorrect actions.

    • Instruct the agent to always pick the first result returned by the tool.

      Selecting based on order is a heuristic that frequently leads to incorrect data associations.

    • Add a few-shot prompt showing how to differentiate between similar users.

      Few-shot examples cannot cover every possible database conflict and don't provide a systematic solution for ambiguity.

    • Use a 'tool_choice' force to make the agent call a secondary 'confirm_id' tool.

      While forcing tools is useful, the primary issue is the model's logic when faced with ambiguous data, which requires user-driven clarification.

  17. 17 Why is 'parsing natural language signals' (e.g., looking for the word 'DONE' in assistant text) considered an anti-pattern for agentic loop termination?

    Think about the stability of API-level signals versus generated text.

    It is non-deterministic and can fail if the model phrases its completion slightly differently.

    Relying on variable text output is prone to failure; architects should use the SDK's explicit stop_reason fields for control flow.

    • It is too expensive in terms of token consumption.

      The cost of parsing a few words is negligible; the issue is the lack of reliability.

    • Claude models are incapable of outputting specific trigger words like 'DONE'.

      Models can output specific words, but they cannot be guaranteed to do so every time in every context.

    • It requires the application to wait for the entire response before terminating.

      Latency is a secondary concern; the primary problem is the probabilistic nature of text-based signals.

  18. 18 A developer needs to implement a multi-agent system that explores multiple divergent architectural approaches for a software project. Which SDK feature is best suited for this?

    Look for a term that implies creating branches from a shared starting point.

    fork_session

    fork_session allows the creation of independent branches from a shared baseline, perfect for exploring different 'what-if' scenarios.

    • The --resume flag

      --resume is for continuing a single conversation path, not creating divergent branches.

    • Agentic loops

      Agentic loops are a general control flow pattern, not a specific tool for branching session histories.

    • Prompt Caching

      Prompt Caching optimizes cost and latency but does not manage the logical branching of conversation threads.

  19. 19 A coordinator agent is decomposing a broad research request into three distinct subtasks. If the coordinator decomposes the tasks too narrowly, what is the primary risk?

    Consider the impact of 'siloed' research on the final aggregated report.

    The subagents will produce incomplete coverage due to a lack of overlap or breadth in their assigned scopes.

    Overly narrow tasks can miss 'connective' information or broad context that doesn't fit into the strictly defined sub-buckets.

    • The system will exceed its concurrent tool call limit.

      Concurrency is an infrastructure limit, not an architectural risk of narrow task decomposition.

    • The subagents will experience increased latency when returning results to the coordinator.

      Smaller tasks usually have lower latency; the risk is in the quality and completeness of the findings.

    • The synthesis subagent will struggle to format its output as JSON.

      Formatting is a matter of schema design and prompting, unrelated to the breadth of the research scope.

  20. 20 An architect is building a multi-agent research pipeline. To ensure that the 'Synthesis' agent can accurately credit its sources, how should information be passed through the system?

    Think about the best way to handle 'provenance' and 'attribution' in data processing.

    Using a structured data format (e.g., JSON) that explicitly separates content findings from source metadata.

    Separating content from metadata ensures that attribution is preserved and machine-readable throughout the pipeline.

    • As a single consolidated prose summary generated by the coordinator.

      Prose summaries often lose the specific metadata (like URLs or IDs) required for accurate citations.

    • By allowing the synthesis agent to re-run all the search tools to verify findings.

      This is highly inefficient, expensive, and redundant as the data has already been retrieved.

    • As a list of raw URLs that the synthesis agent must fetch and read itself.

      This forces the synthesis agent to do the work of the search/analysis agents, defeating the purpose of the multi-agent specialization.