Cindy Zhu.
Free guides
Building & apps Claude

Run a team of AI agents in Claude: the exact setup prompt

Hey, it's Cindy ๐ŸŒฑ You commented SWARM, so here is the whole thing: the setup prompt I paste when a project is too big for one chat.
btw the waitlist for AI System Club is now open! If you're keen on using AI to automate your content, video editing, job search, business or build AI agents, feel free to sign up (only if you want to hehe). Ps. the waitlist gets first dibs:)
the idea

Why a team beats one very long chat

When you push a whole project through a single conversation, everything shares one context window. The research you did at the start gets squeezed out by the code you wrote in the middle, and by the end Claude is politely guessing at decisions it made an hour ago. A team fixes that by giving each worker its own head. In Claude's words, a subagent is a specialised assistant that "handles specific types of tasks in its own isolated context window" and returns only a summary, so the exploration never clogs up your main thread (Claude Code subagents docs).

So the win is not raw speed. It is that each agent holds exactly one job, with nothing else competing for its attention, and you get a clean summary instead of ten thousand words of scrollback.


the shape

The four roles I split a build into

Four is the number that keeps working for me. Enough separation that nobody is doing two jobs, few enough that they are not tripping over the same files. Anthropic's own guidance lands in the same place: start with three to five and scale only when the work genuinely runs in parallel (agent teams docs).

๐Ÿ”Ž Researcher Gathers the raw material: competitor pages, positioning, real proof points, the facts that anything else in the build depends on. It never writes final copy, it hands over notes.
โœ๏ธ Copywriter Owns every word a human will read. It gets the researcher's notes plus your brand voice, and it writes headlines, body, buttons, error states, the lot.
๐Ÿ—๏ธ Builder Owns structure: files, components, layout, responsive behaviour. It drops the copy in as given rather than rewriting it, which is exactly why the voice survives.
๐Ÿ” QA reviewer Comes last and tries to break it: dead links, mobile layout, accessibility, and any factual claim the copy made that the research does not support.
๐Ÿ’ก The rule that makes this work: no two agents are allowed to write the same file. File collisions are the single most common way a parallel run turns into a mess, and Anthropic flags it as the thing to design around (avoid file conflicts).

do this first

Set it up from zero

  1. ๐Ÿ’ณ Check the plan gate honestly. Subagents live in Claude Code, and Claude Code needs a Claude Pro, Max, Team or Enterprise subscription, or a Claude Console account with prepaid credits. There is no free tier for this one. Current prices: claude.com/pricing.
  2. ๐Ÿ’ป Install it, or skip the terminal entirely. On macOS, Linux or WSL run curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell run irm https://claude.ai/install.ps1 | iex. If terminals are not your thing, Claude Code also runs in the browser at claude.ai/code and as a desktop app, and everything below works the same way there (all the ways to run it).
  3. ๐Ÿ“‚ Open the project folder. In your terminal, cd into the folder you want the work to happen in, then type claude and log in when it prompts you. Everything the team builds lands in that folder, so make it a fresh one for a new project.
  4. ๐Ÿ“‹ Paste the setup prompt. The full prompt is in the next section. Paste it as your first message, with your project description and brand voice filled in.
  5. ๐Ÿ‘€ Watch the panel, do not walk away. The agents appear in a panel under your prompt input. Use the up and down arrows to select one and press Enter to read its transcript or send it a note mid-flight. Checking in every few minutes beats discovering an hour later that one of them went the wrong way.
  6. โœ… Take delivery from the lead. Your main session is the lead. It merges the pieces and hands you one finished thing, plus the list of calls it made on your behalf. Read that list before you ship anything.

copy this

The exact agent team setup prompt

This is the one I paste. The plan-first paragraph matters more than it looks: making Claude name the roles and the file boundaries before it spawns anything is what stops two agents rewriting each other's work.

๐Ÿง  the agent team setup prompt
I want you to run this project as a team of agents instead of doing all of it yourself in one context window. Here is the whole job: [describe the entire project in three to five sentences, for example "build a five page marketing site for a Melbourne pilates studio, warm and minimal, with a class timetable and a booking page, and write all the real copy, no lorem ipsum"].

Before you spawn anything, write me a one page plan first. Name each agent, the single job it owns, the exact files or sections it is allowed to write to, and what it has to hand back when it is done. I want four of them: a researcher (competitors, positioning, proof points, anything factual the copy will rest on), a copywriter (every word a human reads, in the brand voice at the bottom of this message), a builder (file structure, components, responsive layout, and it uses the copy exactly as written rather than rewriting it), and a QA reviewer (dead links, mobile layout, accessibility, and any claim the copy makes that the research does not actually support). No two agents may write to the same file. Show me the plan and wait for my yes.

Once I approve, spawn them and give each one everything it needs inside its own spawn prompt, because they do not see this conversation and they do not inherit your history. Run the researcher first, hand its notes to the copywriter and the builder, and run the QA reviewer last on the assembled result. While they work, keep the shared task list updated so I can see what is claimed, in progress and done.

