AI & ML // // 4 min read

Claude Code’s Dynamic Workflows: Subagent Orchestration at Scale

I spent the morning digging into Claude Code's new dynamic workflows, and they're the most interesting orchestration feature Anthropic has shipped since subagents themselves. The pitch is simple: instead of Claude deciding turn-by-turn what to spawn next, you let Claude

Bala Kumar Senior Software Engineer

I spent the morning digging into Claude Code's new dynamic workflows, and they're the most interesting orchestration feature Anthropic has shipped since subagents themselves. The pitch is simple: instead of Claude deciding turn-by-turn what to spawn next, you let Claude write a JavaScript script that orchestrates dozens of subagents in the background while your session stays responsive.

Why workflows beat manual subagent delegation

I've used subagents in Claude Code for months, but the model has a ceiling. Claude is the orchestrator — it decides what to spawn next, and every intermediate result lands in its context window. That works for a few parallel tasks, but falls apart at scale. A 500-file migration or a codebase-wide audit isn't a conversation; it's a program.

Dynamic workflows move the plan into code. The script holds the loop, the branching, and the intermediate results. Claude's context window only sees the final answer. More importantly, the orchestration itself becomes repeatable — you can save the script and rerun it, version it, or hand it to a teammate.

Here's how the three modes compare:

FeatureSubagentsSkillsWorkflows
What it isA worker Claude spawnsInstructions Claude followsA script the runtime executes
Who decides what runs nextClaude, turn by turnClaude, following the promptThe script
Where intermediate results liveClaude's context windowClaude's context windowScript variables
What's repeatableThe worker definitionThe instructionsThe orchestration itself
ScaleA few delegated tasks per turnSame as subagentsDozens to hundreds of agents per run
InterruptionRestarts the turnRestarts the turnResumable in the same session

The built-in workflow you can try today

The fastest way to see this in action is /deep-research, the bundled workflow that fans out web searches across several angles, fetches sources, cross-checks them, and synthesizes a cited report. Run /workflows to watch progress — you see each phase with agent counts, token totals, and elapsed time. The session stays free while the agents work.

Two ways to trigger a workflow

Ask for it explicitly. Include the word "workflow" anywhere in your prompt:

Run a workflow to audit every API endpoint under src/routes/ for missing auth checks

Claude Code highlights the word and writes the script instead of working turn-by-turn. If the run works, save it as a command with s in the /workflows view.

Let Claude decide with ultracode. Set /effort ultracode and Claude plans workflows automatically for every substantive task. A single request can chain several workflows: one to understand the code, one to make the change, one to verify it. It burns more tokens and takes longer, but the quality is noticeably higher for complex tasks. I drop back to /effort high for routine work.

How a workflow runs under the hood

The script is JavaScript. Claude writes it for the task you describe, and a runtime executes it in the background. Each run gets its own state, and you can pause and resume. The current limits are reasonable for real work:

LimitValue
Max agents per run100
Max tool calls per agent25
Max run duration50 minutes

Cost is tracked per run and visible in the progress view. You can stop individual agents, restart them, or pause the entire workflow.

What I'm using this for

My immediate use case is a codebase audit I run monthly: check for deprecated patterns, missing tests, and stale dependencies. Before workflows, I broke this into chunks and fed them to Claude one by one. Now I describe the audit, Claude writes a script that spawns agents for each module, and I get a consolidated report with every claim cross-checked. The orchestration is in the script, not in my prompts.

The feature is in research preview and requires Claude Code v2.1.154 or later. It's available on all paid plans, plus Anthropic API access, Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry. On Pro, turn it on in /config under the Dynamic workflows row.

Source: Claude Code Docs — Dynamic Workflows