Dynamic Workflows in Claude Code: How One Prompt Ran 160 Agents for 3 Hours
One prompt. Three hours and twelve minutes. 11.4 million tokens. 160 agents. With dynamic workflows and ultracode on Claude Opus 4.8, a single instruction can now orchestrate an entire research project on its own. Here is exactly what happened, how it works, and how to build the looping workflow yourself.


What are dynamic workflows in Claude Code?
Dynamic workflows are a Claude Code feature, shipped with Claude Opus 4.8, where Claude writes a JavaScript orchestration script from your request and runs it in the background [2] [3]. The script fans out dozens to hundreds of parallel subagents (capped at 1,000 per run, up to 16 at once) to decompose, execute, verify, and synthesise a large task [4]. Only the final result returns to your conversation, so the orchestration never clogs your context window. Paired with ultracode, Claude authors and runs these workflows automatically.
TL;DR
What happened
- •One prompt drove 155/160 agents, 3h 12m, 11.4M tokens
- •Output was a complete, standardised research wiki
- •The trick: methodology first, then a 10-pass loop
- •Each pass improved the method before researching
- •It ended with verification and standardisation
Why it matters
- •Ultracode = xhigh effort + permission to run workflows
- •Orchestration runs out of your context window
- •Boris Cherny: “I write loops that prompt Claude”
- •Loops + verification are the 2026 way to build
- •You can copy the exact pattern in minutes
01.The Run: 3 Hours, 160 Agents, One Prompt
Here is the screenshot that prompted this article. It is a single line from my terminal, taken near the end of a run I kicked off with one instruction and then walked away from. Read it slowly, because every number on it would have been science fiction a year ago.

