Agentic Loops & Core API
Understand how agentic loops work using the Claude Agent SDK. Learn to manage the lifecycle of agentic interactions, including the stop_reason signals, tool result appending, and the control flow of agent execution.
Core concepts you must master for the exam:
Agentic loop lifecycle: stop_reason values ('tool_use' vs 'end_turn') control loop continuation
Tool result appending: after each tool call, results are appended to the conversation for the next iteration
Agent SDK control flow: the SDK handles the loop automatically, but you must understand the mechanics
The agent continues looping as long as stop_reason is 'tool_use'; it terminates on 'end_turn'
Anti-Patterns to Avoid
Parsing natural language output to decide whether to continue the loop instead of checking stop_reason
Setting arbitrary iteration caps as the primary stopping mechanism
Checking assistant text content to determine loop termination
Multi-Agent Orchestration
Design and implement multi-agent systems using hub-and-spoke architecture. Learn coordinator roles, subagent context isolation, and parallel execution patterns.
Multi-agent patterns tested on the exam:
Hub-and-spoke architecture: a central coordinator delegates tasks to specialized subagents
Context isolation: subagents have their own context and do not share state directly
Task tool for spawning subagents: allowedTools must include 'Task' for subagent creation
Parallel execution: multiple Task calls in a single response enable parallel subagent work
fork_session: creates branched sessions for parallel exploration without context pollution
Anti-Patterns to Avoid
Overly narrow task decomposition leading to coverage gaps between subagents
Sharing full coordinator context with every subagent (context pollution)
Not providing explicit context when delegating to subagents
Hooks & Programmatic Enforcement
Use hooks for data normalization, tool call interception, and compliance enforcement. Understand when to use programmatic enforcement vs prompt-based guidance.
Hooks and enforcement concepts:
PostToolUse hooks: intercept and modify tool outputs for data normalization
Programmatic enforcement for critical business rules (deterministic, not probabilistic)
Prompt-based guidance for soft preferences and style suggestions
Hook-based blocking: e.g., blocking refunds above $500 and redirecting to escalation
Anti-Patterns to Avoid
Using prompt-based enforcement for critical business rules (unreliable)
Self-reported confidence scores for escalation decisions (model confidence is unreliable)
Sentiment-based escalation (sentiment does not equal complexity)
Session Management & Workflows
Manage agent sessions, including resuming, forking, and preventing stale context. Understand task decomposition strategies from prompt chaining to dynamic adaptive decomposition.
Session and workflow management:
--resume flag: continue previous sessions with preserved context
fork_session: branch sessions for exploration without polluting the main context
Named sessions for organized multi-session workflows
Stale context detection and mitigation in long-running sessions
Prompt chaining vs dynamic adaptive decomposition: choose based on task predictability
Anti-Patterns to Avoid
Ignoring stale context in extended sessions
Using static prompt chains for tasks that require dynamic adaptation
Exam Tips for Domain 1
Always check stop_reason for loop control, never parse natural language
Programmatic hooks for business rules, prompts for preferences
Subagents need explicit context — don't assume they inherit coordinator knowledge
Understand fork_session vs --resume and when to use each
Related Exam Scenarios
Customer Support Resolution Agent
Design an AI-powered customer support agent that handles inquiries, resolves issues, and escalates complex cases. Tests Agent SDK usage, MCP tools, and escalation logic.
Multi-Agent Research System
Build a coordinator-subagent system for parallel research tasks. Tests multi-agent orchestration, context passing, error propagation, and result synthesis.
Test Your Knowledge of Agentic Architecture
Practice with scenario-based questions covering this domain.