Built for the Real World · Essay · Agents

Agentic architecture patterns, part 1: one agent, one loop, and the patterns inside it

An agent is a loop with four seams: the model call, the tool call, the context window and the stop condition. Part 1 of four argues that every single-agent pattern, from ReAct to compaction to the step cap, is a decision at one of them, and gives the measured record for each: what the pattern buys, how it fails, and the pass^k numbers that show which decisions hold.

Infographic: the agent loop drawn as a ring of four seams, with tau2-bench retail reliability in the centre falling from 0.74 right once to 0.53 right four times running, and three measured numbers beside each seam: plan-first prompting cutting tokens from 9,795 to 1,986 a question, code actions at 74.4 percent against 52.4 for JSON, cached input at $0.30 against $3.00 per million, and airline reliability falling from 0.56 to 0.40; a strip below prices a worked refund agent at $0.159, $0.071 or $0.008 a task.

Part 1 of a four-part series on agentic architecture patterns. Part 2 covers many agents and the ways they fail together. Part 3 covers the control plane: the patterns that decide whether an agent may run at all. Part 4 is hands-on: harness engineering, the loops and graphs that run the model.

An agent is a short program that calls a language model in a loop. It assembles a context, calls the model, runs whatever tool the model asked for, appends the result, and goes round again until something says stop. Everything else that gets called an agent pattern, from ReAct to compaction to the step cap, is a decision at one of four places in that program: the model call, the tool call, the context window and the stop condition. I call those places seams. This essay is a reference to the single-agent patterns, organised by seam, with the measured record for each: the source that introduced the pattern, the numbers it reported, the failure mode it reported, and the condition under which not to use it.

The seam that matters most is the one least often designed: the stop. The benchmark that measures it, tau-bench, defines pass^k as the chance an agent completes the same task on every one of k attempts. On its retail domain the best model of June 2025 scored 0.74 once and 0.53 four times in a row; on a domain where the customer also holds tools, 0.34 and 0.19. Nearly every other pattern in this essay exists to move those numbers, and the evidence says which ones do.

The record is not only academic. In the week before this essay was written, the lab that published the industry’s standard taxonomy of agent patterns redrew two of its own seams in public: on 9 October 2026 it turned off live internet access for its internal evaluations after its agents found routes through the tool seam that nobody intended, and on 13 October it described a merge queue taking over 30,000 agent-written changes a day, which is the stop seam moved from the engineer to the system. Both episodes appear later as evidence. Twenty-two months after the taxonomy, the people who know the patterns best are still working on the seams, and I take that as the subject of this part.

This series is a reference, written from the platform seat, on how agents are built. This part is about one agent and the loop inside it. Name the seam and you know what a pattern costs, what it fixes, and when it will fail. Part 2 applies the same method to many agents. Part 3 is about the controls that sit outside every agent and decide whether it may run. Part 4 builds a harness by hand.

I have tried to source every number in this essay from a paper or a lab post read in full, and to give the date of each. Where the number is my own arithmetic, I say so. The tables and figures were built from those numbers, and every pattern has one.

The loop, and the four places it can go wrong

Strip away the framework and an agent is a short program. It assembles a context, calls a model, reads what comes back, runs any tool the model asked for, appends the result, and goes round again until something says stop. Anthropic’s December 2024 essay “Building effective agents” calls the thing inside the loop the augmented LLM: a model “enhanced with augmentations such as retrieval, tools, and memory”. OpenAI’s April 2025 guide to building agents is blunter about the shape: “Every orchestration approach needs the concept of a ‘run’, typically implemented as a loop that lets agents operate until an exit condition is reached.” Its own SDK documents the loop in three numbered steps, and the third is an exception named MaxTurnsExceeded. Google’s September 2024 “Agents” whitepaper describes an orchestration layer as “a cyclical process” that continues “until an agent has reached its goal or a stopping point”. Anthropic’s current Claude Code documentation names the layer around the model, the one that provides tools and manages what the model sees, the agentic harness. These are four descriptions of one program.

Each pass through the loop crosses four seams, and each seam is a design surface with its own literature.

The model call. What goes into the prompt, whether the model reasons before it acts, whether one call is split into a planner and an executor, whether a second call critiques the first, and which model takes the call at all. Chain-of-thought, ReAct, plan-and-execute, reflection, routing and the “think” tool are decisions here.

The tool call. What the model can reach, and through what interface. Text actions versus native function calling, the tool descriptions and result formats, the Model Context Protocol, code as the action language, computer use where the tool result is a screenshot, and the gating of state-changing calls are decisions here.

The context window. What the model sees on each pass. Compaction, tool-result clearing, external memory files, retrieval on demand, sub-agents that isolate a window, prefix stability for the cache, and whether a long task is one session or many are decisions here.

The stop condition. Who decides the task is done, and on what evidence. A maximum number of turns, a final-output tool, a budget cap, a test suite, a separate evaluator, a human checkpoint, or nothing at all except the end of the context window. This seam is where reliability is measured, and the measurements are worse than most people assume.

The agent loop and its four seamsA loop of four stages, context window, model call, tool call and stop condition, with the single-agent patterns pinned under the seam each one decides. Context window what the model sees on this pass PATTERNS compaction, tool-result clearing memory files, just-in-time retrieval sub-agent isolation stable prefix for the cache reset or compact Model call what is asked, and how and which model PATTERNS ReAct interleaving chaining, routing, parallelisation plan-and-execute reflection with a verifier think step before a write small model for bounded steps Tool call what the model can touch through what interface PATTERNS function calling vs text vs code MCP tools, resources, prompts agent-computer interface tool search, programmatic calls computer use (pixels in) mutation gating Stop condition who says done, on what evidence PATTERNS structured final output verifier, tests, evaluator step and write caps spend cap that pauses human checkpoint pass^k as the metric append the result and go round again one pass of the loop done Every single-agent pattern in the literature is a decision at one of these four seams. Name the seam and you know what the pattern costs, what it fixes, and how it fails.
Figure 1. The loop, drawn once. Assemble the context, call the model, run the tool it asked for, append the result, decide whether to stop. The patterns of this essay are pinned under the seam each one decides. Sources: Anthropic (December 2024), OpenAI (April 2025), Google (September 2024), Claude Code documentation (October 2026).

I find the seams more useful than the pattern names because the names drift and the seams do not. The same idea appears as “evaluator-optimiser” in one taxonomy, a “LoopAgent” with a critic in another, and “reflection” in a third. In every case it is a second model call at the model seam plus a decision rule at the stop seam, and it has the same failure mode in all three places, which the evidence below makes plain. The rest of this essay takes the seams in order. For each pattern I give the problem it solves, the source that introduced or measured it, the numbers, the failure mode, and when not to use it. There is a worked example near the end, a refund agent traced through all four seams with the arithmetic shown, and a table of every pattern with its seam.

Everyone’s list is the same list

Before the seams, a word about the lists. Anthropic’s December 2024 taxonomy draws a line between workflows, “systems where LLMs and tools are orchestrated through predefined code paths”, and agents, where the model dynamically directs its own process and tool use. It names five workflow patterns: prompt chaining, routing, parallelisation (with two variants, sectioning and voting), orchestrator-workers, and evaluator-optimiser. Then it names the agent, with the advice that “it’s also common to include stopping conditions (such as a maximum number of iterations) to maintain control”. The essay’s other advice is the one most often quoted and least often followed: find “the simplest solution possible, and only increasing complexity when needed”, because for many applications “optimizing single LLM calls with retrieval and in-context examples is usually enough”.

OpenAI’s guide, published in April 2025, defines an agent as a system that “independently accomplish tasks on your behalf”, with two properties: it uses a model to manage workflow execution and decide, including recognising “when a workflow is complete”, and it has tools inside guardrails. Its orchestration section lists four common exit conditions: tool calls, a structured output, errors, or a maximum number of turns. Its multi-agent advice is to “maximize a single agent’s capabilities first”, and it gives a number for the tool seam that I have not seen elsewhere: “Some implementations successfully manage more than 15 well-defined, distinct tools while others struggle with fewer than 10 overlapping tools.”

Google’s Agent Development Kit ships the workflows as classes. A SequentialAgent “Executes sub-agents one after another, in sequence”, a ParallelAgent runs them in parallel, and a LoopAgent “Repeatedly executes its sub-agents until a specific termination condition is met”. The documentation is careful to say that these run “without consulting an AI model for assistance with the orchestration”, and it is just as careful about the stop seam: “the LoopAgent itself does not inherently decide when to stop looping”, so the builder sets a maximum iteration count or a sub-agent escalates. Antonio Gulli’s 2025 book “Agentic Design Patterns”, published by Springer in November 2025 with a free edition released in September, lists twenty-one chapters, and the first six are prompt chaining, routing, parallelisation, reflection, tool use and planning. The rest are multi-agent, memory, protocols and operations, which is the shape of this series.

Anthropic’s Claude Code documentation, as it stands in October 2026, describes the loop as three phases, gather context, take action, verify results, and spends more words on the last than on the other two. The line I would put on the wall is this one: “Claude stops when the work looks done. Without a check it can run, ‘looks done’ is the only signal available.”

“Claude stops when the work looks done. Without a check it can run, ‘looks done’ is the only signal available.”

Five pattern lists, one shapeA matrix of ten pattern families against five published taxonomies, showing which taxonomy names each pattern, with the seam each pattern belongs to. Pattern family Seam Anthropic Dec 2024 OpenAI guide Apr 2025 Google ADK (docs) Gulli book Nov 2025 Claude Code docs, Oct 2026 Prompt chaining model Routing model Parallelisation (sectioning, voting) model Orchestrator-workers / manager context Evaluator-optimiser / reflection model + stop Tool use, function calling, MCP tool Planning model Memory and context management context Guardrails, max turns, exceptions stop Human in the loop stop A filled dot means the source names the pattern, under its own vocabulary. Gulli lists 21 chapters; the first six are the single-agent set. ADK ships Sequential, Parallel and Loop agents as classes.
Figure 2. Five lists, one shape. Chaining, routing and parallelisation decide how many model calls happen and in what order; reflection is a second call plus a stop rule; tool use is the tool seam; memory is the context seam; guardrails and humans are the stop seam. Sources: Anthropic, Building effective agents (19 December 2024); OpenAI, A practical guide to building agents (April 2025); Google ADK documentation; Gulli, Agentic Design Patterns (Springer, November 2025); Claude Code documentation (read October 2026).

Five lists, one shape. Chaining, routing and parallelisation are decisions about how many model calls there are and in what order. Reflection and evaluator loops are a second call plus a stop rule. Tool use and planning are the tool seam and the model seam respectively. Memory is the context seam. Guardrails, monitoring and human-in-the-loop are the stop seam and the control plane. If a vendor shows you a slide with a new pattern name, ask which seam it sits at. If they cannot say, it is a product, not a pattern.

pass^1 0.74 to pass^4 0.53 on retail, 0.34 to 0.19 on telecom: right once is not right every time

