← All posts

Guides · Sep 30, 2026

How to build a team of AI agents

How to split a large job between a team of AI agents in Claude Code, what it costs, and where loop and graph engineering come from.

Built by Simon + Claude

One loopEverything in one context windowA teamEach job with its own window

TL;DR

  • Graph engineering means thinking of your AI agents as a team of specialists, where each has its own role, does one thing and hands over to the next.
  • The idea itself is not new, and most of the building blocks in Claude Code need no code.
  • Start with the two prompts on a job you already do in several steps, and save the roles as subagents when the team works.

Graph engineering means splitting a large job into smaller ones and giving each to its own AI agent. Think of a team of specialists instead of one generalist. The map of who does what is called a graph, which is where the name comes from, but in this guide we call it a team.

This is a simplified explanation for people who are not developers and want to start using teams of agents in agentic tools like Claude Code and Codex. It builds on What is an AI agent?, where one agent runs a loop.

It may look advanced, but in practice it is as simple as putting the documents in a folder, opening it in Claude Code and typing this.

You

Make four agents to help me with [task]. Suggest the roles and the setup.

Once the team is set up, you just type this.

You

Work with the team for 60 minutes on [task].

And just like that, you are using both loop and graph engineering on your own work.

This uses a lot of tokens. If you are on Claude's Max plan, I definitely recommend it when you build agents in folders. It is powerful stuff.

One generalist or a team of specialists

One generalistGathersWritesReviewsOne window fills with everythingA team of specialistsGathersWritesChecksOwn window, one job each

Most people use AI in a single loop, with one agent, one long conversation and everything in the same context window, the text the AI can see at one time. It works most of the time and is still the right place to start.

When the job gets big, the loop struggles. The context window fills with everything the agent has read, and in the end it checks its own work. In a team, each job gets its own context window and a narrow brief. The analyst, the writer and the proofreader are three different people, as in a good team.

A competitor analysis as a team

Say you need an analysis of three competitors before a strategy meeting. In a single loop you ask for everything at once and get a text where it is hard to see what has been checked.

As a team, you write the brief and three agents gather in parallel, filing their findings with sources. One agent writes the analysis, another checks it against the sources, and you approve it before the meeting.

BriefYou write itThree competitorsAGathersBGathersCGathersAnalysisWritesCheckAgainst sourcesYouApproveBack if it does not hold

The last step matters most. Anthropic wrote about this in Patterns and problems in emerging multiagent systems in August 2026. When one agent in a team makes a bad decision, many of the others are likely to make the same one. A team is safer when a person, or a check against real numbers, has the final word.

A larger example with five roles

The competitor analysis has three identical jobs. In an investment memo on a listed company, the roles differ. The portfolio manager writes the brief, the investment committee decides, and between them work five subagents, each with its own brief.

ManagerWrites the brief1 CompanyThe reports2 IndustryMarket3 ModelBy script4 Devil's advocateThe case againstMemoYour session writes5 CheckSources, numbersCommitteeDecidesBack if it does not holdYou can step in at any point
  1. The company analyst reads the reports and presentations and writes company.md, with a source for every claim.
  2. The industry analyst covers the market and the competitors in industry.md, in parallel with the first.
  3. The model builder moves the numbers into the valuation model with a script, so they come out the same every time. Deterministic and non-deterministic AI explains why.
  4. The devil's advocate writes the strongest case against the investment. It did not write the case for it, so it is not bound by it.
  5. The checker reviews the memo your own Claude Code session writes from the four files. Sources, numbers and template must hold, or the memo goes back.

Each role can live as a file in .claude/agents in the project folder. Share the folder in Git, SharePoint or Google Drive, and the whole team uses the same roles next quarter. The roles become part of your AI capital.

The building blocks in Claude Code

Anthropic does not use the term graph engineering, but Claude Code has the building blocks, and most need no code.

  • Subagents are the roles in the team. Claude picks one from its short description, and each sends back a summary when it is done. We showed a first example in Anthropic's tips for Opus 5.5.
  • Skills are the recipe a role follows, so the job is done the same way every time. More in Skills in Claude Cowork.
  • Files in the folder are what the roles hand to each other, and you can read and check them yourself.
  • Workflows let Claude write a small script that runs many subagents at once, like the built-in /deep-research, which returns a report with sources.
  • Hooks are checks that always run at fixed points, mostly for whoever sets up the team for others.
