Agentic Architecture & Orchestration
stop_reason Is the Only Loop Control That Matters
Agentic loop lifecycle & stop_reason
The API Is Stateless: Send Full History Every Time
Tool result append to conversation history
Model-Driven Decisions vs Hardcoded Decision Trees
Model-driven vs pre-configured decision tree
Three Anti-Patterns That Break Agentic Loops
Agentic loop anti-patterns
Hub-and-Spoke: All Roads Go Through the Coordinator
Hub-and-spoke orchestration pattern
Sub-Agents See Nothing: Context Must Be Explicitly Passed
Sub-agent context isolation
Narrow Decomposition Means Missing Coverage
Task decomposition scope risks
Don't Run Every Agent for Every Query
Dynamic sub-agent selection
Evaluate, Identify Gaps, Fill Them: The Iterative Refinement Loop
Iterative refinement loop
Task Tool, allowedTools, and the Full AgentDefinition Configuration Surface
Task tool & allowedTools config
AgentDefinition: Every Field Matters, Nothing Should Be Left to Defaults
AgentDefinition configuration
Task Tool: Three Inputs, Four Response Fields, One Common Bug
Task tool complete definition
Resume Saves 85% Tokens and Chains Across Multiple Follow-Ups
Sub-agent resume pattern
Fork Eliminates Anchoring Bias: 89% vs 62% Accuracy
Fork-based session management
Structured Data Preserves Attribution; Plain Text Destroys It
Context passing best practices
Parallel Execution: 80% Wall-Clock Reduction, Zero Extra Cost
Parallel sub-agent spawning
Goals + Standards Beat Step-by-Step: 82 vs 68 Quality Score
Coordinator prompt design
The Model Will Override Your Instructions 4-15% of the Time
Programmatic enforcement vs prompt guidance
Missing Customer Expectation Drops Satisfaction 23 Points
Structured handoff protocol
4+ Concerns? Only 38% Get Fully Addressed Without Explicit Decomposition
Multi-concern request decomposition
Five Hook Types Across the Full Session Lifecycle
Hook types and triggers
HookMatcher: Targeted Matchers Save 40% Hook Processing Time
Hook registration with HookMatcher
PreToolUse Returns: deny, allow, modify — and the Bugs Between Them
PreToolUse hook return values
PostToolUse Normalization: 12% → 0.3% Date Errors, 90% Token Reduction
PostToolUse data normalization
Select by Consequence AND Verifiability, Not by Compliance Rate
Hook vs prompt selection principle
Dynamic Adds 30% Overhead on Fixed Tasks: Match Strategy to Task Type
Fixed pipeline vs dynamic decomposition
Single-Pass Reviews Produce Contradictory Findings: Split Into Per-File + Cross-File
Large code review multi-pass split
Without Exploration First, 80% of Effort Goes to Trivial Code
Open-ended task decomposition