Seam one: the model call

The oldest pattern in the lineage is also the one most builders still run without knowing its numbers. ReAct, from Shunyu Yao and colleagues at Princeton and Google, was submitted on 6 October 2022 and published at ICLR 2023. Its idea is simple to state: interleave a reasoning trace with an action, feed the observation back, and repeat, so that “reasoning traces help the model induce, track, and update action plans” while the actions ground the reasoning in something retrieved. Everything that calls itself an agent today is a descendant.

What is forgotten is how much of the paper is about the loop failing. On HotpotQA, with a 540-billion-parameter PaLM and a search tool over an online encyclopedia, ReAct scored 27.4 exact match against 29.4 for plain chain-of-thought; it won on the fact-checking task, 60.9 against 56.3, and the combination of the two beat either. The authors hand-labelled 50 correct and 50 incorrect trajectories per method and found that ReAct hallucinated in 0 percent of its failures where chain-of-thought hallucinated in 56 percent, but ReAct’s failures were reasoning errors 47 percent of the time, and 23 percent of the time the search simply returned nothing useful and the loop derailed. The paper’s own description of the characteristic failure is a loop that cannot exit: “the model repetitively generates the previous thoughts and actions”. Their fix is the first explicit stop condition in this literature. They cap HotpotQA at seven steps and the fact-checking task at five, because “more steps will not improve ReAct performance”, and when the loop runs out of steps they fall back to chain-of-thought with self-consistency. On the ALFWorld household tasks the loop shines, 71 percent success for the best of six prompts against 45 for acting without reasoning, and on WebShop it reached 40.0 percent task success against 30.1, with the human expert at 59.6. Those are the numbers I would want anyone to know before they ship a loop: a seven-step cap, a 23 percent rate of uninformative observations, and a 47 percent reasoning-error share among failures.

ReAct: the loop and its own numbersLeft, the thought, action, observation cycle with its step caps; right, bars for ReAct against acting alone on ALFWorld and WebShop and the failure analysis on HotpotQA. THE CYCLE (YAO ET AL., 6 OCT 2022) Thought reason about the state Action search, lookup, finish Observation the tool result Step cap: 7 steps on HotpotQA, 5 on Fever, because “more steps will not improve ReAct performance”; then fall back to chain-of-thought with self-consistency. Characteristic failure: the model repeats its previous thoughts and actions. Success rate, % ALFWorld, ReAct (best of 6) 71 ALFWorld, Act (best of 6) 45 ALFWorld, BUTLER (best of 8) 37 WebShop, ReAct 40.0 WebShop, Act 30.1 WebShop, human expert 59.6 HotpotQA failures, share of labelled failed trajectories Reasoning error, ReAct 47% Reasoning error, CoT 16% Search returned nothing, ReAct 23% Hallucination, ReAct 0% Hallucination, CoT 56% PaLM-540B, prompting only. Tables 2, 3 and 4 of the paper. The search tool is an API over an online encyclopedia.
Figure 3. The first agent loop came with the first stop rule. ReAct interleaves a reasoning trace with an action and feeds the observation back; it wins on tasks where acting needs a plan (ALFWorld, WebShop) and it eliminates hallucination on HotpotQA, at the price of more reasoning errors and a derailment whenever the search returns nothing. The authors cap it at seven steps. Source: Yao et al., ReAct (6 October 2022), Tables 2 to 4.

Workflows are the pattern of not opening the loop. The five workflows in Anthropic’s taxonomy are all ways of deciding, in code, how many model calls happen and in what order, so that the model never gets to decide. Prompt chaining splits a task into fixed subtasks and runs them in sequence, with a programmatic check between steps; the guidance is to use it “when the task can be easily and cleanly decomposed into fixed subtasks”, trading latency for accuracy. Routing classifies an input and sends it to a specialised prompt or a different model, which is the pattern I built a reference design around in June: the application declares a task class, never a model. Parallelisation runs the same or different prompts at once, either sectioning a task or voting on an answer. Orchestrator-workers is the one case where the subtasks “aren’t pre-defined, but determined by the orchestrator based on the specific input”, which is why it is the boundary with Part 2. Evaluator-optimiser runs a generator and a critic in a loop when there are “clear evaluation criteria, and when iterative refinement provides measurable value”.

The strongest argument for workflows over agents is a coding result from July 2024 that OpenAI later adopted to showcase its own models. Agentless, from Chunqiu Steven Xia and colleagues at Illinois, asked “Do we really have to employ complex autonomous software agents?” and answered with a fixed three-phase pipeline, localise, repair, validate, that lets no model decide a next action. On SWE-bench Lite it resolved 32.00 percent of issues at an average cost of 70 cents per issue, against 23.00 percent for SWE-agent with Claude 3.5 Sonnet at $1.62 and 18.33 percent with GPT-4o at $2.53. In the taxonomy it is prompt chaining with voting over candidate patches. I return to its numbers at the stop seam, because its real lesson is that a loop you never open cannot fail to close.

The five workflow patternsFive small diagrams: prompt chaining, routing, parallelisation, orchestrator-workers and evaluator-optimiser, each with the condition under which to use it. CHAINING call 1 gate call 2 gate call 3 ROUTING classify prompt A prompt B small model PARALLELISATION split call call call join ORCHESTRATOR orchestrator worker worker worker synthesise EVALUATOR LOOP generate evaluate draft loop until pass or cap Use when the task splits into fixed subtasks; costs latency. Use when inputs fall into classes you can tell apart. Use for independent sections, or votes on one question. Use when the subtasks are not known in advance (see part 2). Use when criteria are clear and iteration measurably helps. Code decides the control flow in all five; the model never chooses the next step. Clay marks where a decision is made by code or a classifier.
Figure 4. Workflows are the pattern of not opening the loop. In all five, code decides how many model calls happen and in what order; the model only fills in the boxes. Google ADK ships the first three as SequentialAgent, ParallelAgent and LoopAgent, and warns that the LoopAgent does not decide when to stop. Sources: Anthropic, Building effective agents (19 December 2024); Google ADK documentation (read October 2026).

Plan-and-execute is one call split into two. The ReAct loop re-sends the whole history on every step, so its cost grows with the square of the step count and its planning is myopic. Three papers from 2023 attack both problems by writing the plan first. Plan-and-Solve prompting (Lei Wang and colleagues, 6 May 2023) is the prompt-level ancestor: ask the model to “devise a plan to solve the problem” before solving it. On GSM8K with text-davinci-003 it lifted zero-shot accuracy from 56.4 to 59.3, targeting the missing-step errors that were 12 percent of the failures the authors analysed; against hand-written few-shot chain-of-thought the gain vanished, 76.7 versus 77.6 averaged over six datasets. ReWOO (Binfeng Xu and colleagues, 23 May 2023) made the structural version: a planner writes every step with placeholders, the tools run, and a single solver call reads the evidence. Averaged over six benchmarks it cut token use by 64 percent and gained 4.4 points of accuracy. On a thousand HotpotQA questions with gpt-3.5-turbo, ReAct used 9,795 tokens per question at $19.59 per thousand questions; ReWOO used 1,986 tokens at $3.97, and was more accurate, 42.4 against 40.8. The paper also carries an early warning for the tool seam: “Extraneous tools compromise ALM performance”, with accuracy falling as tools were added.

LLMCompiler (Sehoon Kim and colleagues at Berkeley, 7 December 2023, ICML 2024) goes one step further and has the planner emit a graph of function calls that a dispatcher runs in parallel wherever they are independent. The abstract claims “latency speedup of up to 3.7x, cost savings of up to 6.7x”, and the tables support it: on a movie-recommendation task ReAct took 20.47 seconds and 20,000 input tokens per query where LLMCompiler took 5.47 seconds and 2,800, at $3.04 per thousand queries instead of $20.46. The paper names the two ReAct failure modes it is designed around as “looping and early stopping”, which is the stop seam failing in both directions at once.

The cost of planning up front is that a wrong plan cannot be repaired mid-run. ReWOO tests this with deliberately failing tools; the honest summary is that plan-and-execute pays when the next step does not depend on an observation the planner could not foresee, and ReAct pays when it does. Most production loops I see are hybrids: a plan written once, re-planned only when an observation contradicts it. That is a stop rule at the model seam, and it should be written down.

Plan first: ReWOO and LLMCompiler against ReActLeft, three schematic call sequences; right, bars of tokens, cost and latency per question for ReAct against ReWOO and LLMCompiler. CALL SHAPES ReAct each call re-reads the whole history: cost grows with the square of the steps ReWOO plan solve one planner call with placeholders, the tools run, one solver call LLMCompiler plan DAG join independent calls dispatched in parallel; a wrong plan cannot be repaired mid-run Slate: model call. Clay: tool call. Plan-and-Solve (6 May 2023) is the prompt-level ancestor: GSM8K 56.4 to 59.3 zero-shot; no gain over few-shot CoT. HotpotQA, gpt-3.5-turbo, 1,000 questions (ReWOO, Table 2) ReAct, tokens per question 9,795 ReWOO, tokens per question 1,986 ReAct, $ per 1,000 $19.59 ReWOO, $ per 1,000 $3.97 ReAct, accuracy 40.8 ReWOO, accuracy 42.4 Movie recommendation, GPT (LLMCompiler, Tables 1 and 2) ReAct, seconds per query 20.47 s LLMCompiler, seconds 5.47 s ReAct, $ per 1,000 $20.46 LLMCompiler, $ per 1,000 $3.04 ReAct, accuracy 72.47 LLMCompiler, accuracy 77.13
Figure 5. Writing the plan first removes the re-sent history. ReWOO cut tokens by 64 percent across six benchmarks and gained 4.4 points; LLMCompiler dispatches independent calls in parallel for up to 3.7 times the speed and 6.7 times lower cost. The price is a plan that cannot be revised when an observation contradicts it. Sources: Xu et al., ReWOO (23 May 2023), Table 2; Kim et al., LLMCompiler (7 December 2023), Tables 1 and 2; Wang et al., Plan-and-Solve (6 May 2023).

Reflection works exactly when there is something outside the model to reflect against. This is the most misunderstood pattern in the catalogue, and the record on it is unusually clean. Reflexion (Noah Shinn and colleagues, 20 March 2023, NeurIPS 2023) wraps an actor in an evaluator and a self-reflection step whose output is written to a short memory and read on the next attempt. Its headline is 91 percent pass@1 on HumanEval against GPT-4’s 80 percent, with gains of 22 points on ALFWorld in twelve iterations and 20 points on HotpotQA. Read the tables and the mechanism is visible. On ALFWorld, ReAct with Reflexion completed 130 of 134 tasks where plain ReAct stopped improving between trials six and seven and converged at a 22 percent hallucination rate. On MBPP Python, the score went down, from 80.1 to 77.1, and the authors show why: the model wrote its own unit tests, and 16.3 percent of those tests were false positives, against 1.4 percent for HumanEval. Where the signal is a real test, reflection climbs; where the model grades itself, it drifts. A weak model gains nothing: starchat-beta scored 0.26 with and without it.

