Claude Code Dynamic Workflows: One Prompt, Dozens of Agents
Trigger a Claude Code dynamic workflow with one sentence. Dozens of agents tackle the task in parallel — you get one cited, verified answer when they're done.
Evgenii Arsentev · PhDReviewed for accuracy by Evgenii Arsentev, PhD · 2026-10-07
There are tasks too big for one Claude conversation to handle: audit every API endpoint in a 500-file codebase, cross-check research across 20 sources, migrate a database schema while verifying each table. Dynamic workflows are the answer. Claude writes a short orchestration script, and the system runs dozens of specialized agents in the background — each tackling one slice of the job — while your session stays open and responsive. You get one clean result at the end, not a turn-by-turn transcript of an exhausted AI.
I use dynamic workflows maybe twice a week now, usually for research and code audits. The first time I ran /deep-research on a topic I'd been meaning to investigate for months, I got a cited, source-checked report in about eight minutes. That eight minutes used to take me an afternoon. This guide explains how it works, how to trigger it, and when it's worth the extra tokens.
What is a dynamic workflow in Claude Code?
A dynamic workflow is a JavaScript orchestration script that Claude writes on the fly and the Claude Code runtime executes in the background. The script fans agents out across the problem — one agent per file, one per search angle, one per review dimension — collects their results, and synthesizes a final answer. You don't read or write the script; Claude authors it for your task, you approve it, and it runs. This is fundamentally different from regular subagents, which Claude coordinates turn by turn inside a single context window. Workflows move the coordination into code, so the task can scale to dozens or hundreds of agents without you watching each step.
Dynamic workflows require Claude Code v2.1.154 or later and are available on all paid plans — including Pro. On Pro, turn them on from the Dynamic workflows row in /config if they're not already active.
How do you trigger a dynamic workflow?
Three ways, from simplest to most powerful. First: describe the task in your own words and ask for a workflow explicitly — 'use a workflow' or 'create a workflow that does X'. Second: include the keyword ultracode anywhere in your prompt — Claude Code highlights it in violet and automatically writes a workflow for the task instead of tackling it step by step. Third: type /effort ultracode to have Claude plan a workflow for every substantive task in the session.
> use a workflow to audit every component in src/ for missing error boundaries > ultracode: cross-check these three research articles and summarize where they agree and disagree > create a workflow that finds all TODO comments and groups them by urgency
Before Week 23 (June 2026), the literal trigger keyword was 'workflow'. It changed to 'ultracode', which is highlighted in violet in the prompt. Natural-language requests like 'use a workflow' or 'run a workflow' work in all versions — you never have to remember the exact keyword.
What happens while agents are working?
After you approve the run, it starts in the background — your session stays responsive. Track it with /workflows, which lists every running and completed workflow. Select a run and press Enter to open the progress view: it shows each phase with its agent count, token total, and elapsed time. Drill into any phase to see individual agents and read their prompts and results. From the progress view you can also pause the run (p), stop a specific agent (x), restart a stalled one (r), or save the workflow as a reusable command for next time (s).
You can pause and resume a workflow mid-run. Open /workflows, select the running workflow, and press 'p' to pause; press 'p' again to resume. Completed agents return their cached results instantly on resume; only unfinished agents run again. If a workflow projects over 25 agents or 1.5 million tokens, Claude Code shows a large-workflow warning before it starts — a useful moment to test on a smaller slice first.
/deep-research: the built-in workflow everyone should try
/deep-research is the bundled workflow that ships with Claude Code. It fans out web searches from multiple angles simultaneously, fetches and reads the source articles, then has agents vote on each claim — claims that don't survive cross-checking are filtered from the final report. For non-programmers, it's the fastest way to get a cited, adversarially verified answer to any research question.
Run your first workflow in three steps
- 1Type /deep-research followed by your question: '/deep-research What changed about AI safety regulations in the EU in 2025–2026?'
- 2When Claude Code asks whether to run it, select Yes. In auto mode, it asks only the first time.
- 3Type /workflows and select the run to watch progress while agents search, fetch, and cross-check sources. The cited report lands in your session when it's done.
Controlling workflow scale: size guidelines
By default, Claude Code targets 'medium' scale — under 10 agents per workflow. If you're on a Pro plan, the default is now 'small' instead — under 5 agents — out of the box. Change this with the workflowSizeGuideline setting in /config or settings.json: 'small' (under 5 agents), 'large' (under 50), or 'unrestricted'. This is a guideline that shapes Claude's script, not a hard cap. Start with 'small' or 'medium' on a new codebase; move to 'large' once you've seen the workflow run cleanly. You can disable workflows entirely with 'disableWorkflows: true' in settings.
When to use a workflow — and when not to
Use a workflow when the task is larger than one conversation can coordinate, or when a consistent quality pattern matters across many items. 'Audit all 200 components' is a workflow task. 'Fix this one bug' is not — spawning a workflow for a five-minute job is like hiring a team for a grocery run. The honest cost note: each agent runs its own context window, so a big workflow uses significantly more tokens than a single response. A large research run or codebase audit might cost 10–30× what a regular answer does. Worth it for the right job; overkill for everything else.
Each agent in a workflow has its own context window and token cost. A big run — 20–50 agents, each reading several files — can use more tokens than a full day of normal Claude Code usage. If you're on a credit budget, open /workflows and press p to pause, or x to stop the run. You can also save the script and re-run only the phases you need.
Tonight's experiment: find a question you've been meaning to research for months but never had the time. Run /deep-research on it — approve the workflow, watch the /workflows view for a few minutes, and read the report when it lands. The workflow handles the breadth; you handle the judgment call at the end. That division of labor is exactly what this feature was built for.
Free course
Stop reading about AI — start building with it
The free Claude Code course: your first site, tool or game — no coding. No upsells, no cross-sells — nothing to buy here.
Start free →
Author
Evgenii Arsentev
PhD · Chief Executive Officer, digital health
Reading is a good start
Want to actually build this?
Guides explain. The free course transforms — personalized, gamified, and built to get you shipping fast.
Start the free course →