When they finish, you are the lead: merge the pieces into one working build, resolve any contradictions between them yourself rather than bouncing the question back to me, and then give me three things: the finished build, a short summary of what each agent actually did, and a list of every decision you made on my behalf that I should sanity check.

Brand voice, audience and constraints: [paste yours here, or write "ask me five questions first" if you want Claude to interview you before it starts].
๐ŸŒฑ If you would rather not hand over a whole project on the first go, swap the job description for something small and self contained, like "audit these three pages and tell me what to fix". Research and review tasks are the easiest place to see whether a team is actually earning its keep, which is exactly what Anthropic recommends for a first run.

make it permanent

Save the team so you never set it up again

Describing the same four roles every time gets old fast. A subagent definition is a small markdown file that holds a role permanently, and Claude picks it up on its own when a matching task shows up. Put them in .claude/agents/ inside the project (shared with anyone who has the folder) or in ~/.claude/agents/ so they follow you into every project you ever open.

You do not write these by hand. Ask Claude to write them:

๐Ÿ“ turn the team into permanent roles
Turn the four roles we just used into permanent subagent definitions so I never have to describe this team again. Create one markdown file per role in ~/.claude/agents/ named researcher.md, copywriter.md, builder.md and qa-reviewer.md.

Each file needs YAML frontmatter with a lowercase hyphenated name, a description written so you will reach for it automatically (say what the agent does AND when it should be used, because that description is the trigger), the tools it actually needs, and a model. Give the researcher and the QA reviewer read-only tools so they cannot quietly edit my files.

Under the frontmatter, write the system prompt for that role in the second person, covering what it owns, what it must never touch, the format it hands work back in, and its quality bar. Base all four on how we just worked, then show me the finished files and tell me how to check they loaded.

Here is the shape of what comes back, so you know what you are looking at when it lands:

---
name: copywriter
description: Writes all user-facing copy in the brand voice. Use when a build needs headlines, body copy, buttons or error text written or rewritten.
tools: Read, Grep, Glob, Write
model: sonnet
---
You own every word a human will read on this build.

Rules:
1. Work from the researcher's notes. Never invent a statistic, a testimonial or a client name.
2. Match the brand voice file exactly. Sentence case, no em dashes, no filler.
3. Write into copy/ only. Never touch the component or layout files.
4. Hand back a single file with every string, labelled by where it goes.
๐Ÿ’ก To call one on purpose instead of waiting for Claude to pick it, just say so in plain language: Use the qa-reviewer subagent to check the booking page. Full field reference is in the subagents docs.

the upgrade

When you want them to argue with each other

Normal subagents report back to you and never talk to each other. There is an experimental mode called agent teams where they do: teammates share a task list, message each other directly, and challenge each other's findings. It is genuinely useful when the answer is contested, like a bug with three plausible causes. As the docs put it, with several investigators actively trying to disprove each other, "the theory that survives is much more likely to be the actual root cause" (agent teams).

It is off by default. Turn it on in your settings.json:

{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}
โš ๏ธ Two honest catches. Agent teams use significantly more tokens than a single session, because every teammate is a whole separate Claude with its own context window, so save it for reviews and investigations that actually matter. And while it is switched on, a subagent that Claude names launches as a teammate, so teams can form even when you did not ask for one. Set the same variable to "0" to go back. Both are documented in the agent teams page.

good to know

The limits nobody mentions

๐Ÿ”ข Twenty at once Twenty subagents can run concurrently by default. Past that you get a "concurrent subagent limit reached" message. You can raise it with the CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS setting, but three to five is where the good results live.
๐Ÿง  They start blank A subagent does not inherit your conversation. It gets its spawn prompt, your project files and your CLAUDE.md, and nothing else, so anything you explained in chat has to be repeated in the spawn prompt.
๐Ÿชœ Three layers deep Subagents can spawn their own subagents, up to three layers by default. It is rarely what you want. Deep nesting mostly buys you a long wait and a summary of a summary.
๐Ÿ’ธ It is not free parallelism More agents means more tokens, and token use scales roughly with the number of active teammates. Anthropic's own cost guidance says single sessions are more cost effective for routine work.

the honest bit

About that 300 agent headline

The reel opened with Kimi K2.6, the open weight model from Moonshot AI that can coordinate up to 300 sub-agents across roughly 4,000 steps in one run (reported here). It is a real and impressive number. It is also not the thing standing between you and a finished project. Almost nobody has a task that genuinely splits 300 ways, and coordination overhead grows faster than the work does, which is why the advice on both sides is the same: a handful of well briefed agents beats a crowd. You do not need to switch tools for this workflow, you need to stop giving one chat five jobs.


Proof

the waitlist is now open

AI System Club is launching soon

Build AI systems with me through recorded lessons you can follow at your own pace. Join the waitlist for first access and the founding price.

btw this list gets first dibs
the moment doors open :)