Self-Refine (Aman Madaan and colleagues, 30 March 2023) shows the other half of the picture with one model generating, critiquing and revising its own output. On tasks of taste and style the gains are enormous: sentiment reversal from 3.8 to 36.2, dialogue response from 25.4 to 74.6, constrained generation from 15.0 to 45.0 with GPT-4. On maths the gain is 0.2 points, 92.9 to 93.1, and the paper explains that for 94 percent of maths instances the critic said that everything looks good. CRITIC (Zhibin Gou and colleagues, 19 May 2023) isolated the variable by letting the critic call tools. With a search tool or an interpreter the corrections are real; without one “the model’s own critiques contribute marginally to the improvement (-0.03 and +2.33 F1 with the two LLMs)”. The cleanest negative result is Jie Huang and colleagues at Google DeepMind, “Large Language Models Cannot Self-Correct Reasoning Yet”, submitted 3 October 2023 and published at ICLR 2024. Told to review its own answer with no external signal, GPT-4 fell on GSM8K from 95.5 to 91.5 after one round and 89.0 after two, while making three and then five calls instead of one; GPT-3.5 on CommonSenseQA fell from 75.8 to 38.1. The model kept its first answer 74.7 percent of the time, and when it changed it was “more likely to modify a correct answer to an incorrect one”. The paper’s check on multi-agent debate is the one Part 2 will lean on: debate with six responses scored 83.2 on GSM8K where plain self-consistency with six responses scored 85.3.

So the rule for the reflection pattern is not “use it” or “avoid it”. It is: a reflection call is worth its cost only if it reads a signal the model did not generate. Unit tests, an interpreter, a search result, a schema validator, a separate evaluator model with a different prompt and a sceptical disposition. Anthropic’s March 2026 note on long-running harness design found that agents “reliably skew positive when grading their own work” and that tuning a standalone evaluator to be sceptical is “far more tractable”. That evaluator is a separate call at the model seam with its own stop rule, and it is the version of reflection I would build.

A reflection call is worth its cost only if it reads a signal the model did not generate.

No external signal

accuracy, %, after self-correction rounds

GPT-4 GSM8K, start
95.5
after 1 round
91.5
after 2 rounds
89.0
GPT-3.5 CSQA, start
75.8
after 1 round
38.1
GPT-4 HotpotQA, start
49.0
after 2 rounds
43.0

With a verifier

pass@1 or accuracy, %

HumanEval, GPT-4
80.1
+ Reflexion (tests)
91.0
Leetcode hard, GPT-4
7.5
+ Reflexion
15.0
GSM8K PoT, ChatGPT
72.5
+ CRITIC with tool
78.2
+ CRITIC, no tool
77.0
MBPP, GPT-4
80.1
+ Reflexion (own tests)
77.1

Self-Refine by task type

GPT-4, score before and after

Sentiment reversal
3.8
refined
36.2
Dialogue response
25.4
refined
74.6
Constrained generation
15.0
refined
45.0
Maths reasoning
92.9
refined
93.1
Figure 6. Reflection climbs only when it reads a signal the model did not generate. Without one, GPT-4 loses six points on GSM8K over two rounds while making five calls instead of one, and GPT-3.5 halves its CommonSenseQA score; with unit tests or a tool, Reflexion and CRITIC gain. Self-Refine shows the same split by task: large gains on taste and style, a fifth of a point on maths, where the critic said that everything looks good 94 percent of the time. Sources: Huang et al. (3 October 2023), Table 3; Shinn et al., Reflexion (20 March 2023), Table 1; Gou et al., CRITIC (19 May 2023), Table 2; Madaan et al., Self-Refine (30 March 2023), Table 1.

The “think” tool is a reasoning step dressed as a tool call. On 20 March 2025 Anthropic described giving Claude a no-op tool whose only effect is to add “an additional thinking step, complete with its own designated space” between tool results. The results table on tau-bench’s airline domain is the clearest published decay curve for repeated trials I know of, and I reproduce it in the figure. With the think tool and an optimised prompt, Claude 3.7 Sonnet scored 0.584 on pass^1 and 0.340 on pass^5; the baseline scored 0.332 and 0.100. (The post’s body text quotes 0.570 and 0.370; the table says 0.584 and 0.332, and I use the table.) Extended thinking alone scored 0.412 falling to 0.160, and the think tool without the prompt change scored 0.404 falling to 0.100. In the retail domain, where the policy is simpler, the think tool without a prompt change still led, 0.812 falling to 0.626, against a baseline of 0.783 falling to 0.583. The post’s own guidance is that the step helps in “Policy-heavy environments” and “Sequential decision making”, and not for non-sequential calls or simple instruction following. The page now carries a note, dated 15 December 2025, recommending extended thinking over a dedicated tool in most cases, which is the usual fate of a harness trick: the model absorbs it.

A paper from Amazon’s AGI group, SABER (Alejandro Cuadron and colleagues, 26 November 2025), says where the extra thinking should go. Analysing the same tau-bench tasks, it found that “each additional deviation in a mutating action reduces the odds of success by upto 92% on Airline and upto 96% on Retail”, while deviations in read-only actions cost under 10 percent. Its design, mutation-gated verification with targeted reflection before state-changing steps, lifted a Qwen3 thinking model by 28 percent relative on airline and 11 on retail. The lesson for the model seam is to spend the reflection call before the write, not after every read.

Not every model call needs the big model. The last pattern at this seam is routing inside the loop. Many of the calls an agent makes are not reasoning calls at all: classify this ticket, decide whether this tool result is relevant, check whether this field is a valid order number. I argued in October that those bounded decisions belong to a different class of model, fast and cheap and trained on labels, and that the expensive reasoning model is doing two jobs when it makes them. The agent loop is where that argument bites hardest, because every step is a model call and most steps are decisions. Anthropic’s 7 October 2026 launch of Claude Haiku 5.5, priced at $0.10 per million input tokens, named “compaction, summarization, or subagent work” as the jobs it is for. A loop that routes its bounded decisions to a small model, and its judgment calls to a large one, is applying the routing workflow one step at a time.

Pass^k on tau-bench airline with and without a think stepLine chart of pass^k for k from one to five for four configurations of Claude 3.7 Sonnet on the tau-bench airline domain, with the think tool plus an optimised prompt highest and the baseline lowest. 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 k = 1 k = 2 k = 3 k = 4 k = 5 pass^k: all k trials succeed (airline domain, Claude 3.7 Sonnet) pass^k 0.584 to 0.340 think tool + optimised prompt 0.412 to 0.160 extended thinking 0.404 to 0.100 think tool alone 0.332 to 0.100 baseline RETAIL DOMAIN, SAME MODELS think tool: 0.812 to 0.626 extended thinking: 0.770 to 0.548 baseline: 0.783 to 0.583 SABER (26 Nov 2025): a deviation in a mutating action cuts the odds of success by up to 92% (airline) and 96% (retail); read-only ones under 10%. Values from the results table of the post; its body text quotes 0.570 and 0.370 for the same two rows.
Figure 7. A reasoning step between tool calls lifts the whole curve, and the curve still falls by a third to half between one trial and five. The think tool with a tuned prompt took airline pass^1 from 0.332 to 0.584 and pass^5 from 0.100 to 0.340. Where the step pays is before a state-changing action, which is where SABER found the failures cluster. Sources: Anthropic, The “think” tool (20 March 2025), results table; Cuadron et al., SABER (26 November 2025).

Seam two: the tool call

A tool is where the model meets something that is not a model. Anthropic’s September 2025 post on writing tools for agents calls it “a contract between deterministic systems and non-deterministic agents”, and the phrasing is exact: the tool does the same thing every time, the caller does not. Every pattern at this seam is a decision about the shape of that contract.

Text actions, JSON actions, or code. Toolformer (Timo Schick and colleagues at Meta, 9 February 2023) was the first demonstration that a model could be trained, self-supervised, to decide when to call a tool, which one, and with what arguments: a 6.7-billion-parameter GPT-J with a calculator went from 7.5 to 40.4 on one arithmetic benchmark and beat the 175-billion-parameter GPT-3. It is the ancestor of native function calling, and it carried a crude stop rule that is still instructive: at most one tool call per input, so that the model “does not get stuck in a loop where it constantly calls APIs without producing any actual output”. Native function calling, where the model emits a structured call against a declared schema, is now the default, and tau-bench’s authors found in June 2024 that it beat both text-formatted ReAct and plain acting across every model they tested. CodeAct (Xingyao Wang and colleagues, 1 February 2024, ICML 2024) tested the third option, code as the action language, on 82 multi-tool tasks across 17 models. With gpt-4-1106-preview, code actions succeeded 74.4 percent of the time in 5.5 turns, where JSON actions succeeded 52.4 percent in 7.6 turns and text 53.7 percent in 7.7. The gain widened with model strength and reversed for single atomic calls, where JSON scored 82.7 against code’s 76.7. The rule the data supports: JSON for one call, code when the action composes several.

The protocol. On 25 November 2024 Anthropic released the Model Context Protocol, an open standard for “two-way connections” between tools and model applications, with the problem stated as “Every new data source requires its own custom implementation”. The protocol carries JSON-RPC messages between a host, its clients and servers, and it defines three primitives that map onto the three parties: tools are “model-controlled”, resources are “application-driven”, and prompts are “user-controlled”, typically surfaced as slash commands. The specification has always put the human on the stop seam: “there SHOULD always be a human in the loop with the ability to deny tool invocations.” The 2026-07-28 revision, the latest as this essay is dated, changed the tool seam itself. Protocol-level sessions and the handshake were removed; the specification’s own changelog says “Make MCP stateless”. Any state a server needs the model to carry is now “explicit, server-minted handles passed as ordinary tool arguments”. Roots, sampling and logging were deprecated with a twelve-month window; a discovery call and a tasks extension were added; servers are told to return tools in deterministic order because it “improves LLM prompt cache hit rates”, and clients are told that tool annotations are untrusted unless the server is. I will take the protocols apart in a later series. For this essay the point is structural: the server no longer remembers anything for the model, so the loop does, and that pushes work onto the context seam.

The Model Context Protocol at the tool seamHost application with a client talking JSON-RPC to servers that expose tools, resources and prompts; a side panel lists the 2026-07-28 revision changes that made the protocol stateless. HOST APPLICATION Agent loop model call, context, stop rule MCP client one per server connection Human in the loop: “there SHOULD always be a human in the loop with the ability to deny tool invocations” (specification, every revision). JSON-RPC Tools model-controlled Resources application-driven Prompts user-controlled servers (local or remote) REVISION 2026-07-28 Sessions and the initialize handshake removed: “Make MCP stateless”. State travels as “explicit, server-minted handles passed as ordinary tool arguments”; the loop carries them in its own context. Tools returned in deterministic order because it “improves LLM prompt cache hit rates”. Tool annotations are untrusted unless the server is. Roots, Sampling, Logging deprecated (12 months). Discovery call and a tasks extension added. Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, 2026-07-28. Announced by Anthropic on 25 November 2024.
Figure 8. MCP standardises the tool seam so the loop does not change when the tool does. The three primitives map onto the three parties: tools for the model, resources for the application, prompts for the user. The July 2026 revision removed sessions and the handshake, so any state a server wants the model to keep is a handle the loop must carry forward, which moves work onto the context seam. Sources: Anthropic (25 November 2024); Model Context Protocol specification 2024-11-05 and 2026-07-28, including the changelog.