155 of 160 agents done. Three hours and twelve minutes. 11.4 million tokens consumed. I did not babysit it. I did not feed it follow-up prompts. I wrote one carefully designed instruction, turned on ultracode, and let Claude orchestrate a small army of itself while I got on with other work. What came back was not a half-finished draft. It was a complete, internally consistent research wiki, every document in the same format, every claim checked.
So here is the honest question this raises, and the one most teams have not sat with yet: would you let your Claude session run for three hours on a single prompt? A year ago that sentence sounded reckless. In 2026, with the right harness around the model, it is simply how serious work gets done. This article explains the three ideas that make it possible — dynamic workflows, ultracode, and loops — then walks through the exact research run above so you can rebuild it yourself.
A single prompt fanned out into 160 subagents working across parallel and sequential phases.
Hours of autonomous work with no human in the loop after the initial instruction.
The equivalent of reading and writing a small library, compressed into one afternoon.
02.What Dynamic Workflows Actually Are
Dynamic workflows arrived alongside Claude Opus 4.8 on 28 May 2026 [1]. The idea is deceptively simple. Instead of Claude deciding what to do turn by turn inside your chat, it writes a small JavaScript orchestration script from your request and runs it in the background [2]. The plan moves out of the conversation and into code. Your session stays responsive, and only the final synthesised result lands back in your context window.
That last detail is the unlock. The reason you could never run hundreds of agents from a normal chat is that every intermediate result used to pile into the same context window until it overflowed. A workflow keeps all of that chatter in script variables, out of sight. The orchestrator only hands you the conclusion [3].
The building blocks
Every workflow script begins with a meta block and then uses a handful of primitives. agent() spawns one subagent. parallel() runs a batch and waits for all of them (a barrier). pipeline() streams items through stages without waiting, so item two can start while item one is still finishing. phase() and log() drive the progress display. Here is the shape of a real one:
export const meta = {
name: 'audit-and-verify',
description: 'Review every changed file, then verify each finding',
phases: [{ title: 'Review' }, { title: 'Verify' }],
}
// Each dimension is reviewed, then its findings are
// adversarially verified the moment that review finishes.
const results = await pipeline(
DIMENSIONS,
d => agent(d.prompt, { phase: 'Review', schema: FINDINGS }),
review => parallel(review.findings.map(f => () =>
agent(`Try to refute: ${f.title}`, { phase: 'Verify', schema: VERDICT })
))
)
return results.flat().filter(f => f.verdict?.isReal)Pass a JSON schema to agent() and the subagent is forced to return clean, validated data rather than prose you have to parse. That is what lets a workflow treat its own agents as reliable functions.
The hard limits worth knowing
- •Up to 16 agents run concurrently (fewer on machines with limited cores); the rest queue and run as slots free up [3].
- •1,000 agents total per run — a runaway backstop set far above any sane workflow [4].
- •Workflows run in the background and can be resumed, replaying completed agents from cache.
- •Agents that must edit files in parallel can use git worktree isolation to avoid clobbering each other.
| Ad-hoc subagent | Dynamic workflow | |
|---|---|---|
| Where the plan lives | Claude decides turn by turn | Codified in JavaScript |
| Intermediate results | Fill your context window | Stay in script variables |
| Scale | A few per turn | Dozens to hundreds per run |
| Best for | One-off delegation | Repeatable, multi-phase work |
03.Ultracode: xhigh Effort Plus Permission
If dynamic workflows are the engine, ultracode is the ignition. In Claude Code, dynamic workflows surface as a mode called ultracode in the effort menu [6]. It is not a brand-new reasoning level. Ultracode is xhigh reasoning effort paired with standing permission to launch multi-agent workflows — Claude Code's shorthand for “think as hard as you can, and orchestrate freely”.
The capability that makes this possible is one of Opus 4.8's quieter additions: mid-conversation system messages. Before 4.8, a system prompt sat at the very start of a conversation and stayed fixed. Now an instruction can be injected partway through the message history, which is exactly how an orchestrator is granted permission to spin up workflows after a session has already started [6].
You turn it on in seconds:
/effort ultracode # set ultracode for this session
# or open /config and toggle Dynamic Workflows to Ultracode
# or simply include the word "ultracode" in your promptWith ultracode standing on, Claude stops waiting for you to say “use a workflow”. It decides, for each substantial task, whether to author and run one. A single request to audit a codebase might quietly become three workflows in sequence: one to understand the code, one to make changes, and one to verify them. The default posture flips from do the task to orchestrate the task, and token cost stops being treated as a constraint [5].
⚠️ Use it deliberately
Ultracode is the right tool for big, branching, high-value work — audits, migrations, deep research, broad reviews. It is the wrong tool for a one-line fix. Because it fans out aggressively, an ultracode session can spend in minutes what a normal chat spends in a day. Turn it on when the task genuinely warrants a swarm, and lean on a token budget when you want a hard ceiling.
04.Why Loops Are the Whole Game in 2026
Ask around the Claude Code community right now and one word keeps coming up: loops. It is the technique most people have heard of and the one most people cannot actually do. So let us fix that, starting with the person who designed the tool.
“I don't prompt Claude anymore. I write loops that prompt Claude.”
Cherny describes his own evolution in three stages [9]. A year ago he wrote code by hand with autocomplete. Then he ran five to ten Claude sessions in parallel and prompted each one manually. Now he does not prompt at all: he writes the loops that prompt Claude, and a couple of hundred agents read his GitHub, Slack, and other inputs and decide what to build next. The job moved up an altitude — from writing the code, to writing the thing that writes the code.
The practical difference is compounding. A prompt gets you one output. A loop gets you a repeating operation that improves on its last result. But a loop is only as good as its stopping condition, which is why Cherny's other piece of advice is the one that actually matters:
“The most important thing to get great results out of Claude Code — give Claude a way to verify its work. If Claude has that feedback loop, it will 2–3x the quality of the final result.”
The three ways to loop, from simplest to most powerful
1. The /loop command
Run a prompt on a schedule. Give it an interval (/loop 5m check the deploy) and it runs on a timer; omit the interval and Claude paces itself, choosing how long to wait between iterations based on what it observes [7]. This is the loop for polling and watching.
2. The Ralph Wiggum technique
A while loop that re-injects the same prompt until the work genuinely verifies, popularised by Geoffrey Huntley and now wrapped in an official plugin [11]. The agent must keep going until it can honestly report the job is done. We covered it in depth in our Ralph Wiggum plugin guide.
3. The loop inside a workflow
The most powerful option, and the one behind the run in this article. Because a workflow is just JavaScript, you write the loop directly: a for loop over a fixed number of passes, a loop-until-dry loop that stops when nothing new turns up, or a loop-until-budget loop that stops at a token ceiling. Each pass can read and improve on the last.
Every one of these comes down to the same rhythm: act, then check [12]. What changed in 2026 is that a single loop can now fan out across hundreds of agents and still verify its own work. The run at the top of this article is that idea taken to its logical conclusion — so let us pull it apart and rebuild it.
05.Case Study: A Research Wiki From One Prompt
Now the run itself. My goal was a deep, well-organised research wiki on a single topic — the kind of thing that would normally take a person several focused days of reading, note-taking, and tidying. I did not want to write the wiki, and I did not even want to write the research plan. I wanted Claude to do both, and to get better at the job as it went.
The prompt was built around a single insight: do not ask for the answer, ask for the methodology first. Here is the actual instruction I gave, more or less word for word.
“Research [my topic] for me. But before you do any research, first work out the methodology: how you will research it, and how the wiki should be structured. Write that down. Then, using ultracode, build a dynamic workflow that loops the whole thing over 10 passes. At the start of every pass, re-read and improve the methodology based on what the last pass learned, then run the research in parallel. After the 10 passes, finish with a verification loop that fact-checks every claim, then a standardisation pass so every document follows one consistent format. Finally, build the whole thing into a single HTML wiki I can open in my browser.”
That one paragraph is the entire run. The shape it describes is a loop with a sharpening step at the front and two cleanup steps at the back — like this:
Because ultracode is on, you never write the JavaScript — Claude turns that prompt into the workflow. For the curious, the heart of the generated script looks like this:
export const meta = {
name: 'research-wiki',
description: 'Self-improving, multi-pass research wiki from one prompt',
phases: [{ title: 'Methodology' }, { title: 'Research' },
{ title: 'Verify' }, { title: 'Standardise' }],
}
let methodology = await agent(
'Design the methodology for researching this topic and the ' +
'structure of the wiki. Do not research yet.',
{ phase: 'Methodology', schema: METHODOLOGY }
)
// 10 passes. Each pass sharpens the method, then researches.
for (let pass = 1; pass <= 10; pass++) {
methodology = await agent(
`Pass ${pass}: review the methodology and the wiki so far. ` +
`Improve the method and list the gaps still to fill.`,
{ phase: 'Methodology', schema: METHODOLOGY }
)
await parallel(methodology.gaps.map(topic => () =>
agent(`Research "${topic}" and write it into the wiki.`,
{ phase: 'Research', schema: WIKI_DOC })
))
log(`Pass ${pass} complete — ${methodology.gaps.length} topics filled`)
}
// Verification loop: adversarially check every claim.
const docs = await readWiki()
const verified = await parallel(docs.map(d => () =>
agent(`Fact-check this document. Flag unsupported claims.`,
{ phase: 'Verify', schema: VERDICT })
))
// Standardise every surviving document to one house format.
await parallel(verified.filter(v => v.isSound).map(v => () =>
agent(`Rewrite to the standard wiki template.`,
{ phase: 'Standardise', schema: WIKI_DOC })
))That is the whole trick. The loop is ten passes. The intelligence is in step three: by forcing the model to improve its own methodology before each round of research, the wiki gets deeper and better organised with every pass instead of just longer. The final two phases — verify, then standardise — are what turn a sprawling pile of notes into something you would actually trust and publish.
When I hit enter, all of that became the screenshot at the top of this article: 160 agents, three hours, 11.4 million tokens, and a finished wiki waiting for me.
Nothing here is specific to research, either. Swap the topic for “audit this codebase”, “map this market”, or “draft this content series” and the same shape holds — design the method first, loop it, then verify. If you want the productised version of this idea, it is essentially what our LLM wiki build and autonomous development guide have been circling all year — dynamic workflows just made it a single prompt.
06.Should You Let Claude Run for 3 Hours?
Let us address the discomfort head-on. Eleven million tokens is a real bill, and three unattended hours feels like a lot of rope to give an autonomous system. Both reactions are healthy. The answer is not to avoid long runs; it is to know when they pay for themselves.
✓ Worth the swarm
- • Deep research that would take a person days
- • Codebase-wide audits and large migrations
- • Broad reviews where coverage matters more than speed
- • Anything you can define a clear verification test for
✗ Not worth it
- • One-line fixes and quick edits
- • Tasks with no objective way to check the result
- • Exploratory questions you have not scoped yet
- • Anything where you cannot afford to be wrong unattended
The framing that helps: do not compare the token bill to a chat message; compare it to the human hours it removes. A three-hour run that replaces three days of skilled research is a bargain even at 11 million tokens. Opus 4.8 also shipped a cheaper fast mode, which lowers the cost of long sessions considerably [1], and workflows accept a token budget so you can cap a run at a hard ceiling before you start.
And the three unattended hours? They are only safe because of the verification phase. A loop with no way to check itself should not run for three minutes, let alone three hours. A loop that adversarially verifies its own output can run all night — which is exactly the bet the whole 2026 agentic-engineering movement is making.
07.What This Means for Echofold Users
The same Opus 4.8 is available to everyone, so the advantage goes to whoever designs the better loop around it. It is a good example of something we write about a lot: the harness tends to matter more than the model.
If you want to get hands-on with it, Production Vibe Coding covers the workflow for shipping production-grade software with Claude Code — hooks, MCP servers, verification gates, and the autonomous patterns this article describes. And if you want to learn this alongside other builders, our Dublin and Belfast meetups are where these techniques get shared first.
Key takeaways
- •Dynamic workflows let one prompt orchestrate hundreds of agents in the background, off your context window.
- •Turn on ultracode with
/effort ultracodeand Claude writes and runs the workflow for you. - •Ask for the methodology first, loop it over a set number of passes, and improve the method on each one.
- •Always end with verification — that feedback loop is what makes a long, unattended run worth trusting.
The model is the same for everyone. The real advantage is the loop you build around it — and that is a skill anyone on your team can pick up.
08.Frequently Asked Questions
What are dynamic workflows in Claude Code?
Dynamic workflows are a feature in Claude Code, introduced with Claude Opus 4.8, where Claude writes a JavaScript orchestration script from your request and runs it in the background. The script fans out dozens to hundreds of parallel subagents (capped at 1,000 per run, with up to 16 running concurrently) to decompose, execute, verify, and synthesise a large task. Only the final result returns to the conversation, so the orchestration does not consume your context window.
What is ultracode in Claude Code?
Ultracode is Claude Code's name for xhigh reasoning effort paired with standing permission to launch multi-agent dynamic workflows. It is not a new API effort level; it is powered by xhigh effort plus mid-conversation system messages, a new Opus 4.8 capability that injects permissions partway through a session. You enable it with /effort ultracode, the /config menu, or by including the keyword ultracode in a prompt. With ultracode on, Claude authors and runs workflows by default rather than waiting for you to ask.
Is it normal for Claude to run for 3 hours on one prompt?
With dynamic workflows it is now expected for substantial tasks. A single prompt can drive a workflow that runs for hours and spends millions of tokens, because the orchestrator spawns many subagents that each do their own work in parallel and across sequential phases. In the run described in this article, one prompt produced 155 of 160 agents completing over 3 hours 12 minutes and 11.4 million tokens. The key is giving the work a clear stopping condition and a way to verify itself.
How do I create a loop with Claude Code?
There are three common ways. The /loop command runs a prompt on a fixed interval or self-paced schedule. The Ralph Wiggum technique re-injects the same prompt until the work verifies. Inside a dynamic workflow you write the loop directly in JavaScript — for example a for-loop over a fixed number of passes, a while-loop that runs until findings stop changing (loop-until-dry), or one that stops at a token budget (loop-until-budget). For multi-pass research, the workflow loop is the most powerful because each pass can improve on the last.
What did Boris Cherny say about loops?
Boris Cherny, the creator of Claude Code, has said he no longer prompts Claude directly: he writes loops that prompt Claude. His workflow evolved from hand-coding, to running several parallel sessions he prompted manually, to writing loops where a couple of hundred agents read his GitHub, Slack, and other inputs and decide what to build next. He has also repeatedly stressed that the single most important thing for great results is giving Claude a way to verify its own work, which can double or triple the quality of the output.
How much does a long-running dynamic workflow cost?
Cost scales with token usage. A run that fans out 160 agents and spends 11.4 million tokens is far more expensive than a single chat turn, but it replaces what might be days of manual research or engineering. Workflows can take a token budget so they stop at a hard ceiling, and the cheaper fast mode on Opus 4.8 reduces the cost of long sessions. The economic question is not the token bill in isolation; it is the token bill compared with the human hours it removes.
Do dynamic workflows replace subagents and the Task tool?
No, they complement them. Spawning a subagent ad hoc is best for one-off delegation where you want the result back in the conversation. A dynamic workflow is best when the orchestration plan itself is worth codifying: repeatable multi-phase work, fan-out across many items, and pipelines that verify their own output. The workflow keeps intermediate results out of your context window and runs in the background, which is what makes hundreds of agents and hours of work practical.

