1. Agentic Architecture & Orchestration
27%- Choose architecture based on task shape: fixed workflow for predictable, repeatable steps; autonomous agents when the path depends on intermediate findings; multi-agent systems when distinct specialties, tools, or parallel work justify the coordination cost.
- The agentic loop lifecycle: send request → inspect stop_reason → if tool_use, execute tool calls and return tool_result content blocks → repeat; if end_turn, exit loop. Anti-patterns: parsing natural-language signals to determine termination, setting arbitrary iteration caps as the primary stopping mechanism, or checking for assistant text content as a completion indicator. stop_reason is the only reliable signal.
- stop_reason values: end_turn = model finished naturally; tool_use = model paused, tool calls must be executed and results returned; max_tokens = response truncated and incomplete, never forward as complete; stop_sequence = custom stop string matched.
- Parallelism: a coordinator emits multiple Task tool calls in a single response to spawn parallel subagents. Emitting them across separate turns means sequential execution. Parallelism comes from the single-response batch, not from the number of turns.
- Session state: --resume with a session name continues a prior session when the prior context is mostly still valid. fork_session creates a parallel exploration branch from the current state. Choose fresh session with injected summaries when prior tool results are stale or the context has drifted.
- Hooks give deterministic guarantees that prompt instructions cannot: PostToolUse hooks normalize heterogeneous data formats after every tool call regardless of model behavior; interception hooks block policy-violating calls outright (e.g. refunds above a threshold). Hooks vs prompts = deterministic enforcement vs probabilistic compliance.
- Delegation must be operational: the coordinator needs access to the Task capability, subagents need clear descriptions, focused prompts, and appropriate tool restrictions. Subagents are isolated — do not assume conversation history or memory carries across invocations; pass required context explicitly.
- On escalation to a human who cannot see the transcript, emit a structured handoff summary: what was attempted, what succeeded, what failed, open questions, and any constraints or deadlines. An unstructured narrative forces the human to reconstruct context.
- Use iterative refinement when quality must improve through evaluate → targeted follow-up → re-synthesize loops instead of accepting the first pass.