The interface is a design surface, and the ablations prove it. SWE-agent (John Yang and colleagues at Princeton, 6 May 2024) introduced the term agent-computer interface for the argument that “Human user interfaces are not always suitable as agent-computer interfaces”. It gave GPT-4 Turbo a shell, a file viewer, a search and an editor built for a model rather than a person, and resolved 12.47 percent of the full SWE-bench set and 18.00 percent of the Lite split, against 2.67 percent for retrieval-augmented generation and 11.00 percent for a plain shell. The ablations on Lite are the part worth memorising. Removing the linter from the edit command dropped the score from 18.0 to 15.0; removing the edit command entirely dropped it to 10.3. A file viewer showing 100 lines scored 18.0; 30 lines scored 14.3 and the whole file 12.7. Keeping only the last five observations in context scored 18.0; keeping the full history scored 15.0. An iterative search tool that returned one hit at a time scored 12.0 because the agent would “look through every match exhaustively”. And the run had a stop rule at the tool seam: a $4 budget per instance, after which existing edits were submitted automatically.

Edit command

% resolved, SWE-bench Lite

edit with linting
18.0
edit without linting
15.0
no edit command
10.3

File viewer window

% resolved

100 lines
18.0
30 lines
14.3
whole file
12.7

Context and search

% resolved

last 5 observations
18.0
full history
15.0
summarised search
18.0
iterative search
12.0
no search
15.7
Figure 9. The interface moves the score as much as the model does. On SWE-bench Lite with GPT-4 Turbo, removing the linter from the edit command cost three points, a 100-line file window beat both 30 lines and the whole file, and keeping only the last five observations in context beat keeping all of them. Clay marks the shipped configuration. Source: Yang et al., SWE-agent (6 May 2024), Table 3.

Anthropic’s January 2025 note on its SWE-bench Verified result (49 percent with the second Claude 3.5 Sonnet) is the minimal counterpoint: two tools, bash and a string-replacement editor, a 200,000-token window, and the rule “We continue to sample until the model decides that it is finished, or exceeds its 200k context length.” The authors state the design philosophy as “give as much control as possible to the language model itself”, and they report what that costs: in failed runs “the model kept trying until it ran out of context.” The tool design details, an absolute path on every call, an error on a non-unique match so the model retries, are the agent-computer interface again. Its September 2025 guide to writing tools adds numbers for the result side of the contract: Claude Code caps tool responses at 25,000 tokens by default, and a detailed response that used 206 tokens carried the same information as a concise one that used 72. Consolidate tools (one schedule_event instead of list and create), namespace them, return readable identifiers, paginate, and write error messages that tell the model how to fix the call. The guide’s warning matches OpenAI’s tool-overload number from the other direction: “More tools don’t always lead to better outcomes.”

Code as the action language is now a product, and its numbers are large. The CodeAct result was published on 4 November 2025 as “Code execution with MCP”. The problem is that most clients “load all tool definitions upfront directly into context”, and an agent with access to thousands of tools must “process hundreds of thousands of tokens before reading a request”; every intermediate result also passes through the model, so a two-hour transcript copied from one tool to another costs 50,000 tokens twice. Presenting the servers as a filesystem of code modules and letting the model write a script that calls them cut one task “from 150,000 tokens to 2,000 tokens, a time and cost saving of 98.7%”. A spreadsheet filter run in code means the agent “sees five rows instead of 10,000”. Three weeks later, on 24 November, the same ideas shipped on the developer platform. A tool-search tool that loads definitions on demand took a five-server setup from about 77,000 tokens of definitions before any work to about 8,700, an 85 percent reduction, and raised accuracy on an MCP evaluation from 49 to 74 percent for Opus 4 and from 79.5 to 88.1 for Opus 4.5, because the model was no longer choosing among tools it could barely see. Programmatic tool calling, where the model writes code that calls several tools and only the final result enters its context, cut average token use on complex research tasks from 43,588 to 27,297, with the note that twenty tool calls in one code block “eliminate 19+ inference passes”. The guidance on when not to is as useful as the numbers: tool search for more than ten tools or more than 10,000 tokens of definitions, not for fewer; programmatic calling for large datasets and three or more dependent calls, not when the model must reason over every intermediate result.

Action format

success rate, %, 82 multi-tool tasks, gpt-4-1106-preview

CodeAct (5.5 turns)
74.4
Text (7.7 turns)
53.7
JSON (7.6 turns)
52.4

Tokens before any work

five-server MCP setup, tokens

all definitions loaded
~77K
with tool search
~8.7K
one Jira server alone
~17K

Tokens per task

two Anthropic examples, tokens

transcript via model
150,000
via code execution
2,000
research, direct calls
43,588
programmatic calling
27,297
Figure 10. Code as the action language, measured three times. CodeAct beat JSON and text actions by 20 points with fewer turns on multi-tool tasks (and lost to JSON on single atomic calls, 76.7 against 82.7). A year and a half later the same idea shipped as products: code execution over MCP took one task from 150,000 tokens to 2,000, tool search cut definitions loaded before any work from about 77,000 tokens to about 8,700, and programmatic tool calling cut a research workload from 43,588 tokens to 27,297. Sources: Wang et al., CodeAct (1 February 2024), Table 3; Anthropic, Code execution with MCP (4 November 2025); Anthropic, Advanced tool use (24 November 2025).

Computer use is a tool whose result is pixels. When Anthropic announced computer use on 22 October 2024, the loop was the same loop: screenshot in, click or keystroke out, repeat. Claude 3.5 Sonnet scored 14.9 percent on OSWorld in the screenshot-only setting, against 7.8 for the next system, and 22.0 percent when allowed more steps, with the honest description “at times cumbersome and error-prone”. OpenAI’s Computer-Using Agent, announced on 23 January 2025, scored 38.1 on OSWorld and 58.1 on WebArena against human baselines of 72.4 and 78.2, and recorded the sentence that ties the pattern to the stop seam: “CUA’s performance improves when more steps are allowed.” Operator was “trained to ask for user confirmation before finalizing tasks with external side effects”, declined banking transactions, required active supervision on sites like email, and ran a monitor model that could pause a task. Those are three stop rules bolted onto a tool.

I wrote about where this had reached by June in The browser is the API: Google had made computer use a built-in tool of Gemini 3.5 Flash on 24 June, scoring 78.4 on OSWorld-Verified against the suite’s 72.36 percent human baseline, and the controls I asked for were a sandbox, an identity, a policy gate, a recorder, and per-task budgets of steps, tokens, minutes and money that abort into a human queue rather than retrying. Nothing in the four months since has changed that list. The per-step economics did change: Haiku 5.5, on 7 October 2026, scored 72.4 percent on the offline subset of OSWorld 2.1 at a tenth of a dollar per million input tokens, a suite that is not comparable to the old OSWorld but a price that is. The computer-use pattern is the tool seam at its most expensive, because each observation is an image and each action is a guess about where the button went, and it is the stop seam at its most important, because the tool can buy things.

Computer use: a tool whose result is a screenshotLeft, the screenshot-in action-out loop with its stop rules; right, a ladder of OSWorld scores from October 2024 to 2026 against the human baseline. THE LOOP Screenshot pixels, into context Model call where is the button? Click, type, scroll the action Stop rules bolted on (OpenAI, 23 Jan 2025): confirmation before external side effects; active supervision on sites like email; banking transactions declined; a monitor model that can pause the task. “CUA’s performance improves when more steps are allowed.” OSWorld, success %, by date Oct 2024, Claude 3.5 Sonnet 14.9 Oct 2024, same, more steps 22.0 Jan 2025, OpenAI CUA 38.1 Human baseline (OSWorld) 72.4 May 2026, Claude Opus 4.8 (Verified) 83.4 Jun 2026, Gemini 3.5 Flash (Verified) 78.4 Jun 2026, GPT-5.5 (Verified) 78.7 Oct 2026, Haiku 5.5 (OSWorld 2.1) 72.4 Oct 2026, Sonnet 5.5 (OSWorld 2.1) 83.9 OSWorld-Verified (28 July 2025) and OSWorld 2.1 are different suites; bars are comparable within a suite only. Haiku 5.5 costs $0.10 per million input tokens; each screenshot is roughly a thousand tokens.
Figure 11. The loop is unchanged; the tool result is an image and the action is a guess about where the button went. Scores rose from 14.9 to above the human baseline in twenty months, and every vendor shipped the pattern with stop rules attached, because the tool can buy things. Sources: Anthropic (22 October 2024; 7 October 2026); OpenAI, Computer-Using Agent (23 January 2025); the author’s essay The browser is the API (27 June 2026) for the 2026 OSWorld-Verified numbers.

Seam three: the context window

The context window is the only memory the model has, and every pattern at this seam is a decision about what to put in it, what to take out, and where the rest lives. Anthropic’s September 2025 essay on context engineering defines the discipline as “the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference”, names the failure it guards against as context rot, the decline in recall as tokens accumulate, and gives the rule I would keep: “the smallest set of high-signal tokens that maximize the likelihood of your desired outcome”. Agents, in that essay, are simply “LLMs autonomously using tools in a loop”, which is the definition this series uses.

The tiers. The vocabulary comes from MemGPT (Charles Packer and colleagues at Berkeley, 12 October 2023), which treated the window as RAM and everything else as disk. Main context is the prompt: system instructions, a working context the model can edit, and a first-in-first-out queue of messages whose head holds “a recursive summary of messages that have been evicted”. External context is archival and recall storage reached through function calls, with a “memory pressure” warning when the queue nears its limit and an interrupt mechanism so the model can chain calls. On a deep-memory retrieval test the design took GPT-4 from 32.1 percent to 92.5. Two years on, every serious harness has the same tiers under different names. Anthropic’s September 2025 platform release gave the Claude API context editing, which “automatically clears stale tool calls and results from within the context window”, and a memory tool that “operates entirely client-side through tool calls” against files. On an internal agentic search evaluation the two together improved performance by 39 percent over baseline; context editing alone gave 29 percent; and on a 100-turn web search evaluation, editing let workflows finish that otherwise failed while “reducing token consumption by 84%”. Claude Code’s documentation describes the same order of operations: “It clears older tool outputs first, then summarizes the conversation if needed.” OpenAI’s developer blog in February 2026 described compaction that “runs automatically in-stream” when context crosses a threshold, and called it “a default long-run primitive, not an emergency fallback”. The tiers, from the inside out: the live window; cleared tool results; a rolling summary; files on disk the model reads back on demand; and a sub-agent’s separate window whose only return is a summary.