WorkflowsRun many subagentsat onceFiles in the folderWhat the roles handto each otherSkillsThe recipe a rolefollowsSubagentsThe roles in the teamHooksChecks at fixed points/goalDecides when the jobis done
Each part of the team is a building block in Claude Code

Projects in Claude Code build the same idea into the app, in open beta for Pro and Max and rolling out gradually. One conversation spreads the work across parallel threads and shows what is finished and what is waiting for you.

A goal for the team with /goal

The team says who does what, and /goal says when the job is done. Type /goal and the goal on the same line, and Claude Code keeps working round after round without you typing anything in between.

After each round, a small, fast model reads the conversation and decides whether the goal is met. If not, Claude is told why and goes again, until the goal is met or the checking model decides it cannot be. The one doing the work is not the one approving it, as with the checker in the investment team.

Claude Code/goal Every claim has a sourceand the numbers match the model.Stop after 60 min.Claude doesthe workA small, fast modelchecks each roundNot met3 claims lacka sourceNot metRevenue doesnot matchGoal metClaude stopsRound 1Round 2Round 3Limit 60 min
The one doing the work is not the one approving it
You

/goal The memo in memo.md follows the template, every claim has a source and the numbers match the valuation model. You are done when the checker gives the memo a score of 9 or higher. Stop after 60 minutes.

A good goal has three things.

  • One thing that can be checked, such as every claim having a source or an empty queue of tickets.
  • How Claude should show it. The checking model reads only the conversation, not the files, so Claude has to write the result there.
  • A limit, for instance "stop after 60 minutes".

Type /goal on its own to see the goal, time, rounds and tokens used, and /goal clear to stop it. The goal does not change what Claude may do, so run it in auto mode if the team should work without asking you. The details are in Anthropic's documentation for /goal.

What it costs

A team costs more than a single agent. When Anthropic built its research system, one agent used about four times the tokens of an ordinary chat, and several agents about fifteen times.

The multi-agent system performed 90.2 per cent better than a single agent in Anthropic's own test on research tasks. Anthropic adds that the task has to be valuable enough to justify the cost.

1×Chatabout 4×One agentabout 15×Several agentsTokens compared with a chat,from Anthropic's research system,June 2025

The Claude Code documentation says the same about agent teams, which use far more tokens than a single session and are still experimental and switched off by default. When each step builds on the one before, a single session or subagents work better.

Build a team only when at least two parts of the job can run without waiting for each other, or when you need an independent check. Otherwise one good brief in one session is better.

Anthropic put it even more briefly in Building effective agents. Find the simplest solution, and make it more complex only when you need to. Sometimes that means no agents at all.

Loop and graph engineering

In June 2026 Addy Osmani wrote about loop engineering, where you build a small system that prompts the agent for you. It hands out the work, checks it and decides the next step until the goal is met, and the memory lives in files.

Graph engineering took off on X in July 2026, after Peter Steinberger asked whether people had moved on from loops to graphs.

The idea is older. Anthropic described the same patterns in Building effective agents in December 2024, and LangChain has built graphs of agents in LangGraph since January 2024.

How do you build a team?

This is what it looks like when you ask Claude Code for a team.

Claude Code

Reply to Claude

You get the most out of it when Claude Code looks at the work first. Open the folder you work in and ask for roles that fit what is in it, with one agent as team lead who hands out the work and puts the result together.

You

Suggest four agents that can work as a team with a team lead and that fit the content we work on in this folder.

Read the roles, change what does not fit, and let the team work. When it works, ask Claude Code to save the roles as subagents. They end up as files in .claude/agents in the project folder, so the team is ready next time, and colleagues who share the folder can use it too.

You

Save the roles as subagents in this project.

We go through this hands-on in our Claude Code bootcamps in Oslo.