Claude Code Dynamic Workflows Explained: 1,000 Subagents, Ultracode, and /goal
Claude Code dynamic workflows fan one task across up to 1,000 subagents using a script that keeps results out of your context window.
Hören Sie auf zu konfigurieren. Fangen Sie an zu bauen.
SaaS-Builder-Vorlagen mit KI-Orchestrierung.
Claude Code dynamic workflows are JavaScript orchestration scripts that Claude writes on demand to fan one task across up to 1,000 subagents, with 16 running at the same time. The key shift in Claude Opus 4.8 is not that Claude can spawn more helpers. It is that the plan now lives in a saved script instead of your chat, so intermediate results stay in script variables and never flood your context window. That is what makes a 1,000-agent run possible without the conversation grinding to a halt.
Hören Sie auf zu konfigurieren. Fangen Sie an zu bauen.
SaaS-Builder-Vorlagen mit KI-Orchestrierung.
Why this matters to you
If you have ever asked Claude Code to refactor a whole repository and watched it run out of room halfway through, dynamic workflows are the fix. Big jobs like migrating a codebase, auditing every file, or cross-checking research across hundreds of sources used to be impossible in one go. Now Claude breaks the job into a script, runs many small agents in parallel, and hands you only the final answer.
How dynamic workflows actually work
A "context window" is the amount of text Claude can hold in mind at once. Every file it reads and every reply it writes eats into that budget. Older approaches like Claude Code subagents and agent teams still passed results back through the conversation, so a huge job filled the window fast.
A dynamic workflow works differently. Claude writes a small JavaScript program and saves it under ~/.claude/projects/ for that session. The program calls subagents, collects what each one returns into normal script variables (think of them as labeled boxes that hold data), and only the final result comes back to your chat. The 999 in-progress answers stay inside the script, out of sight. That single design choice is the whole point.
The three tools people keep confusing
Most coverage blurs three separate features. Here is the clean split.
/goalis persistence. One agent loops, and after each turn a fast Haiku model checks whether your stated condition is met. It keeps going until the answer is yes. The condition can be up to 4,000 characters. Use it for "keep working until X is done".- Dynamic workflows are parallelism. Claude writes a script that runs many subagents at once: 16 concurrent, 1,000 total. Use it for "do all of these things at the same time".
- Ultracode is a session setting. Turn it on with
/effort ultracodeand Claude decides on its own when a task deserves a workflow, while also using its deepest reasoning mode. It resets when you start a new session.
These three combine. You can run ultracode so Claude auto-triggers workflows, and inside a workflow a subagent can run its own /goal loop.
| Feature | What it is | Concurrency | Where the plan lives | When to use it | Min version |
|---|---|---|---|---|---|
/goal | A persistence loop | 1 agent, repeats | The loop, checked by Haiku | Keep going until a condition is met | v2.1.154 |
| Dynamic workflow | Parallel fan-out via script | 16 at once, 1,000 total | A saved JavaScript file | Run many subtasks simultaneously | v2.1.154 |
| Ultracode | A session effort setting | Auto-decides | Session config | Let Claude pick when to fan out | v2.1.154 |
| Subagent (single) | One delegated helper | 1 | The conversation | A single focused side task | Earlier versions |
| Agent team | A fixed group of roles | A few, defined | The conversation | Known roles like plan plus build plus test | Earlier versions |
The Bun case study: proof the cap is real
The clearest evidence that 1,000 agents is a working number, not a marketing line, comes from Bun. Jarred Sumner's team reported using dynamic workflows to port Bun from the Zig language to Rust, generating roughly 750,000 lines of Rust with a two-reviewer-per-file model, hitting 99.8% test suite compatibility, and merging it in 11 days (reported by the Bun team). The real lesson is the review model. Two independent agents checked each file, so mistakes got caught at scale. Adversarial review across many agents, not raw output speed, is the part worth copying.
How to trigger a workflow
You need Claude Code v2.1.154 or later. Then any of these starts one:
- Put the word
ultracodein your prompt. - Ask in plain English, for example "use a workflow to do this".
- Set the session mode with
/effort ultracode.
If Claude offers a workflow and you would rather it not, press Option+W on macOS or Alt+W on Windows and Linux. That dismisses the suggestion for one prompt without turning the feature off.
Save a workflow and reuse it
This is the part almost everyone skips. A workflow does not have to be a one-time run. Save it to .claude/workflows/ to share it with your whole project (it lives next to your CLAUDE.md and other project config), or to ~/.claude/workflows/ to keep it personal. Once saved, it shows up as a custom slash command in autocomplete. A messy one-off becomes a clean, repeatable command you can run on every new feature.
Keep the bill under control
Subagents spawned by a workflow inherit your tool allowlist and run in acceptEdits mode, which means file edits are auto-approved. With 1,000 agents that can move fast, so a few habits matter:
- Route plain, structured subtasks to a Haiku-class model. Haiku is the cheapest, fastest tier.
- Reserve Opus 4.8 for the orchestration brain, not every leaf task.
- Watch the allowlist, since auto-approved edits touch real files.
For context on price, fast mode for Opus 4.8 is reported at $10 per million input tokens and $50 per million output tokens, about 3x cheaper than the previous fast mode. A "token" is roughly three-quarters of a word, so a million tokens is a lot of text but adds up over a thousand agents.
A reusable /goal condition template
/goal works best when the finish line is measurable. Use this shape:
- One end state: the single thing that must be true.
- A check method: how the Haiku evaluator can verify it.
- Constraints: what it must not do (files to avoid, styles to keep).
- An optional bound: a turn or time limit so it cannot loop forever.
Example: "Goal: all tests in /tests pass. Check: run npm test and confirm zero failures. Constraints: do not edit test files. Bound: stop after 20 turns." Reach for /goal when you need persistence and for a dynamic workflow when you need parallelism.
If you want a head start on the production pieces these agents build, like authentication, Stripe payments, and PostgreSQL with row-level security on every table, the $29 Code Kit is a build system for Claude Code that wires those in from day one.
FAQ
What is ultracode mode in Claude Code?
Ultracode is a session-level effort setting (/effort ultracode) that combines extended (xhigh) reasoning with automatic workflow orchestration. When it is active, Claude decides on its own when to fan a task out across subagents instead of handling it in one turn. It resets at the start of each new session.
How many subagents can Claude Code dynamic workflows spawn?
Claude Code dynamic workflows can spawn up to 1,000 subagents per run, with a hard cap of 16 running at the same time. The runtime enforces both limits to prevent runaway loops. These are not soft guidelines, and the runtime will not exceed them.
What is the difference between /goal and dynamic workflows in Claude Code?
/goal is persistence: one agent loops until a Haiku evaluator confirms a condition is met after each turn. Dynamic workflows are parallelism: Claude writes a JavaScript script that fans the task out across many subagents at once. Use /goal for "keep going until X is done" and dynamic workflows for "do all of these things simultaneously".
Do Claude Code dynamic workflows work on the Pro plan?
Yes, but they are not on by default for Pro users. Enable them in /config. Max and Team plans have them on by default, and Enterprise requires admin enablement. All paid plans can also reach workflows through the API, Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry.
Hören Sie auf zu konfigurieren. Fangen Sie an zu bauen.
SaaS-Builder-Vorlagen mit KI-Orchestrierung.
Best AI Model for Coding in 2026 (Tested & Ranked)
The best AI model for coding in 2026, ranked by use case and budget: Claude Opus 4.8 for hardest agentic work, GPT-5.5 for terminal agents, DeepSeek V4 for value, with cited benchmarks.
Claude Code Usage Limits in 2026: What $20, $100, and $200 Actually Get You
Claude Code usage limits explained: what Pro ($20), Max 5x ($100), and Max 20x ($200) really give you, plus the 2026 billing changes.