AI Development
Dynamic workflows and graph engineering in Claude Code: when to use multiple AI agents and when one is enough
Claude Code dynamic workflows build a team of AI agents on the fly. They pay off for parallel work, cross-checks and huge tasks; otherwise a single agent is enough.

Luca Di Domenico
· 4 min read
In short
Claude Code dynamic workflows build a team of AI agents on the fly and decide who does what and in which order; you trigger them with the ultracode keyword or by asking for a workflow. Graph engineering is the design of that team, and there are four main architectures (chain, fan-out, verification, loop). They only make sense with lots of independent work, when one agent has to check another, or when the task is too big for a single agent. My rule: I run the task three times with a single agent, and if at least two out of three results are good, I don’t need more agents.
Claude Code dynamic workflows let Claude build a team of AI agents on the fly: it decides each agent’s job and the order they work in. They work well in three specific cases. For most tasks a single agent is enough, and adding more only brings cost and coordination.
What are Claude Code dynamic workflows?
A dynamic workflow is a work plan that Claude Code writes on its own, as a script, to split a task across several agents. The script defines which agents start, what each one does, what runs in parallel and what waits for someone else’s result.
Anthropic introduced the feature on June 2, 2026 in the post A harness for every task: dynamic workflows in Claude Code. The same post warns that workflows aren’t needed for every task and can use significantly more tokens.
How do you trigger dynamic workflows?
There are two ways to try dynamic workflows in Claude Code:
- start from a normal request and add the keyword
ultracode; - write
use a dynamic workflowin the prompt.
Either way, Claude generates the script that organizes the work across multiple agents.
What is graph engineering?
Graph engineering is a term that’s starting to circulate for designing the agent team: who does what, in which order and what information one agent hands to the others. The agents are the nodes, the hand-offs are the edges.
There are four main architectures:
- Chain: one agent passes its result to the next.
- Fan-out: several agents work in parallel on independent parts.
- Verification: one agent produces, another one checks.
- Loop: you check the result and, if needed, repeat.
The real value of graph engineering lies in what the agents pass to each other. A poor hand-off makes even the biggest team useless.
When does it make sense to use multiple AI agents?
Picture two holes to dig. One is 10 meters long: you can put 10 people at different spots and have them work in parallel. The other is 10 meters deep but only 1 meter wide: every shovelful depends on the one before, and ten people just get in each other’s way.
AI agents work the same way. If you need to analyze 100 independent files, splitting the work across several agents makes sense. If every decision depends on the previous one, adding agents only creates pointless coordination.
Dynamic workflows make sense mainly in three cases:
- lots of independent work to split up;
- one agent checking another agent’s work;
- a task too big for a single agent to handle well.
That’s why, when someone tells you they run 50 or 100 agents at the same time, they’re often just trying to sell you something. Launching 100 agents looks impressive, but the number of agents alone says nothing about the quality of the result.
How do I tell whether I need a multi-agent workflow?
I use a very simple rule. I run the task three times with a single agent. If at least two out of three results are already good, I don’t need more agents.
The rule works because it measures the real problem. If a single agent fails often, a team with a verifier or a loop can raise the quality. If a single agent already gets it right, the workflow only adds tokens and time.
This is the same approach you see in companies that have several agents working on the same code, as I describe in the article on how Spotify runs 5-10 AI agents in parallel: parallelism goes where the tasks are truly separate.
Why should only one agent write?
There’s one rule I apply to every workflow: 10 agents can read, only one should write.
Reading is safe to parallelize: ten agents analyzing different files don’t step on each other’s toes. Writing isn’t: two agents editing the same files produce conflicts and inconsistent decisions. The reading agents gather and hand over information, the writing agent puts it together.
Where to start
To get started, you only need three things:
- the
ultracodekeyword; - alternatively, the prompt
use a dynamic workflow; - one question to always ask yourself: am I digging a long hole or a deep hole?
If the hole is long, pick a job with many independent parts, decide what each agent should hand to the others, and leave the writing to a single agent. Now is the right time to learn when a team of agents really saves you work.
Sources
- A harness for every task: dynamic workflows in Claude Code — Anthropic post from June 2, 2026 (Thariq Shihipar and Sid Bidasaria): dynamic workflows start by asking for a workflow or with the ’ultracode’ trigger word; Claude writes a script that orchestrates the agents; patterns include fan-out-and-synthesize, adversarial verification and loops; they aren’t needed for every task and can use significantly more tokens.
Want to know what this means for your product?
If you're building software with AI and want a second opinion on how you're working, tell me about your project.
Tell me about your project