Want to build loops like this?
Production Vibe Coding teaches the exact workflow to ship production-grade software with Claude Code: hooks, CLAUDE.md, MCP servers, verification gates, Chrome DevTools checks, and AWS deployment. Go from typing prompts to designing self-verifying, autonomous loops. No prior coding experience required.
Get the next deep-dive in your inbox
Long-form, hands-on guides on dynamic workflows, agent orchestration, and shipping production AI. No spam. Unsubscribe anytime.
09.References
All references13 sources cited in this articleExpand
[1]Anthropic. "Introducing Claude Opus 4.8." May 28, 2026.
[2]Anthropic. "Introducing dynamic workflows in Claude Code."
[3]Claude Code Documentation. "Orchestrate subagents at scale with dynamic workflows."
[5]Apidog. "Claude Code Dynamic Workflows: Running Hundreds of Parallel Subagents with Opus 4.8."
[6]MindStudio. "What Is Claude Opus 4.8 Ultra Code Mode? Dynamic Workflows vs /goal Explained."
[7]Claude Code Documentation. "Run prompts on a schedule."
[8]Cherny, Boris (@bcherny). "Give Claude a way to verify its work." January 3, 2026.
[11]ClaudeFast. "Claude Code Ralph Wiggum: Run Autonomously Overnight."
[12]Anthropic. "Building effective agents." December 19, 2024.
[13]WorkOS. "Key takeaways from Boris Cherny on building Claude Code."