SKILL 28 / ORCHESTRATION · DEEP-DIVE

Building Effective Agents, Read Closely

One decidable dividing line · A ladder of five patterns · The five companion notebooks · How to price "don't reach for an agent"

2026-09-29 · BigCat

Last issue pinned down the things that must happen every time. One step further upstream sits the more expensive question: should this job be an agent at all? Anthropic's Building Effective AI Agents (2024-12-19) answers it in two definitions — a workflow runs through predefined code paths, an agent directs its own. This issue opens the essay together with its companion notebook repo, then audits it against three later official posts.

Prerequisite → Skill 27 Hooks & Deterministic Automation

// WHY THIS MATTERS

The essay is cited so often that most people remember only the five diagrams. Its real value sits in two places: it draws a decidable line, turning "should we build an agent" from a matter of taste into a matter of fact; and it keeps revising itself — open it today and the list of frameworks it names is not the one it shipped with. Same order as always here: runnable code first, mechanism second, real material to audit against third, criteria in the back half.

// 01

What it takes off your plate: turning "agent or not" into a question with an answer

The claim: the most valuable thing in this essay is not the five diagrams, it is the two definitions at the top. They turn agent from an adjective back into a statement that can be true or false.

Verbatim (Erik Schluntz / Barry Zhang, 2024-12-19):

Workflows are systems where LLMs and tools are orchestrated
through predefined code paths.

Agents are systems where LLMs dynamically direct their own
processes and tool usage, maintaining control over how they
accomplish tasks.

The line lands on a question you can answer on the spot: who decides which tool gets called next — your code, or the model? Code decides it, and it is a workflow no matter how many layers it wears. The model decides it, and it is an agent even at twenty lines. An elaborate diagram can still be a workflow; a single while-loop can be an agent.

The companion code: those five official notebooks

Reading alone leaves you feeling like you understood it. The reference implementation lives in the official cookbook — note that the repo was renamed from anthropic-cookbook to claude-cookbooks (old links redirect; the directory path is unchanged):

git clone https://github.com/anthropics/claude-cookbooks
cd claude-cookbooks/patterns/agents

basic_workflows.ipynb               # chaining / routing / parallel
evaluator_optimizer.ipynb           # the evaluate-refine loop
orchestrator_workers.ipynb          # orchestrator and workers
async_multi_agent_orchestration.ipynb
latency_multi_agent.ipynb           # multi-agent under latency/budget
util.py  prompts/                   # shared helpers and prompts

Every notebook is a bare implementation with no framework underneath, which is exactly the essay's stance: many patterns can be implemented in a few lines of code. When not to bother: if what you need is production-grade retries, observability and persistence, none of that is here — these are teaching aids, not a foundation. (Per the GitHub repo page, 53.1k stars, 2026-09.)

The first thing you can actually run: the top rung

Only the last of the five patterns needs a real agent loop, and that rung now ships officially:

npm install @anthropic-ai/claude-agent-sdk   # Node 18+
pip install claude-agent-sdk                 # or Python 3.10+
export ANTHROPIC_API_KEY=your-api-key
from claude_agent_sdk import query, ClaudeAgentOptions

async for m in query(
    prompt="Review utils.py for bugs that would crash. Fix them.",
    options=ClaudeAgentOptions(
        allowed_tools=["Read", "Edit", "Glob"],
        permission_mode="acceptEdits")):
    print(m)

Lifted from the official quickstart. What it takes off your plate is writing the agent loop yourself: tool calls, context management, retries and the permission gate all live in the library. When not to install it: your task is three fixed steps, each one predictable — by the essay's own criteria that is prompt chaining, so call the API three times and skip dragging in a whole harness. Also note that since v0.1.0 the SDK no longer loads Claude Code's system prompt by default; for the old behavior you pass {"type":"preset","preset":"claude_code"} explicitly.

Sources · Building Effective AI Agents (2024-12-19) · Agent SDK Quickstart and Migration guide, accessed 2026-09
// 02

Mechanism: the five patterns are a ladder, not a menu

The claim: each rung up hands a little more control to the model, buys a little more adaptability, and costs a little more. Choosing a design means choosing a rung, not picking a dish.

The ladder stands on what the essay calls the augmented LLM: an LLM enhanced with augmentations such as retrieval, tools, and memory. All five patterns are built on it; they differ only in who orchestrates it.