The context tiers, from the window outwardsNested tiers: the live window, cleared tool results, a rolling summary, files on disk, a sub-agent window, and the session event log, each with the primitive that implements it and a measured number. Live window system prompt, working notes, recent turns; stable prefix for the cache Manus: cached $0.30 vs $3.00 per million; 100:1 input to output Cleared tool results “one of the safest lightest touch forms of compaction” context editing alone: +29% on an agentic search eval Rolling summary compaction when the window nears its limit; recall first, then precision MemGPT: recursive summary at the head of the queue Files on disk memory tool, NOTES.md, todo recitation, skills loaded on demand memory tool + editing: +39%; 100-turn eval: 84% fewer tokens Sub-agent window a separate context that absorbs the noise returns “often 1,000-2,000 tokens”; agents use ~4x chat tokens Session event log append-only log outside any window; resume “from the last event” Managed Agents: wake(sessionId), getEvents() slices, rewind Claude Code: “It clears older tool outputs first, then summarizes the conversation if needed.” OpenAI (Feb 2026): compaction is “a default long-run primitive, not an emergency fallback”.
Figure 12. Six tiers, one rule: the smallest set of high-signal tokens in the window, and everything else somewhere the model can fetch it. The vocabulary is MemGPT’s (October 2023); the numbers are from Anthropic’s September 2025 context-management release, Manus (July 2025), the multi-agent research post (June 2025) and the Managed Agents design (April 2026).

Files are the cheapest tier and the most durable. Manus published its lessons from building an agent product on 18 July 2025, after rebuilding its framework four times, and the first lesson is about money. The typical Manus task takes around 50 tool calls, the input-to-output token ratio is around 100 to 1, and on the model it used, cached input cost $0.30 per million tokens against $3.00 uncached, “a 10x difference”. So the context must be append-only with a stable prefix: no timestamps at the top of the system prompt, no tool definitions that change mid-task (mask them with logits instead, with shared prefixes such as browser_ and shell_), and no rewriting of history. Its next lesson is to use the filesystem as context, because it is “unlimited in size, persistent by nature, and directly operable by the agent itself”, with compression that is restorable: keep the URL, drop the page. The third is recitation: a todo file rewritten each step keeps the goal in the model’s recent attention. The fourth is to keep failed actions in context so the model updates its beliefs. I made the same point about caches in my tokens-to-done essay in July: append-only histories cache and rewritten ones do not, so compaction, which rewrites, trades cache hits for window space, and the trade should be made deliberately and late.

Anthropic’s October 2025 Agent Skills design is the file tier made into a loading discipline. A skill is a directory with a SKILL.md file; only its name and description are loaded into the system prompt up front, the body is read when relevant, and bundled files or scripts are used as needed, so that “the amount of context that can be bundled into a skill is effectively unbounded” and a script can run “without loading either the script or the PDF into context”. Claude Code applies the same progressive disclosure to tools: MCP tool definitions “are deferred by default and loaded on demand via tool search”, and a memory file is loaded only to its first 200 lines or 25 kilobytes. The pattern is just-in-time retrieval: give the model identifiers and a way to fetch, not the data.

Price per million input tokens

Manus, Claude Sonnet rate it quotes, July 2025

uncached
$3.00
cached (stable prefix)
$0.30

Context preserved for work

tokens of a 200,000-token window, Anthropic example

definitions up front
122,800
with tool search
191,300

Token multiple over a chat

Anthropic, June 2025

chat
1x
single agent
~4x
multi-agent system
~15x
Figure 13. Three bills set at the context seam. Manus pays a tenth per token for a cached prefix, so its history is append-only; a five-server tool setup costs about 77,000 tokens before any work unless definitions are loaded on demand; and the multi-agent research system uses about fifteen times the tokens of a chat, with token use alone explaining 80 percent of the variance in its results. Sources: Manus (18 July 2025); Anthropic, Advanced tool use (24 November 2025); Anthropic, multi-agent research system (13 June 2025).

Sub-agents are context isolation, not delegation. The reason to spawn a second agent inside a single-agent system is almost never that the task needs two minds. It is that the second window can absorb tens of thousands of tokens of search results and return “a condensed, distilled summary of its work (often 1,000-2,000 tokens)”. Anthropic’s Agent SDK documentation says the same thing in one sentence: “only its final message returns to the parent.” The cost is also documented. The June 2025 multi-agent research post reports that agents “typically use about 4x more tokens than chat interactions” and multi-agent systems “about 15x more tokens than chats”, and that in its evaluation token usage alone explained 80 percent of the variance in performance. That number belongs to Part 2, but it is set at this seam: the budget you spend on a sub-agent buys context, and context is what buys performance.

Reset or compact: the harness assumption that went stale. The clearest lesson of the past year at this seam is that a harness encodes a belief about the model, and beliefs expire. Anthropic’s November 2025 note on long-running harnesses described the two ways a session fails over many context windows: the agent “tended to try to do too much at once” and ran out of context mid-feature, and later sessions would “declare the job done” prematurely. The fix was a shift-handover design: an initialiser agent writes a feature list as JSON with every entry marked unpassed (JSON because models overwrite it less readily than Markdown), a progress file, and an init script; every later session begins by reading the git log, the progress file and the feature list, runs a basic test, works on one feature, and leaves the code clean. The note’s image is “each new engineer arrives with no memory of what happened on the previous shift”. The 5 February 2026 account of sixteen agents building a C compiler took this to its limit: every iteration started “a fresh Claude Code session in a fresh container”, orienting from READMEs and progress files, with no orchestrator at all, and the result was a 100,000-line compiler that boots Linux, after nearly 2,000 sessions, 2 billion input tokens, 140 million output tokens, and just under $20,000.

Then the belief expired. The March 2026 harness-design note and the April 2026 Managed Agents note both describe “context anxiety”, a model “wrapping up work prematurely as they approach what they believe is their context limit”. On Sonnet 4.5 the fix was context resets: clear the window and start a fresh agent with a structured handoff, because compaction summarises in place and “doesn’t give the agent a clean slate”. On Opus 4.5 “the behavior was gone. The resets had become dead weight.” The sentence I would print on the first page of any harness repository is from the March note: “every component in a harness encodes an assumption about what the model can’t do on its own.” The same note gives the price of getting the assumption wrong in the other direction: a retro game maker built solo took 20 minutes and $9, and the full harness with planner, generator and evaluator took six hours and $200, “over 20x more expensive”, and the harness was “worth the cost when the task sits beyond what the current model does reliably solo”, which the game maker was not.

“every component in a harness encodes an assumption about what the model can’t do on its own.”

Reset or compact: a harness assumption that expiredTop, two session timelines, one with context resets for Sonnet 4.5 and one single session with compaction for Opus 4.5; bottom, the cost of a full harness against a solo run, and the cost breakdown of one four-hour build. CONTEXT ANXIETY AND ITS TWO FIXES Sonnet 4.5 session 1 reset + handoff session 2 reset + handoff session 3 reset + handoff session 4 Opus 4.5 one session, automatic compaction; “The resets had become dead weight.” “every component in a harness encodes an assumption about what the model can’t do on its own” (Anthropic, 24 March 2026) Retro game maker, Opus 4.5 solo run, 20 min $9 full harness, 6 hr $200 Planner, generator and evaluator agents: “over 20x more expensive”, and worth it only when the task sits beyond what the model does reliably solo. Digital audio workstation, Opus 4.6, V2 harness: $124.70 in 3 hr 50 min build round 1: $71.08 build 2: $36.89 Planner 4.7 min, $0.46. Build round 1: 2 hr 7 min, $71.08. QA 1: $3.24. Build 2: 1 hr 2 min, $36.89. QA 2: $3.09. Build 3: $5.88. QA 3: $4.06. The builder “ran coherently for over two hours”; the evaluator held the stop seam with hard thresholds per criterion. Slate: builder sessions. Clay: evaluator passes. The evaluator is the reflection pattern with an external signal.
Figure 14. A harness is a set of beliefs about the model, and beliefs expire. Context resets were needed on Sonnet 4.5 and were dead weight on Opus 4.5. The same note prices the belief in the other direction: a full planner, generator and evaluator harness cost twenty times a solo run on a task the model could already do. Sources: Anthropic, Harness design for long-running application development (24 March 2026); Anthropic, Scaling Managed Agents (8 April 2026).

The Managed Agents design goes one step further and makes the session itself a tier: “an append-only event log” that lives outside the window, from which a restarted harness resumes “from the last event”, and whose slices the model can read or rewind. It also notes the hazard of every compaction scheme: “irreversible decisions to selectively retain or discard context can lead to failures.” My reading is that the context seam has settled into four moves, in the order you should reach for them. First, clear tool results, which Anthropic’s essay calls “one of the safest lightest touch forms of compaction”. Second, keep notes in a file the model reads back. Third, isolate a noisy sub-task in a sub-agent. Fourth, and only when the first three fail, compact the window, tuning “for recall first, then for precision”. Resetting the whole session is a fifth move that was right for one model generation and wrong for the next, which is the strongest argument I know for keeping every such move behind a flag.

The shift handover: a long task as many short sessionsA cycle in which each fresh session reads the git log, a progress file and a feature list, works on one feature, runs tests, commits, updates the files and ends, with the C compiler project’s totals alongside. ONE SHIFT (ANTHROPIC, 26 NOV 2025) Read git log, progress file, feature list Basic test is the state clean? One feature only one at a time Verify end-to-end browser test Commit update progress, mark passed the next session starts with no memory of this one: “each new engineer arrives with no memory of what happened on the previous shift” Feature list as JSON with “passes”: false for over 200 features, because models overwrite JSON less readily than Markdown. Failure modes it fixes: doing too much at once and running out of context; later sessions that “declare the job done”. AT THE LIMIT: THE C COMPILER (5 FEB 2026) 16 agents, each in its own container nearly 2,000 Claude Code sessions two weeks, just under $20,000 2 billion input tokens 140 million output tokens a 100,000-line compiler boots Linux 6.9; 99% on GCC torture tests No orchestrator: lock files in a shared repo; every iteration a fresh session oriented by READMEs and progress files. The verifier must be “nearly perfect, otherwise Claude will solve the wrong problem”.
Figure 15. When the task outlasts the window, the pattern is a shift handover: files, tests and git carry the state, and every session starts fresh. Sixteen agents built a C compiler this way with no orchestrator at all. Sources: Anthropic, Effective harnesses for long-running agents (26 November 2025); Anthropic, Building a C compiler with a team of parallel Claudes (5 February 2026).

Seam four: the stop condition

Every loop ends. The design question is whether it ends because something checked the work, or because something ran out. I count seven kinds of stop in the sources, and most production agents run on the weakest two.

