Summary note: This is a summary of roshan moolya’s article, “Your Biggest Claude Code Workflow Mistake: A Practical Guide to Setting Up Sub-Agents” (29 November 2026), published on Medium, not a reprint of the original. Original link: https://medium.com/@roshanmoolya89/your-biggest-claude-code-workflow-mistake-a-practical-guide-to-setting-up-sub-agents-faa1c3de1bb0

Note: this article is itself a write-up of AI Labs’ YouTube video, “Anthropic Just Revealed Your Biggest Claude Code Workflow Mistake” (video link: https://www.youtube.com/watch?v=c23zV72oegc), which in turn explains an article Anthropic published comparing agent setups across several companies. The video does not give the Anthropic article’s title or link in its spoken content, so the claims here follow roshan’s write-up and the video it cites. When checked (30 November, around 09:00), x.com returned HTTP 403 across the site, so the original X post for this article could not be opened. The diagram in the original could not be obtained through the page fetch, so this summary has no images.

Claude Code often hands parts of a task to separate agents behind the scenes, and any custom agents you build run on top of that. Each of those agents counts towards your usage on its own, so a workflow with lots of them can use up your whole limit before the work is even done.

Anthropic’s team compared different agent setups across several companies and published an article on how they should be built instead. AI Labs turned it into a video, and roshan moolya turned the video into this guide. The core judgment: the problem is not agents themselves, but how they are set up. Here is Anthropic’s full analysis, in the order the video presents it.

First, the cost: why sub-agents are expensive

Sub-agents are part of almost every workflow: each one works with its own separate memory, which suits tasks with many steps that can be split off. Claude Code and other agents already use them on their own whenever they decide a task does not need the whole conversation. Anthropic itself calls sub-agents a core part of how workflows are built, and says they are useful for reviewing work and for running multiple tasks at the same time.

But sub-agents are really costly. AI Labs lists four problems:

Problem 1: every sub-agent starts from scratch. A sub-agent does not see your conversation or the files your main session has already read. All it gets is a short prompt from Claude about the job. It then has to load your project rules and read the files all over again. Starting fresh sounds like a good thing, but it becomes a problem when a new agent has to read the same files your main session already went through, because all of that counts towards your usage again.

Problem 2: only a summary comes back. Most of the time that is exactly what the main session needs, since it only needs the answer and not all the work. But it becomes a problem when the next agent needs the actual work. If you split one job into steps and give each step its own sub-agent, every step only gets a summary of the one before it, so a bit of detail is lost each time the work is passed on. Anthropic compares this to a game of telephone, where the main agent carries the message from one agent to the next. The main session can only put together the results that came back to it, so it never sees the full picture it would have had if it had done every step itself.

Problem 3: agent sprawl. Custom agents pile up. Every time a job feels a little different, it is easy to create a new agent for it, and over time you end up with lots of agents doing almost the same work. Anthropic calls this agent sprawl. It matters because Claude reads the agents’ descriptions to pick which one to use, so when two of them sound alike, it can give your job to the wrong one.

Problem 4: handoffs slow everything down. Every time work passes from one agent to another, the workflow slows down. One of Anthropic’s customers tested their setup with lots of agents against a single agent, and the single agent ran about twice as fast. Anthropic’s team saw the same thing across several companies: one main agent that was set up properly usually did better than a setup full of badly managed sub-agents, and it often cost less too.

(The video also includes a sponsored segment for Stape, a free open-source Google Tag Manager MCP server with server-side hosting from $17 a month. That is the video’s sponsor, not Anthropic’s guidance.)

Principle 1: let your main session plan and do the work

If one main agent usually does better, the first thing to get right is what your main session does.

A lot of Claude Code workflows run one step after another. A planning agent writes the plan, the main agent hands that plan to a builder, and the result is sent on to a tester. In that arrangement the main session just passes the work along and never does any of it.

Anthropic says the model can now handle most of that on its own. What they recommend is one model in one session that plans the work and does it too. It writes its own plan at the start and updates it as results come in. When each step of a job depends on what the last step found, the whole job should stay in your main session. So you do not need to build custom agents for a task whose parts rely on each other: you can give your main session the goal and let it work out the steps itself.

Principle 2: the three-case test for keeping a sub-agent

When the work gets too much for your main session, the next step is to decide which jobs get their own sub-agent. Since every sub-agent starts from scratch, Anthropic gives three cases where that cost is worth paying:

  • Case 1: your main session is getting worse because it carries too much. You might think the answer is a fresh session, but then you would lose the plan and every decision made so far. Instead, parts of the job your main session will not need again can go to a sub-agent. Example: if you need tests written for a feature before you build it, your main session does not need to know how those tests were written, so a separate agent fits.
  • Case 2: several jobs need to run side by side on clean context. Each job runs in a clean context window and can be thrown away when done. Example: if you need a few separate pages built at the same time, each page can go to its own sub-agent, because none of them needs to know what is happening on the other pages. Whenever jobs can run side by side without needing each other, each can have its own agent.
  • Case 3: one agent keeps picking the wrong tools, or its instructions clash. The fix is to split the work across separate agents so each one only gets a few tools and a set of instructions that fit together.

A sub-agent that exists only because a job feels separate, such as a “design agent” or a “styling agent”, usually passes none of these three cases. Anthropic describes this same mistake as giving every type of problem its own sub-agent. If a job fits none of the three cases, it should stay in your main session, though it should still be set up carefully (covered later in the video).

Principle 3: split by context, not by type of task

Even when a job passes the test, how you split it off matters just as much. If you split work by type of task, you get two agents working on the same part of your app, and they can end up overwriting each other’s changes. Anthropic’s rule is to split your app by context, so each agent gets its own part of it.

Two agents on the same part also keep passing work back and forth, which is the game of telephone again. When agents work on separate parts of the app, they only need to hand back a short summary because nothing else depends on how they did the work.

The same applies to:

  • research, where you only care about the answer and not how it was found, and
  • reviewing finished work. A good example is a reviewer that only sees the changes and sends back a short report.

Anthropic also advises starting with the simplest setup that could work, such as one agent that builds and one that checks. The only sub-agents worth keeping are the ones that pass one of the three cases.

Principle 4: merge tightly coupled agents

There is another way to set agents up wrong. When one agent always has to wait for another to finish so it can work on its output, those two agents are really doing one job. Anthropic calls this a tightly coupled pair and says you should not split work between agents this way. The same goes for two sub-agents that work on the same data or that almost always get called together. Every handoff means another fresh start and another summary that loses detail, so they should be one agent. If your setup already has pairs like this, Anthropic says to merge the ones you use the most first.

The reviewer exception. Anthropic lists reviewing work as a good job for a sub-agent. So even though AI Labs’ own reviewer agent always runs right after the builder, they keep the two separate, as they have shown in earlier videos. The reason: the reviewer needs to look at the work without the builder’s reasoning in its head.

Principle 5: put instructions in skills, and give each sub-agent only what it needs

Once you know which jobs get their own agent, the next question is where each job’s instructions should live.

Turn repeated instructions into a skill. If you keep telling Claude to start an agent that reviews your code your way, those instructions should become a skill. A review is a job that works well as a sub-agent because the reviewer needs fresh eyes. You give that skill to the sub-agent, and it should be the only one it loads. If your main session needs the review rules while building, it can load the same skill, so you only write the instructions once.

Why skills are cheaper. A skill costs less than a sub-agent here because only its short description loads until the skill is needed, and then the whole thing loads. But a sub-agent with one skill can still end up loading much more than that skill, so each sub-agent should be set up with only what its job needs.

You do not have to edit files by hand, because you can ask Claude Code to set up each sub-agent for you:

  1. Limit it to one skill. Ask Claude Code to set up the agent so it only gets that one skill and is not allowed to load any others. You need to ask for both parts, because an agent that is merely given a skill can still go and find other skills on its own.
  2. Leave out project rules if the job does not need them. Claude Code’s own search and planning sub-agents already start without them to keep research fast and cheap.
  3. Use a cheaper, faster model for simple jobs, so you do not use up as much of your limit.

When a fresh agent is the wrong choice: use a fork. If the job needs what your main session already knows, use a fork. A fork is a type of agent that starts with a copy of your whole conversation and reuses what your main session has already read, so it costs less than a fresh agent that has to read everything again.

Verify the answer. The last part of the setup is what your main session does with an agent’s answer. Anthropic says your main session should check the answer against the actual files or results before acting on it. For example, when your review agent reports what it found, your main session checks it against the code before anything gets merged.

Principle 6: keep your CLAUDE.md lean, and use hard rules for hard limits

CLAUDE.md costs you repeatedly. The CLAUDE.md file is the one file your agents load every time they start, along with the prompt they are given. A long CLAUDE.md therefore costs you again on every sub-agent you run. Anthropic also says rules that were written to keep older models on track now make the agent slower and less flexible.

AI Labs covered this in an earlier video on how the creator of Claude Code uses it. The advice there: delete any line from your CLAUDE.md that Claude would have worked out on its own. Since a CLAUDE.md tends to grow over time, its rules can end up contradicting each other.

Let Claude Code audit it. You do not need to read through the file line by line, because Claude Code has a command, called doctor prompt audit in the video, that goes through your instruction files, skills and the rest of your setup, then shows you which instructions are out of date or clash with each other.

CLAUDE.md is guidance, not enforcement. If you want Claude to never do something, putting it in CLAUDE.md is not enough, because that file is just guidance and not a rule Claude is forced to follow.

To decide which actions need a hard rule, Lydia Halley (spelling as in the video transcript) from Anthropic’s Claude Code team asks one question: could you undo the action if Claude got it wrong?

  • Wrong code can always be fixed, so you can leave that to the model.
  • Deleted work or a leaked secret key cannot be taken back.

From there:

  • If you only want to approve an action before it runs, tell Claude in your CLAUDE.md to ask you first.
  • For actions that must never happen, use a deny rule in your permission settings, which blocks the action completely. Claude Code checks deny rules before any of your other permission rules, so nothing else can let that action through. For example, if you never want Claude reading the file where your secret keys live, a deny rule stops it from opening that file.
  • For actions a deny rule cannot describe, set up a hook that checks each action before Claude goes ahead with it.

Principle 7: measure every change with the same 10 tasks

Once your workflow is set up, you still do not know whether each change made it better or broke part of it. Anthropic’s advice is to run the same 10 tasks from your own work before and after every change and look at which tasks went from working to broken.

When Anthropic tried this on a sample support agent, folding one sub-agent into the main agent made it faster, but it also broke one of the steps it used to get right. That step only broke in one run out of two, so you need to run every task more than once.

If you want Claude Code to run these tests for you, the skill-creator plugin can run each one in a fresh sub-agent and compare the results with and without a skill.

Principle 8: audit and trim your skills too

Skills pile up the same way sub-agents do, so a workflow you set up today does not stay lean on its own. Every skill you have adds to what gets loaded in every session, whether it is used or not.

Claude Code has a command called skill doctor that goes through every skill in your session and tells you what each one costs and how often it is used. It also points out skills that have never been used and where to turn them off. The docs say to start with the skills that cost the most.

After trimming, each skill should do its own job with no overlap, and should be tested the same way as the rest of your setup. Anthropic says Claude can do most of this itself, with skills that build and test other skills and clean them up. For overlapping skills, the skill-creator plugin can go through your existing skills, trim them down and clear out the ones that repeat each other.

Migrating an existing workflow: measure, change one thing, keep what works

Anthropic says the idea behind all of this is to measure your setup, change one part at a time, and keep the changes that work. That is also how they say to move an existing workflow over:

  1. Build a small test.
  2. Fold one sub-agent into your main session.
  3. Keep it as a sub-agent only if the folded version does worse.
  4. Repeat for the next one.

Anthropic expects that as models get better and agents run for longer, more of your sub-agents will turn into skills and tools.

At a glance: the decision flow

The video ends by pulling all of this guidance into one decision flow: keep work in the main session unless a job passes one of the three cases; jobs that pass are split by context, set up lean, verified by the main session, and measured.

Key takeaways

  1. Each agent counts toward your usage separately, so many agents can drain your limit before the work finishes.
  2. Sub-agents start from scratch, return only summaries (the “game of telephone”), can sprawl, and add handoff delays. In one customer test a single agent ran about twice as fast.
  3. Default to one main session that plans and does the work.
  4. Keep a sub-agent only if it passes one of the three cases: context overload, parallel jobs on clean context, or tool and instruction clashes.
  5. Split by context, not by task type, and merge tightly coupled agents (reviewers are the exception).
  6. Put repeated instructions in skills, restrict each agent to what it needs, use cheaper models for simple jobs, and use forks when the job needs the main session’s knowledge.
  7. Have the main session verify sub-agent answers before acting.
  8. Keep CLAUDE.md lean, use the “could I undo it?” test, and enforce hard limits with deny rules and hooks.
  9. Measure with the same 10 tasks before and after each change, running each more than once, and audit skills with skill doctor.

Written byAuthor

Background music
Jump to comments
Settings
Back to top
Go to bottom
Collapse toolbox