control lives in code ────────────────────► control lives in the model (1) prompt chaining fixed steps, A's output feeds B (2) routing classify first, then a specialized path (3) parallelization sectioning (split) / voting (repeat) (4) orchestrator-workers subtasks invented on the spot (5) evaluator-optimizer one writes, one critiques, loop until it passes (6) agents step count unpredictable, model decides when done

The rungs map one-to-one onto claude-cookbooks/patterns/agents/: (1)(2)(3) all live in basic_workflows.ipynb, (4) in orchestrator_workers.ipynb, (5) in evaluator_optimizer.ipynb, and (6) has no notebook of its own — because it is the query() loop inside claude-agent-sdk. The essay gives each rung a fitness test short enough to quote in a design review:

The most common misuse: treating (4) as "a fancier (3)". The difference is not sophistication, it is who generates the subtask list. Reaching for (4) when you could have hardcoded the list means paying model tokens for an answer you already held.

The essay closes on three principles worth pinning above the desk: simplicity in the design, transparency about the agent's planning steps, and a carefully crafted ACI — tool documentation and testing polished the way you would polish an API reference. The third is the most underrated, and the next section is its manual.

// 03

Practice and limits: auditing a 2024 essay against three later posts

The claim: this essay is a skeleton and it never grew muscle. The numbers and the techniques that actually save you money arrived in the three posts that followed.

1. What multi-agent really costs

Anthropic's How we built our multi-agent research system (2025-06-13) opens the books on rung (6): a multi-agent system with Opus 4 as lead and Sonnet 4 subagents beat single-agent Opus 4 by 90.2% on their internal research eval. The bill: agents burn roughly 4x the tokens of chat, and multi-agent systems about 15x; parallel tool calling cut research time by up to 90% on complex queries. The same post draws the border: domains that need every agent to share one context, or where subtasks depend heavily on each other, are a bad fit — it names most coding tasks involve fewer truly parallelizable tasks than research. When not to reach for it: when the task isn't worth 15x the tokens.

2. Appendix 2, grown up

The essay's second appendix is called "Prompt Engineering your Tools"; Writing effective tools for AI agents (2025-09-11) is what it became, and the only operating manual for the ACI principle: consolidate tools (one schedule_event instead of list_users/list_events/create_event), namespace them (asana_search vs jira_search to mark boundaries), return token-efficient responses (Claude Code caps tool responses at 25,000 tokens by default — do your own pagination, filtering, truncation), return high-signal fields only (name and file_type, not uuid and mime_type), and write the eval before tuning descriptions.

3. The half the 2024 essay barely covers

Effective context engineering for AI agents (2025-09-29) fills the blind spot: context is not free. Four techniques — compaction (summarize history near the limit), structured note-taking (persist progress to external memory such as a NOTES.md), sub-agent architectures (work in a clean window, return only a condensed summary), and just-in-time retrieval (keep lightweight identifiers, load on demand). One governing line: find the smallest possible set of high-signal tokens.

4. The framework list: this is a living document

Open the essay today and "When and how to use frameworks" names the Claude Agent SDK, Strands Agents SDK by AWS, Rivet and Vellum — and the Claude Agent SDK is a rename of claude-code-sdk, a name that did not exist on publication day in 2024-12. Don't mistake old notes for the present state. Two you can install:

pip install strands-harness      # or npm i @strands-agents/harness
pip install -U langgraph

strands-agents/harness-sdk sells end-to-end harness control, "any model, any cloud" (per the GitHub repo page, 8.5k stars, 2026-09); langchain-ai/langgraph is a low-level orchestration framework for stateful agents (per the GitHub repo page, 42.5k stars, 2026-09). When to install neither: the essay says start with the LLM API directly, because frameworks create extra layers of abstraction that can obscure the underlying prompts and responses, making them harder to debug — and when you cannot see the prompt you actually sent, every tuning decision is superstition.

Sources · the three Anthropic Engineering posts above (dates are their own publication dates) and the two GitHub repo pages, accessed 2026-09
// 04

Cost and alternatives: the price of this essay is being used as a map

The claim: it is a terrain map from December 2024. The terrain holds; every signpost has been replaced. Check the signposts before you set out.
  1. Terminology drift. The cookbook repo was renamed, the SDK was renamed, the framework list changed hands. Every proper noun you copy out of this essay needs re-checking at a primary source; every criterion you copy still holds.
  2. It doesn't discuss context. In 2024 the context window wasn't yet the main design constraint. Read only this and go build rung (6), and you hit the wall around tool call thirty.
  3. "90.2%" is the easiest number to over-generalize. It came from an internal research-task eval, and the very same post goes on to say coding has far less that is genuinely parallelizable.
  4. Its minimalism gets read backwards. "Keep it simple" does not mean "never build an agent"; it means "don't move up a rung before you've measured the gain".