The first is the model’s own say-so: it returns text without a tool call, and the runner treats that as final. OpenAI’s SDK makes this the default exit, “it produces text output with the desired type, and there are no tool calls”, and the Claude Code documentation names the trap: “looks done” is the only signal available. The second is the ceiling: a maximum number of turns, which the OpenAI SDK raises as MaxTurnsExceeded, Google’s LoopAgent takes as max_iterations, and Claude’s Agent SDK takes as maxTurns, returning the output “marked as partial”. The third is the end of the window, which Anthropic’s January 2025 SWE-bench harness used as its only backstop, and in which failed runs ended because “the model kept trying until it ran out of context.” The fourth is money: SWE-agent’s $4 per instance, Claude’s Agent SDK maxBudgetUsd, and the spend cap in Anthropic’s 8 October 2026 reference automation, set at “three to five times the cost of a normal run” and tightened later, with the rule that “A run that hits its cap pauses instead of failing.” The fifth is a structured output or a final-output tool: the loop ends when the model produces a value that matches a schema, which is the exit condition OpenAI’s guide lists first and the one I prefer, because it can be validated. The sixth is a verifier: a test suite, a linter, an evaluator agent, Claude Code’s Stop hook that “blocks the turn from ending until it passes”, or a goal condition that a separate evaluator re-checks after every turn. The seventh is a person: the checkpoint Anthropic’s taxonomy recommends “when encountering blockers”, the confirmation Operator demands before side effects, the human the MCP specification says SHOULD always be able to deny a call, and the “two humans have to approve the deploy” that Block described on 8 October 2026 for its migrations of a thousand pull requests orchestrated by Claude Fable.

The first three stops are failures of design dressed as features. The last four are the pattern. A loop should end on a verified output or a cap, and a cap should pause, not fail, so a person can decide whether to extend it.

Seven ways a loop endsA table of seven stop conditions in two groups, something ran out and something checked the work, with who decides, the evidence used, and the source that documents each. Stop condition Who decides Evidence Documented in SOMETHING RAN OUT Model says it is done model text with no tool call OpenAI SDK default exit; Claude Code: “looks done” is the only signal Maximum turns harness a counter MaxTurnsExceeded; LoopAgent max_iterations; maxTurns End of the context window nobody the window is full SWE-bench harness, Jan 2025: “ran out of context” SOMETHING CHECKED THE WORK Spend cap that pauses harness + person cost so far Automations, 8 Oct 2026: 3 to 5x a normal run, pauses Structured final output harness a value matching a schema OpenAI guide, Apr 2025: structured output or final tool Verifier harness tests, linter, evaluator agent Claude Code: Stop hook, /goal re-check after every turn Human checkpoint person a review or a confirmation MCP spec; Operator; Block: two humans approve a deploy The first three are failures of design dressed as features. A loop should end on a verified output or a cap, and a cap should pause so a person can decide whether to extend it.
Figure 16. Who says the task is done, and on what evidence. The three stops in the upper group fire because something ran out; the four in the lower group fire because something checked. Most production agents run on the first two. Sources: OpenAI Agents SDK and guide (April 2025); Google ADK documentation; Claude Code documentation; Anthropic (6 January 2025; 8 October 2026); MCP specification; Block (8 October 2026).

The metric for the stop seam is pass^k. If you measure an agent by whether it succeeded once, you are measuring the model. If you measure it by whether it succeeds every time, you are measuring the loop. Sierra’s tau-bench (Shunyu Yao, Noah Shinn, Pedram Razavi and Karthik Narasimhan, 17 June 2024) introduced the metric: pass^k is “the chance that all k i.i.d. task trials are successful, averaged across tasks”, as against pass@k, the chance that at least one succeeds. Anthropic’s January 2026 note on agent evaluations gives the arithmetic in one line: at 75 percent per trial, three trials pass together 42 percent of the time, and “By k=10, they tell opposite stories: pass@k approaches 100% while pass^k falls to 0%.”

The decay is steep and it is not random. In tau-bench’s retail domain, with 115 tasks, 7 write and 8 read tools and a cap of 30 agent actions per task, the best model of June 2024, gpt-4o with function calling, scored 61.2 percent on a single trial, and the paper reports that its “pass^8 drops to < 25%”. If failures were independent coin flips at 61.2 percent, pass^8 would be about 2 percent (my arithmetic). It is far higher than that because failures cluster on particular tasks, which is good news for a platform team: the hard tasks can be found and routed. The successor benchmark, tau2-bench (Victor Barres and colleagues, 9 June 2025), added a telecom domain where the user holds tools too, and ran each task four times. Reading its Figure 3: gpt-4.1 scored 0.74, 0.64, 0.58, 0.53 for k from one to four in retail, 0.56 down to 0.40 in airline, and 0.34 down to 0.19 in telecom; Claude 3.7 Sonnet scored 0.79 down to 0.60 in retail and 0.49 down to 0.25 in telecom. The paper’s own summary of the step dependence is the sentence I would want every product manager to read: “agent performance drops as the number of actions increases, reaching close to zero for > 7 actions”. Its ablation is just as telling. Give gpt-4.1 the plan in advance and telecom pass^1 rises from 0.34 to 0.67; remove the simulated user and it rises to 0.52; the gap between a cooperative environment and a real one is 18 points for one model and 25 for another.

By March 2026 the same team had a knowledge domain, tau-Knowledge (Quan Shi and colleagues, 4 March 2026), with a bank’s 698 documents and tasks that need 18.6 of them on average. The best model, with a terminal to search, scored 25.52 pass^1 and the best pass^4 was 13.40. Given the correct documents in context, the best model scored 39.69, falling to 26.80 at k equals four. The reliability of the stop decision is still, in 2026, the number that halves when you ask for it twice.

Pass^k decay on tau2-bench, k from one to fourLine chart of pass^k for gpt-4.1 and Claude 3.7 Sonnet across the retail, airline and telecom domains, with dotted reference lines showing what independent trials would give. 0.0 0.2 0.4 0.6 0.8 k = 1 k = 2 k = 3 k = 4 pass^k: all k trials succeed (tau2-bench, Figure 3, four trials per task) pass^k 0.79 to 0.60 Claude 3.7 Sonnet, retail 0.74 to 0.53 gpt-4.1, retail 0.56 to 0.40 gpt-4.1, airline 0.49 to 0.25 Claude 3.7 Sonnet, telecom 0.34 to 0.19 gpt-4.1, telecom if trials were independent: 0.74^k 0.34^k OTHER PUBLISHED POINTS tau-bench (17 Jun 2024), gpt-4o, retail: pass^1 61.2%, “pass^8 drops to < 25%”. Independent trials would give about 2% (author’s arithmetic): failures cluster by task. tau-Knowledge (4 Mar 2026), 698 documents: best pass^1 25.52, best pass^4 13.40; with gold documents 39.69 to 26.80. Anthropic evals note (9 Jan 2026): 0.75 per trial gives 0.42 at k = 3; “By k=10 … pass^k falls to 0%.” Solid lines: Claude 3.7 Sonnet. Dashed lines: gpt-4.1. Dotted grey: the p^k an independent-trials model would predict from pass^1.
Figure 17. Ask for the same result four times and the score falls by a quarter to a half. Across tau2-bench’s domains the best models lose a quarter to a half of their single-trial success by the fourth trial, and the telecom domain, where the customer holds tools too, is the steepest. The curves sit above the independent-trials reference because failures cluster on particular tasks, which is what makes them routable. Sources: Barres et al., tau2-bench (9 June 2025), Figure 3; Yao et al., tau-bench (17 June 2024); Shi et al., tau-Knowledge (4 March 2026); Anthropic (9 January 2026).

Three things follow for the design of the seam. First, measure pass^k on your own tasks, not pass@1 on someone else’s; Anthropic’s evals note suggests that “20-50 simple tasks drawn from real failures is a great start”, graded on the end state, from a clean environment each trial. I described the bench I would build in July, and its three reported numbers, cost per task, success rate and escalation rate, are the stop seam’s dashboard. Second, cap the mutating actions, not the steps. SABER’s finding that each deviation in a state-changing action cuts the odds of success by up to 92 percent on airline and 96 percent on retail, while read-only deviations cost under 10 percent, means the step budget should count writes. tau2-bench’s “close to zero for > 7 actions” is a number about writes too. Third, the budget must pause into a queue a person can see. Both of my earlier arguments, that a step cap set too tight “raises the escalation rate” and that an always-on agent needs a kill switch drilled monthly, are statements about what happens after the stop fires.

What moves the stop seam: the plan, the user, and the number of writesLeft, bars of telecom pass^1 for two models with the default setting, without a simulated user, and with the plan given in advance; right, the SABER odds reductions for mutating and non-mutating deviations. tau2-bench telecom, pass^1 (Figure 4, original policy) gpt-4.1, default 0.34 gpt-4.1, no simulated user 0.52 gpt-4.1, plan given (oracle) 0.67 o4-mini, default 0.42 o4-mini, no simulated user 0.73 o4-mini, plan given (oracle) 0.96 Removing the user adds 18 points for one model and 25 for the other; giving the plan adds 33 and 54. “agent performance drops as the number of actions increases, reaching close to zero for > 7 actions in Default mode.” SABER (26 NOV 2025): WHERE FAILURES CLUSTER Reduction in the odds of success per deviation mutating, airline up to 92% mutating, retail up to 96% non-mutating < 10% Mutation-gated verification plus targeted reflection before state-changing steps: Qwen3-Thinking +28% relative (airline), +11% (retail), +7% (SWE-bench Verified); Claude +9% and +7%. Design rule: budget and gate the writes; reads are cheap to get wrong.
Figure 18. Three levers on reliability, measured. A plan given in advance and a cooperative environment each add tens of points of pass^1, which says how much of the loss is coordination rather than capability; and the losses concentrate on the few actions that change state. Sources: Barres et al., tau2-bench (9 June 2025), Figures 4 and 5; Cuadron et al., SABER (26 November 2025).

The stop you never need: do not open the loop. I promised to return to Agentless, because it is the cleanest argument that the best stop condition is a pipeline with three fixed phases. Its 32.00 percent on SWE-bench Lite at 70 cents and 78,166 tokens per issue, against SWE-agent’s 23.00 percent at $1.62 and 521,208 tokens, is not a story about a weaker agent; it is a story about a task that decomposes. Localise the file, propose patches, run the tests, pick the patch that passes. Each phase has a verifier, so no phase needs to decide when it is done. The paper also audited the benchmark and found 4.3 percent of problems carried the exact patch in their description and 10.0 percent were missing critical information, which is the kind of thing you learn only by looking at the tasks, and which an agent loop would have paid to rediscover one trajectory at a time. OpenAI adopted the pipeline to report its own models’ coding scores. The question to ask before building an agent is the one its title asks, and the answer is yes less often than the demos suggest.

Issues resolved

% of SWE-bench Lite (300 issues)

Agentless, GPT-4o
32.00
OpenDevin CodeAct, Claude 3.5 S
26.67
Moatless, Claude 3.5 S
26.67
SWE-agent, Claude 3.5 S
23.00
AutoCodeRover, GPT-4
19.00
SWE-agent, GPT-4o
18.33

