Skip to content
zero2vibecodelearn vibe coding
Claude Code: Pro LevelBy Mikhail Kuzmitskii

Subagents, workflows or agent teams: how to choose in Claude Code

Claude Code has three ways to split work between workers: subagents, dynamic workflows and agent teams. The real difference is who holds the plan. Three questions, asked in order, tell you which one a task needs — and every step up costs more tokens.

Once you know Claude Code can hand work to other agents, it is tempting to reach for the biggest setup every time. More workers feels like more work done. In practice every extra worker is a separate context and a separate stream of requests, and the most common mistake is paying for a team when one conversation would have done.

Paper boats on dark water: one sailing alone, several following a dotted route

This is the second post in a series on the Claude Code: Pro Level course. It condenses three lessons: choosing an orchestration pattern, dynamic workflows and agent teams.

Who holds the plan

All three patterns hand pieces of a task to workers. What separates them is who holds the plan:

PatternWho holds the planHow results come back
Main conversationyou and Claude, in one contextright in the conversation
SubagentsClaude, deciding turn by turneach result returns to your conversation
Workflowa script Claude wrotethe script keeps intermediate results; only the final one reaches the conversation
Agent teama lead; teammates message each other directlythrough the lead and the messages between teammates

Agent teams are experimental and off by default. Keep that in mind before you plan around them.

Three questions, in order

Each pattern beyond a single conversation adds cost: every subagent and every workflow agent sends its own requests, and a team uses noticeably more tokens than one session. So ask these in order and stop at the first yes:

  1. Can one conversation handle it without filling the context? Then stay in the main conversation.
  2. Do the workers need to talk to each other? Then an agent team.
  3. Do you need many agents, cross-checked findings or reruns? Then a workflow. Otherwise, subagents.

Subagents: a few independent errands

Say a newcomer needs two sentences about each of the src, test and docs folders. Doing it in one conversation would fill your context with files you will never need again. The three descriptions do not depend on each other, and you need them once. That is a subagent job:

Explore the src, test and docs folders in parallel, with separate subagents, and give me two sentences about each.

In an interactive session, subagents run in the background by default and your input stays free. /tasks lists them with their state and model, and Enter on a row opens that subagent’s transcript. Afterwards, /usage on Pro, Max, Team and Enterprise plans breaks down roughly how much went to subagents, skills, plugins and MCP servers — an estimate, not a bill.

If you want a record of who Claude actually started, the lesson shows a SubagentStart hook that appends each subagent’s agent_id and agent_type to a log file. Hooks get their own post in this series.

Workflows: when the plan should be code

A dynamic workflow is a JavaScript script that Claude writes for your task. The script launches the agents, keeps their results in its own variables and returns only the final answer to your conversation. The plan lives in code, not in Claude’s head, which buys you three things: you can read it before it runs, have independent agents verify each other’s findings, and save it to run again.

You ask for one simply by saying “workflow”:

use a workflow to audit every file under src/ for errors that are caught and then ignored, and adversarially verify each finding before reporting it

Before it runs, Claude Code shows the plan’s phases and offers Yes, run it, View raw script or No. Choose View raw script or press Ctrl+G and actually read it: how many agents, what each does, whether any of them edit files. Inside the script, agent() starts one agent, pipeline() starts one per item in a list and parallel() starts a set at once.

While a run is going, /workflows lets you watch it: p pauses, x stops, s saves the script to .claude/workflows/ (shared once you commit it) or ~/.claude/workflows/ (yours, in every project). A saved script runs as /<name> from the next session.

On the Pro plan, workflows stay off until you turn on the Dynamic workflows row in /config.

Auto mode and workflows

To keep runs small, /config workflowSizeGuideline=small asks Claude to plan as few agents as possible. It is guidance, not a limit. Starting the session with --model sonnet also helps, since workflow agents use the session’s model unless something else sets it.

Agent teams: when the workers must argue

An agent team is several full Claude Code sessions. Yours is the lead; it spawns teammates, each with its own context, and they message each other directly. A teammate loads your CLAUDE.md, MCP servers and skills plus the task from the lead, but not the lead’s conversation, so the task has to carry everything it needs.

The lesson recommends turning teams on per session rather than globally: a separate settings file with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS set to 1 in env, started with claude --settings. Teammates can be built from your subagent definitions, and read-only reviewers with tools: Read, Grep, Glob are a good default.

Where a team earns its cost is a bug with an unknown cause: three teammates each own one hypothesis and challenge the others, and the lead records the explanation that survived. When they are done, stop them by name — a teammate whose row disappeared from the panel is hidden, not stopped.

If you need parallel edits

A cheat sheet

The task looks likeStart with
fits in one conversationthe main conversation
a few independent lookups, oncesubagents
the same check across many files, verified, repeateda workflow
independent views that must challenge each otheran agent team

Frequently asked questions

What is the difference between a workflow and subagents?

With subagents, Claude decides turn by turn whom to call, and every result comes back into your conversation. With a workflow, a script holds the plan, keeps the intermediate results to itself and returns only the final one. You can read, stop, save and rerun the script.

How do I turn on agent teams?

Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1. The lesson puts it in the env block of a separate settings file and starts the lead with claude --settings, so teams are on only for that session.

Which pattern is the cheapest?

The main conversation. Each step up the ladder adds requests: subagents and workflow agents send their own, and a team uses noticeably more tokens than a single session.

Practice next

Each of the three lessons — choosing a pattern, workflows and agent teams — has a practice terminal and a simulated session, so you can try the delegation log, a saved workflow script and a team settings file before spending real tokens on them.

Read next

Try it hands-on

Free interactive courses on this topic — in your browser, from zero.