Zero Labs
Industry News / AI

Fold Your Subagents Into One Agent Loop

Source · Towards AI By Kushal Banda

From the publisher’s feed, collected in the ZeroLabs newsroom.

Anthropic’s Applied AI team says one loop with skills and tools often beats a multi-agent harness. Where each subagent goes, when to keep one, and how to migrate without breaking what already works.This week I stopped a code-review skill from spawning five finder subagents on one diff. Five context windows, each handing a summary back to the parent. I had the same checks run inline, in the main session, and then made “no subagents, work inline” a rule in my Claude Code setup.That is one person’s setup and one skill. It proves nothing on its own. But a few weeks earlier, Anthropic’s Applied AI team had published the enterprise version of the same call.Most multi-agent systems are shaped like the org chartA subagent is an agent with its own context window, tools and instructions, run by a coordinator. Anthropic is clear that subagents are useful. They use them for verification, parallel work and splitting permissions, and their own multi-agent research system runs on them.The problem they describe is how large companies end up with them. A company wants one agent that fronts several products. Each product has its own team. So each team builds its own agent, and a platform team puts an orchestrator on top. The architecture becomes a copy of the org chart. That is Conway’s law, and they name it.They list what goes wrong next:Lossy handoffs. Someone has to decide what context passes between agents, and details drop in the back and forth.Subagent sprawl. Every team ships one. Companies end up with hundreds that overlap, follow no shared standard and have no single owner.The “Frankenprompt”. Every team adds a sentence to the system prompt. The rules start to conflict and the agent loses a consistent voice.Local evals. Each team writes evals tuned to its own subtask. Nobody owns the full set, so leadership decides from scores that only describe pieces.Latency. Every extra layer adds time. One customer that compared its multi-agent harness with a single agent loop saw roughly 2x faster runtime on the single loop.Across several enterprise deployments, a single agent with skills “frequently outperformed” both the one-giant-prompt design and the subagent design on quality, “often” at lower cost and latency per task.Why one loop works now when it did not beforeTeams split work across subagents for a real reason: one prompt could not hold everything. Anthropic gives three reasons that has changed.Shared context gives better answers. When results from several steps sit in one context window, the model can connect them. A set of summaries handed back by subagents loses exactly the detail that would let it do that.Progressive disclosure removes the bloat. The agent sees only short descriptions of its skills and tools. The full text loads when it is needed. Skills disclose instructions this way, and tool search does the same for tool definitions. Anthropic says it cut Claude Code’s system prompt for more advanced models by over 80%, partly through this.Models carry more. Starting with Opus 4.5, models could manage far more in one loop than most teams expected. Recent models narrate progress and check their own work, which makes some harness code redundant. They add a point I had not thought about: in migrations they helped with, rigid multi-agent structures were often what stopped a newer model from doing more of the work. A simpler loop is easier to move to the next model.What the loop looks likeHere is the design they suggest working toward, as I read it:One model, one context window, an open-ended tool loop.The harness sets the limits: a turn budget, a cost budget, write gates.Each turn, the model emits a batch of tool calls. The harness runs them in parallel and returns raw results to the same model.The model then picks the next step: another batch, a question for the user, or an answer.The loop stops on an answer or a spent budget. A verifier can check the answer after.The biggest change sits in one line: the model writes its plan in context on the first turn and revises it as results arrive. In an orchestrator setup, one component plans and others execute. Here the model that wrote the plan is the one carrying it out, so it can change course mid-task.In code, the core is small. This is my sketch of the shape, not Anthropic’s code:def run(task, budget): context = [system_prompt, skill_descriptions, task] while not budget.spent(): reply = model(context) # plan, tool calls, or an answer if reply.is_answer: return verify(reply) # optional check results = run_parallel(reply.tool_calls) # write gates live in the tools context += [reply, results] # raw results, not summaries budget.charge(reply) return budget_exhausted(context)Everything a subagent used to own has to land somewhere in that loop.Where each part of your subagent system goesRouter or intent classifier. Not needed. The model decides each step. The same goes for code that rewrites the plan from a catalog of rules.Fixed reasoning pipeline. Becomes the plan in context.Specialist subagent prompts. The ordering and domain procedure they held become skills, loaded when the task calls for them.Subagent API calls. Become MCP tools. Group them by user intent, one tool per job, not one per API. Anthropic says tool choice tends to degrade past 30 to 50 tool definitions in the system prompt, so use tool search with deferred loading.Hard limits. Validation, approval gates and per-user permissions move inside the tools. If tool Y needs tool X’s output, Y checks for it and returns an instruction the model can act on. If a user may not see something, the tool returns a plain refusal the model can read. One loop can then serve users with different access, without one agent per permission level.Reference material pasted into prompts. Goes behind a search or lookup tool, or ships as reference files inside a skill. Code should stop retrieving it and pasting it in.What stays as code. Cheap lookups that are almost always needed, like resolving an entity up front. And the mechanical parts: building payloads, parsing streams, resuming after a clarifying question.The permissions point is the one I would steal first. A tool that answers “this user can’t see refunds over $500” in plain text is a guardrail the model can reason about. A separate agent per access level is a guardrail it never sees.Keep a subagent in three casesAnthropic does not say subagents are dead. They say keep one when:Context bloat measurably hurts a single loop.Tasks need to run in parallel with fresh context windows you can throw away afterwards.A single agent keeps picking the wrong tools, or the system prompt holds instructions that conflict.If you do split, split by context, not by problem type. Give each subagent a piece of work that needs little from the rest of the system and hands back a compact result: an independent research path, a component with a clean interface, a black-box verifier. Split by problem type and the agents play telephone, losing fidelity with each handoff.Even when you keep one, have the main agent call it as a tool so the main agent keeps the conversation. A full handoff, where the subagent takes over, only makes sense when it has to talk to the user directly.Migrate one subagent at a time1. Build an eval first. One shared end-to-end set, owned by a central team, plus small eval sets each team ships with its skill. They say 10 golden examples is enough to start. Grade the final answer against a rubric. While an orchestrator still exists, also track routing accuracy: did it pick the right subagent? After a fold, track whether the agent loaded the right skill or called the right tool. If your systems are hard to replay, record timestamps on key events so you can replay them later as targeted evals.2. Call your subagents as tools. No rewrite needed. You get a shared response schema, the main agent can check conclusions against real data, and you get a baseline score. The costs remain: each specialist still has its own prompt, owner and evals, each call still returns a lossy summary, and each call is a nested model loop that adds latency.3. Merge tightly coupled specialists. If much of your traffic is specialist A followed by specialist B, or two specialists touch the same data, they are one domain agent in practice. Merge them, starting with the most-used.4. Fold one subagent. Its prompts become a skill. Its API calls become MCP tools.5. Compare, and look at which tasks flipped. This is the most useful part of the article. On a sample support agent, folding one subagent into another lowered latency. It also broke a process that had been passing. The main agent held the order lookup tool and answered on its own, without asking the shipping specialist for the delivery date. That break showed up in one run out of two.So before each change, make sure the eval has a task for every chain of agents that runs together in production and for every rule the agent must not break. Run each task more than once. Keep the subagent only if the folded version scores worse. Then fold the next one.Teams own skills and tools, one small team owns the promptFolding the architecture also changes who owns what. Teams stop owning agents and start owning skills and tools, each with a named owner who keeps them distinct and ships them with evals. One small central team owns the system prompt and end-to-end quality, and vets every new skill, tool and eval before it ships. Small, because coordination cost grows with headcount.Anthropic also ships a migration kit for this (build-eval, prompt-audit, hillclimb, cost-optimize). I haven't run it.Where to start?List your subagents and note which team owns each. Mark any that exist only because of a team boundary.Find the pair most often called back to back. That is your first merge.Write 10 golden examples, including one for every chain that runs together and one for every rule the agent must not break.Call your subagents as tools and record the baseline.Fold one. Run every task at least twice. Read the list of flipped tasks before you read the score.Which of your subagents would survive that test? If you found this useful, give it a clap and drop a comment. I’d love to hear your thoughts 🙌Source: Anthropic, “Building agents: When to fold subagents into your main agent loop”, Diane Sarkis, October 22, 2026.Keep readingHow Agents Manage Other Agents: Four Subagents Patterns in 2026The Anatomy of an Agent HarnessI Counted 30 Days of My Claude Code Tokens. 98% Were Cache Reads.Claude Code Mods Explained: What They Can Do That Hooks and Skills Can’tDon’t install 30 Claude Code plugins. Install these 6.Follow me here on Medium for more Claude Code deep dives, connect on LinkedIn, or follow me on X, where I post every day about what I’m building.Fold Your Subagents Into One Agent Loop was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.