Four rungs below the agent

  1. One good prompt. The essay's first recommendation is to optimize the single call, adding retrieval and in-context examples where they help.
  2. Three chained calls. Twenty lines: debuggable, breakpointable, cost-predictable.
  3. A skill or a CLAUDE.md. If all you want is "do it this way every time", that's Skill 6's territory — no agent loop required.
  4. One hook. If all you want is "this must happen every time", that's last issue's territory — no model judgment required.

// ONE-PAGE BUYING CARD

Read/install these three first: (1) the Building Effective AI Agents essay — read the two definitions and each rung's "when to use"; the diagrams are skippable. (2) git clone https://github.com/anthropics/claude-cookbooks, then run basic_workflows.ipynb in patterns/agents/ — ten minutes, worth more than ten readings of the diagrams. (3) pip install claude-agent-sdk (or npm install @anthropic-ai/claude-agent-sdk) — only once you've confirmed you're genuinely on rung (6).

Read next, as needed: How we built our multi-agent research system (where the 15x and the 90.2% come from) · Writing effective tools for AI agents (appendix 2, grown up) · Effective context engineering (compaction / notes / sub-agents / just-in-time retrieval) · claude-agent-sdk-demos (its research-agent is orchestrator-workers you can run; per the GitHub repo page, 2.8k stars, 2026-09) · strands-harness · langgraph.

Explicitly don't: use orchestrator-workers where the subtask list was always hardcodeable · run an evaluator-optimizer loop with no objective yardstick · read 90.2% as "multi-agent is generally better" · pick a framework before knowing which rung you're on · copy package and framework names straight out of a 2024 essay · build a long-horizon agent on this essay alone.

// GLOSSARY

workflow
A system where LLMs and tools are orchestrated through predefined code paths. Who picks the next call? Your code.
agent
A system where the LLM directs its own process and tool usage, keeping control over how the task gets done. Who picks the next call? The model.
augmented LLM
An LLM with retrieval, tools and memory attached. The essay calls it the basic building block; all five patterns stand on it.
ACI
Agent-computer interface. The counterpart to a human UI: the tool surface a model works against. One of the essay's three closing principles is to craft it as carefully as an API reference.
sectioning vs voting
The two variants of parallelization. Sectioning splits a task into independent subtasks run at once (buys speed); voting runs the same task several times for consensus (buys confidence).
orchestrator-workers
A central LLM decomposes a task into subtasks at runtime, delegates them to workers, and synthesizes the results. The sole border with parallelization: the subtask list isn't fixed in advance.
evaluator-optimizer
One LLM produces, another critiques and feeds back, looping until it passes. Presupposes an objective evaluation criterion.
compaction
Summarizing history as context nears its limit, keeping architectural decisions and open questions while dropping redundant output. Infrastructure for long-horizon agents.

// THREE THINGS THAT DON'T ADD UP

If the agent rung wins by 90.2%, why does the essay spend its length talking you out of it?
Because both numbers come from the same post: 90.2% better, and roughly 15x the tokens. The argument was never that agents are bad; it is don't pay that bill before you've measured the return. The real test is marginal: going from one prompt to chained calls usually buys a lot at nearly no extra cost, while going from orchestrator-workers to a fully autonomous agent buys an uncertain amount at a certain cost. So "keep it simple" isn't an aesthetic preference — it's choosing the rung with known cost while the return is unknown.
If the line is this clean, why is almost nothing in the wild purely one or the other?
Because the line is drawn per decision point, not per system. Claude Code itself is a hybrid: which tool gets called next in the main loop is the model's call (agent), while when hooks fire, how permissions resolve and when compaction happens are all code's call (workflow). A real system is a list of decision points, and each one belongs to one side. So the useful question is never "are we building a workflow or an agent" but "who should make this particular decision" — which is last issue's hook criterion said a second way.
Tool descriptions are written for a model, not a person. Does "polish it like an API reference" survive that?
It survives, and the bar is higher than for human docs: people guess, experiment and read the source, while a model mostly has the description you wrote. The later official post quantified it — improving a tool description alone cut task completion time by 40% for agents using it. But the analogy has a seam: API references aim for completeness, tool descriptions aim for signal, and completeness is a liability (returning uuid and mime_type is completeness hurting signal). A sharper version might be: polish it like an error message — say what to do next, in as few words as possible.

// FURTHER READING