Average cost per issue

US dollars

CodeR, GPT-4
$3.34
SWE-agent, GPT-4o
$2.53
SWE-agent, Claude 3.5 S
$1.62
OpenDevin CodeAct
$1.14
Agentless, GPT-4o
$0.70
Moatless
$0.17

Average tokens per issue

tokens

SWE-agent, Claude 3.5 S
521,208
SWE-agent, GPT-4o
498,346
Agentless, GPT-4o
78,166
AutoCodeRover, GPT-4
38,663
Figure 19. The loop you never open cannot fail to close. A fixed localise, repair, validate pipeline resolved more SWE-bench Lite issues than the open-source agents of mid-2024 at a half to a quarter of their cost and a sixth of their tokens, because each phase had a verifier and none had to decide when it was done. Source: Xia et al., Agentless (1 July 2024), Table 1; costs and tokens as printed there.

Caps are now platform settings, with defaults you should read. The Claude Agent SDK documents three ceilings besides maxTurns: a nesting depth of three layers of sub-agents below the main agent, twenty sub-agents running at once, and a spend cap that is unlimited by default and ends the run with an error subtype when reached. OpenAI’s runner has max_turns with no default stated on its page, and a websocket session that ends after 60 minutes. Google’s LoopAgent needs max_iterations or an escalate signal, or it runs forever. Anthropic’s reference automation of 8 October 2026 is the best small example of a loop with every seam decided: fresh sandbox per run, a memory file read fresh each time, eight numbered run steps that end with an explicit stop, a re-check of the live source just before posting, idempotent posting that checks for today’s title first, and a cap that pauses. None of that is clever. All of it is written down.

A worked example: a refund agent, seam by seam

Take the most ordinary agent a platform team gets asked for: a customer-service agent that can refund an order. I will trace it through the four seams with the arithmetic shown, using the shapes from tau-bench’s retail domain, which has 7 tools that write and 8 that read, a database of 500 users, 50 products and 1,000 orders, and a cap of 30 agent actions per task, and the October 2026 rate cards for Claude Sonnet 5.5 ($2 per million input tokens, $10 output, cache reads at $0.10) and Claude Haiku 5.5 ($0.10 input, $0.50 output, cache reads at $0.01), as published with Haiku 5.5 on 7 October. The sizes of prompts and results are my assumptions, stated in the figure, and the point is the shape of the bill, not its last cent.

The model seam. The system prompt carries the refund policy and the fifteen tool definitions. Say the stable prefix is 6,000 tokens. Each turn the model reasons briefly and emits one call; say 250 output tokens a turn. A typical trace has nine model calls: identify the customer, fetch the order, fetch the product, consult the policy (a think step, or extended thinking, which the think-tool table says pays in policy-heavy domains), confirm the details with the customer, cancel the order, issue the refund, check the result, and close. Two of those nine are bounded decisions, does this order qualify and did the refund post, that a small model or a classifier could take; the rest are judgment or conversation.

The tool seam. Native function calling, not text. The two write tools, cancel and refund, are the mutation gate: SABER’s numbers say that a deviation on either costs up to 96 percent of the odds of success on retail, so the harness requires a targeted reflection before each, and the reflection reads the order record, not the model’s memory of it. The read tools return concise results, a handful of fields with readable identifiers, and the refund tool returns an explicit confirmation or a guiding error, because a non-unique match or an empty result should make the model retry, not guess. The tools come from an MCP server, and under the 2026-07-28 revision the order handle the server mints is carried in the model’s context from step two to step seven; nothing on the server remembers it.

The context seam. Append-only. The prefix is written to the cache on the first call and read from it on the other eight. Tool results are kept short and cleared after the refund posts; the policy is never summarised. Nothing in this trace needs a sub-agent or a file; a task that needs more than 30 actions is, by the benchmark’s own cap, a task that should be escalated rather than compacted.

The stop seam. The loop ends on a structured output: a refund record with an order identifier and an amount, which a verifier checks against the order total and the policy before the message to the customer is sent. The step cap is 30 actions, the write cap is two, and a cap that trips pauses the task into a human queue with the transcript attached. The run is graded on its end state, four trials per task, and the number reported is pass^4.

The arithmetic. Nine calls with a 6,000-token prefix and a history that grows by about 400 tokens a turn add up to 68,400 input tokens and 2,250 output tokens. On Sonnet 5.5 without caching that is about 16 cents a task; with the prefix cached it is about 7 cents; on Haiku 5.5 for every step it is under a cent. tau-bench measured the same shape in June 2024: 95.9 percent of the agent’s bill was input, “mainly due to long system prompt (domain policy + function definitions)”, and the gpt-4o agent cost $0.38 per task. The number that matters, though, is not cost per task but cost per task that ends in the right state. At a retail pass^1 of 0.74, the best figure in tau2-bench’s table, a 7-cent run costs about 9.5 cents per success on average, and roughly one task in four lands in the human queue, where the cost is a person’s time. Halve the escalation rate and you have done more for the bill than any model swap. That is why the stop seam, not the model seam, is where I would spend the engineering.

A refund agent traced through the four seamsA nine-step trace with each step labelled by seam, the write gate on the two state-changing calls, the token arithmetic under stated assumptions, and three cost scenarios. 1 find user read 2 get order read 3 get product read 4 think: policy model 5 confirm with user user 6 cancel order write 7 issue refund write 8 check result read 9 close: record stop write gate: reflect against the record first verifier + schema TOKEN ARITHMETIC (AUTHOR’S ASSUMPTIONS, STATED) Stable prefix (policy + 15 tool definitions): 6,000 tokens History grows about 400 tokens a step; output 250 tokens a step Input tokens: 9 x 6,000 + 400 x (0 + 1 + … + 8) = 68,400 Output tokens: 9 x 250 = 2,250 tau-bench measured the same shape (Jun 2024): 95.9% of the agent’s bill was input, “mainly due to long system prompt (domain policy + function definitions)”; gpt-4o: $0.38 per task. Caps: 30 actions (the benchmark’s), 2 writes (this task’s); a cap that trips pauses into a human queue. Cost per task, October 2026 rate cards Sonnet 5.5, uncached $0.159 Sonnet 5.5, prefix cached $0.071 Haiku 5.5, every step $0.008 Sonnet 5.5: $2 in, $10 out, $0.10 cache read, 1.25x on the first write. Haiku 5.5: $0.10 in, $0.50 out. Per success at retail pass^1 0.74 (tau2-bench’s best): 7.1 cents / 0.74 = 9.6 cents, and about one task in four reaches a person.
Figure 20. Nine model calls, two writes, one verified exit. The prefix dominates the bill, caching cuts it by more than half, and the small model cuts it by twenty times; but the number that governs the budget is the quarter of tasks that end in a human queue, which only the stop seam can move. Sizes are the author’s assumptions; prices from Anthropic (7 October 2026); shape from tau-bench (17 June 2024) and tau2-bench (9 June 2025).

The patterns, by seam

The table collects every pattern in this essay with the seam it belongs to, the problem it solves, the source that introduced or measured it, the failure mode the source reports, and when not to use it. It is meant to be copied into a design review.

PatternSeamWhat it buysFailure modeWhen not to use it
ReAct interleaving
Yao et al., Oct 2022
ModelGrounds reasoning in observations; recovers mid-taskRepetitive loop that cannot exit; derails on empty results (23%)Capped at 7 steps by its authors; use plan-first when steps are foreseeable
Prompt chaining
Anthropic, Dec 2024
ModelFixed subtasks with a gate between themLatency; brittle if subtasks are not fixedWhen the decomposition changes with the input
Routing
Anthropic, Dec 2024; author, Jun 2026
ModelSend a class of input to a specialised prompt or modelMisclassification at the gateWhen classes cannot be separated accurately
Parallelisation
Anthropic, Dec 2024
ModelSectioning for speed; voting for confidenceVotes are an expensive self-consistency (Huang, Table 7)When sections share state
Plan-and-execute
ReWOO, May 2023; LLMCompiler, Dec 2023
ModelPlan once, stop re-sending history: 64% fewer tokens; up to 3.7x fasterA wrong plan cannot be repaired mid-runWhen the next step depends on an unforeseeable observation
Reflection with a verifier
Reflexion, Mar 2023; CRITIC, May 2023
Model + stopHumanEval 80.1 to 91.0 with unit testsSelf-written tests lie (MBPP down 3 points); weak models gain nothingWithout an external signal: accuracy falls, calls triple (Huang, Oct 2023)
Think step before a write
Anthropic, Mar 2025; SABER, Nov 2025
ModelAirline pass^1 0.332 to 0.584; failures cluster on mutating actionsLonger prompts and outputsNon-sequential calls; simple instruction following
Small model for bounded steps
author, Oct 2026; Anthropic, Oct 2026
ModelClassify, extract, check at $0.10 per million inputOut-of-scope acceptance if the threshold is looseSteps that need judgment
Function calling
Toolformer, Feb 2023; tau-bench, Jun 2024
ToolStructured calls against a schema; beats text actionsHallucinated identifiers (0.46 per task for gpt-4o)Compositions of many calls: use code
MCP
Anthropic, Nov 2024; spec 2026-07-28
ToolOne protocol for tools, resources, promptsStateless since July 2026: handles must live in contextNot a security boundary; the spec says so
Agent-computer interface
SWE-agent, May 2024; Anthropic, Sep 2025
ToolLint in the editor, 100-line windows, concise results: +3 to +8 points eachExhaustive search on paginated tools; bloated tool sets“More tools don’t always lead to better outcomes”
Code as action
CodeAct, Feb 2024; Anthropic, Nov 2025
Tool74.4 vs 53.7 success; 150,000 to 2,000 tokensNeeds a sandbox; weak models gain littleSingle atomic calls (JSON wins, 82.7 vs 76.7)
Tool search
Anthropic, Nov 2025
Tool + contextDefinitions on demand: ~77K to ~8.7K tokens; MCP eval 49% to 74%An extra call to find the toolFewer than ten tools, or tools used every session
Computer use
Anthropic, Oct 2024; OpenAI, Jan 2025
ToolAny interface becomes a tool; OSWorld 14.9 to above humanPixel-level error; cost per step; side effectsWhere an API exists; without confirmation gates
Tool-result clearing
Anthropic, Sep 2025
ContextLightest compaction: +29% on an agentic search evalA cleared result the model neededWhen the result is the task’s evidence
Memory files and notes
MemGPT, Oct 2023; Manus, Jul 2025
ContextPersistent, unbounded, operable by the agentStale notes; model overwrites structure (use JSON)Short tasks that fit the window
Compaction
Anthropic, Sep 2025; OpenAI, Feb 2026
ContextLong sessions in one window; 84% fewer tokens on a 100-turn evalIrreversible loss; cache miss on every rewriteBefore clearing results and keeping notes
Sub-agent isolation
Anthropic, Jun and Sep 2025
ContextAbsorbs tens of thousands of tokens, returns 1,000 to 2,000Tokens multiply (about 15x over chat)When all parts must share the same context (part 2)
Reset vs compact
Anthropic, Mar and Apr 2026
ContextFresh window beats a summary when the model wraps up earlyDead weight on the next model generationKeep behind a flag with a date
Shift handover
Anthropic, Nov 2025 and Feb 2026
Context + stopMany short sessions; 2,000 sessions built a compilerPremature “done”; too much per sessionTasks that fit one window
Structured final output
OpenAI guide, Apr 2025
StopValidated exit; the schema is the stop ruleA valid-looking wrong answerOpen-ended outputs with no schema
Verifier gate
Claude Code docs; Anthropic, Mar 2026
StopTests, linters, a sceptical evaluator agentEvaluator that approves anyway without tuningWhen no external check exists: build one first
Step and write caps
tau-bench, Jun 2024; SABER
Stop30 actions; 7-action cliff; count the writesToo tight raises escalation; too loose burns budgetReplace with a verifier where one exists
Spend cap that pauses
Anthropic, Oct 2026; Agent SDK
Stop3 to 5x a normal run, tightened later; maxBudgetUsdUnlimited by default in the SDKNever: every loop needs one
Human checkpoint
MCP spec; OpenAI Operator; Block, Oct 2026
StopDeny a call; confirm side effects; two humans approve a deployApproval fatigue; a rule the agent reads is a requestReversible, low-stakes actions
Do not open the loop
Agentless, Jul 2024
Stop32.00% at $0.70 vs 23.00% at $1.62None: the pipeline cannot run awayTasks that do not decompose into verifiable phases
Table 1. Every pattern in this essay with its seam, what it buys, how it fails, and when not to use it. Numbers are those cited in the text, with their sources.

What I would build, and in what order

These are the rules I apply when a team brings me an agent design. They are ordered by how often the missing one turns out to be the problem.

Write the stop condition first. Before the prompt, before the tools.

  1. Write the stop condition first. Before the prompt, before the tools. The loop ends on a validated structured output or on a cap, and a cap pauses into a queue a person can see. If the only stop is the model saying it is done, you have not finished the design.
  2. Count writes, not steps. Budget the state-changing actions separately, gate each with a reflection that reads the record it is about to change, and treat tau2-bench’s seven-action cliff as the working limit for one loop. Longer tasks are several loops with a handoff.
  3. Measure pass^k on your own tasks. Twenty to fifty tasks drawn from real failures, four trials each, graded on end state from a clean environment, reported with cost per task and escalation rate. Report pass^4 to the business, never pass@1.
  4. Do not open the loop if a pipeline will do. If the task decomposes into fixed phases with a verifier at each, build the workflow. Agentless beat the agents on cost by a factor of two to four and on resolution rate by nine to fourteen points, and the gap came from never having to decide when to stop.
  5. Reflection reads an external signal or it is deleted. A test, an interpreter, a search result, a schema, a separately prompted evaluator. A model re-reading its own answer lowers accuracy and triples the calls; the evidence has been in the literature since October 2023.
  6. Design the tool contract as carefully as the prompt. Concise results, readable identifiers, errors that say how to fix the call, consolidated tools with distinct purposes, definitions loaded on demand once there are more than ten, and code as the action language once calls compose. The ablations move scores by three to eight points each, which is more than most model upgrades.
  7. Keep the context append-only and the prefix stable. Clear tool results before you summarise; keep notes in files; isolate noisy sub-tasks in a sub-agent; compact last and late. Every rewrite of history is a cache miss, and in a 100-to-1 workload the cache is the bill.
  8. Put every harness assumption behind a flag. Context resets were right for one model generation and dead weight for the next. A harness is a set of beliefs about what the model cannot do, and each belief needs a date and a way to switch it off.
  9. Route the bounded decisions to a bounded model. Most steps in a loop are classifications, extractions and checks. Send them to a small model or a trained classifier and keep the reasoning model for judgment; the loop is the routing workflow applied one step at a time.
  10. Record the trace in a schema that names the seams. One span per model call, tool call and sub-agent, with tokens and cost on each, so that when pass^k moves you can see which seam moved it. The observability that Anthropic put on its platform on 14 October 2026 spans exactly these events, and the incident note of 9 October is what it looks like to read such traces after the fact.

The pattern is the seam

The two episodes I cited as evidence, from the same company five days apart, are worth returning to. One cut its own agents off from the live internet because they had found ways through the tool seam that nobody intended; the other described a merge queue handling 30,000 agent-written changes a day because the stop seam had moved from the engineer to the system. Neither is a story about a pattern failing. Both are stories about a seam being redrawn by the people who understood it best, after the evidence came in. That is what this discipline looks like from the inside. The patterns in this essay are not a menu; they are the small set of decisions available at four places in a short program, and the measured record says which decisions hold. Part 2 takes the same four seams and asks what happens when there are many loops, and many windows, and the decisions have to travel between them. The short answer is that most of them do not.

Agentic architecture patterns · You have read Part 1 of 4

Infographic: a dot plot of the change in success from adding agents at equal compute across six benchmarks, ordered from work that splits to work where each decision depends on the last, from plus 80.8 percent on Finance-Agent to minus 70 percent on PlanCraft, coloured by architecture; beside it a table of turns, error amplification and success per thousand tokens for five architectures, and three key numbers: 97 percent merge interference recovered to 82 percent by one message, 84.7 percent of report errors starting at the orchestrator, and $2.05 against $0.33 for one agent versus a lead with five small workers.
Next in the series · Part 2 of 4 · 62 min readAgentic architecture patterns, part 2: many agents, and the ways they fail together

Many agents are a partitioning decision, not a staffing one. Where the work splits, teams gain 80 percent at equal compute; where decisions must travel, every team loses. Eight patterns and their failure record, drawn.

Continue to Part 2 →

Sources

  1. Anthropic. Investigating unintended model actions. 9 October 2026.
  2. Anthropic. Redesigning source control at Anthropic. 13 October 2026.
  3. Anthropic. Building effective agents. 19 December 2024.
  4. OpenAI. A practical guide to building agents. April 2025.
  5. OpenAI. OpenAI Agents SDK: Running agents. Documentation, read October 2026.
  6. Google. Agents (Wiesinger, Marlow and Vuskovic). September 2024.
  7. Google. Agent Development Kit: Loop agents. Documentation, read October 2026.
  8. Springer. Antonio Gulli, Agentic Design Patterns. November 2025.
  9. Anthropic. Best practices for Claude Code. Documentation, read October 2026.
  10. arXiv. Yao et al., ReAct: Synergizing Reasoning and Acting in Language Models. 6 October 2022.
  11. arXiv. Schick et al., Toolformer: Language Models Can Teach Themselves to Use Tools. 9 February 2023.
  12. arXiv. Wang et al., Plan-and-Solve Prompting. 6 May 2023.
  13. arXiv. Xu et al., ReWOO: Decoupling Reasoning from Observations for Efficient Augmented Language Models. 23 May 2023.
  14. arXiv. Kim et al., An LLM Compiler for Parallel Function Calling. 7 December 2023.
  15. arXiv. Shinn et al., Reflexion: Language Agents with Verbal Reinforcement Learning. 20 March 2023.
  16. arXiv. Madaan et al., Self-Refine: Iterative Refinement with Self-Feedback. 30 March 2023.
  17. arXiv. Gou et al., CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing. 19 May 2023.
  18. arXiv. Huang et al., Large Language Models Cannot Self-Correct Reasoning Yet. 3 October 2023.
  19. Anthropic. The “think” tool: Enabling Claude to stop and think in complex tool use situations. 20 March 2025.
  20. arXiv. Cuadron et al., SABER: Small Actions, Big Errors, Safeguarding Mutating Steps in LLM Agents. 26 November 2025.
  21. Anthropic. Claude Haiku 5.5. 7 October 2026.
  22. Anthropic. Writing effective tools for agents, with agents. 11 September 2025.
  23. arXiv. Wang et al., Executable Code Actions Elicit Better LLM Agents. 1 February 2024.
  24. Anthropic. Introducing the Model Context Protocol. 25 November 2024.
  25. Model Context Protocol. Specification 2026-07-28: Key changes. 28 July 2026.
  26. Model Context Protocol. Specification 2026-07-28: Tools. 28 July 2026.
  27. arXiv. Yang et al., SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. 6 May 2024.
  28. Anthropic. Raising the bar on SWE-bench Verified with Claude 3.5 Sonnet. 6 January 2025.
  29. Anthropic. Code execution with MCP: Building more efficient agents. 4 November 2025.
  30. Anthropic. Introducing advanced tool use on the Claude Developer Platform. 24 November 2025.
  31. Anthropic. Introducing computer use, a new Claude 3.5 Sonnet, and Claude 3.5 Haiku. 22 October 2024.
  32. OpenAI. Computer-Using Agent. 23 January 2025.
  33. OpenAI. Introducing Operator. 23 January 2025.
  34. Anthropic. Effective context engineering for AI agents. 29 September 2025.
  35. arXiv. Packer et al., MemGPT: Towards LLMs as Operating Systems. 12 October 2023.
  36. Anthropic. Managing context on the Claude Developer Platform. 29 September 2025.
  37. OpenAI. Shell + Skills + Compaction: Tips for long-running agents that do real work. February 2026.
  38. Manus. Context Engineering for AI Agents: Lessons from Building Manus. 18 July 2025.
  39. Anthropic. Equipping agents for the real world with Agent Skills. 16 October 2025.
  40. Anthropic. Subagents in the SDK. Documentation, read October 2026.
  41. Anthropic. How we built our multi-agent research system. 13 June 2025.
  42. Anthropic. Effective harnesses for long-running agents. 26 November 2025.
  43. Anthropic. Building a C compiler with a team of parallel Claudes. 5 February 2026.
  44. Anthropic. Harness design for long-running application development. 24 March 2026.
  45. Anthropic. Scaling Managed Agents: Decoupling the brain from the hands. 8 April 2026.
  46. arXiv. Yao et al., tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. 17 June 2024.
  47. arXiv. Barres et al., tau2-bench: Evaluating Conversational Agents in a Dual-Control Environment. 9 June 2025.
  48. arXiv. Shi et al., tau-Knowledge: Evaluating Conversational Agents over Unstructured Knowledge. 4 March 2026.
  49. Anthropic. Demystifying evals for AI agents. 9 January 2026.
  50. arXiv. Xia et al., Agentless: Demystifying LLM-based Software Engineering Agents. 1 July 2024.
  51. Anthropic. Building effective agent automations. 8 October 2026.
  52. Anthropic. How Block orchestrates Claude Fable across thousands of pull requests. 8 October 2026.
  53. Anthropic. Agent observability on the Claude Platform. 14 October 2026.
Ashish Kumar

Ashish KumarHead of Platforms, AI & Data at Tata Group. Previously applied AI at Ola Krutrim, data science at Salesken, and conversational AI at Reliance Jio Haptik and Active.Ai. Full biography · LinkedIn