πŸ“ Tutorials
Β· 7 min read

Claude Code Dynamic Workflows: How to Run Hundreds of Parallel Agents (2026)


Dynamic workflows are a new Claude Code feature that launched alongside Claude Opus 4.8 on May 28, 2026. They let Claude plan a large task, break it into subtasks, and run tens to hundreds of parallel subagents β€” all in a single session. Results are verified before anything reaches you.

This is not the same as manually spawning subagents. Dynamic workflows are orchestrated automatically: Claude writes a coordination script, fans work out across agents, has them check each other’s results, and iterates until answers converge. Work that would take weeks of manual effort finishes in hours or days.

What dynamic workflows can do

Early users have applied dynamic workflows to:

  • Codebase-wide migrations β€” Framework swaps, API deprecations, language ports across thousands of files
  • Security audits β€” Parallel search across an entire service with independent verification on every finding
  • Bug hunts β€” Profiler-guided optimization audits across a full repo
  • Language ports β€” Jarred Sumner ported Bun from Zig to Rust (750,000 lines, 99.8% test pass rate, 11 days)
  • Critical verification β€” Independent attempts at a problem with adversarial agents trying to break the result

The key insight: some problems are too big for one pass by a single agent. Dynamic workflows solve this by parallelizing the work and adding verification layers.

How to enable dynamic workflows

Requirements

  • Claude Code CLI, Desktop, or VS Code extension
  • Max, Team, or Enterprise plan (Enterprise requires admin to enable)
  • Claude Opus 4.8 (recommended for best results)

For general Claude Code usage, see our how to use Claude Code guide and Claude Code cheat sheet.

Two ways to start

Option 1: Ask directly

> Create a workflow to migrate all React class components to functional components with hooks

Any prompt that includes β€œcreate a workflow” or describes a task large enough to benefit from parallelization will trigger the workflow system.

Option 2: Enable ultracode mode

In Claude Code, set effort to ultracode via the effort menu or:

/effort ultracode

This sets effort to xhigh and lets Claude decide automatically when a task warrants a workflow. Claude will ask for confirmation before launching.

For the best experience, turn on auto mode when using dynamic workflows:

/automode on

This allows the workflow to run without requiring approval for each individual subagent action.

How it works under the hood

When a workflow kicks off:

  1. Planning β€” Claude analyzes your prompt and breaks it into subtasks
  2. Script generation β€” Claude writes a JavaScript orchestration script with loops, branching logic, and intermediate variables
  3. Fan-out β€” Subagents are spawned in parallel, each handling a subset of the work
  4. Verification β€” Results are checked by independent agents before being folded in
  5. Convergence β€” Agents address the problem from independent angles, others try to refute findings, iteration continues until answers converge
  6. Report β€” A single coordinated answer is presented to you

Progress is saved as the run goes. If a job is interrupted, it picks up where it left off instead of starting over. The coordination happens outside the conversation, so the plan stays on track regardless of task size.

Real example: codebase migration

Here is what a dynamic workflow looks like for migrating a codebase from Express to Fastify:

> Create a workflow to migrate this Express.js app to Fastify. 
  Use the existing test suite as the quality bar.

Claude will:

  1. Analyze the codebase structure (routes, middleware, error handlers)
  2. Generate a migration plan with dependency ordering
  3. Spawn parallel agents β€” one per route file or module
  4. Each agent rewrites its assigned file and runs relevant tests
  5. A verification agent checks for cross-module compatibility
  6. A final agent runs the full test suite
  7. Report back with results and any remaining issues

For a 200-file Express app, this might spawn 30-50 parallel agents and complete in 20-40 minutes instead of days of manual work.

Use case: security audit

> Create a workflow to audit this codebase for security vulnerabilities.
  Check auth, input validation, SQL injection, XSS, and unsafe patterns.

The workflow:

  1. Spawns specialized agents for each vulnerability category
  2. Each agent searches the entire codebase in parallel
  3. Findings are independently verified by a separate agent
  4. False positives are filtered out
  5. Results are ranked by severity with fix suggestions

Use case: dead code detection

> Create a workflow to find all dead code in this repo.
  Check for unused functions, unreachable branches, and orphaned files.

This is a task where traditional static analysis tools miss things. Dynamic workflows can combine static analysis with semantic understanding β€” checking not just whether code is referenced, but whether it is actually reachable through the application’s logic.

Tips for best results

Scope your first workflow

Dynamic workflows consume substantially more tokens than a typical Claude Code session. Start with a scoped task to understand usage patterns before running a full codebase migration.

Provide a quality bar

The best workflows have a clear success criterion. β€œUse the existing test suite as the bar” or β€œall endpoints must return 200” gives Claude a way to verify its own work.

Use with existing test suites

Dynamic workflows shine when there is an automated way to verify results. If your project has a test suite, Claude will use it as the convergence criterion β€” iterating until tests pass.

Let it run

Workflows can take hours for large tasks. They are designed for asynchronous work. Start a workflow, go do something else, come back to results.

Check token usage

Monitor your usage after the first few workflows. A large migration might consume 10-50Γ— more tokens than a normal session. The cost is justified for tasks that would otherwise take weeks, but be aware of it.

Token usage and cost

Dynamic workflows are expensive relative to normal Claude Code sessions:

Task typeNormal sessionDynamic workflowMultiplier
Single file refactor~50K tokensN/A (overkill)β€”
10-file migration~200K tokens~500K tokens2.5Γ—
100-file migrationNot feasible~5M tokensβ€”
Full codebase auditNot feasible~10-20M tokensβ€”

At Opus 4.8 pricing ($5/$25 per million tokens), a full codebase audit might cost $50-150. A large migration might cost $100-500. Compare this to the developer time it replaces (days to weeks of manual work).

Limitations

  • Research preview β€” The feature is still being refined. Expect occasional failures on very complex orchestration
  • Token consumption β€” Significantly higher than normal sessions. Monitor usage.
  • Enterprise opt-in β€” Enterprise admins must explicitly enable the feature
  • Best with Opus 4.8 β€” Works with other models but Opus 4.8’s improved tool calling and honesty make workflows more reliable
  • Not for small tasks β€” Overkill for anything a single agent pass can handle. Use normal Claude Code for routine work.

For a full breakdown of Opus 4.8’s capabilities outside of dynamic workflows, see the Claude Opus 4.8 complete guide and Opus 4.8 vs GPT-5.5 for coding.

Dynamic workflows vs manual subagents

If you have been using Claude Code subagents manually, dynamic workflows are the automated version:

Manual subagentsDynamic workflows
PlanningYou plan the breakdownClaude plans automatically
OrchestrationYou manage coordinationClaude writes orchestration scripts
VerificationYou review resultsAgents verify each other
Scale3-5 parallel agents practicalHundreds of agents
ResumabilityManualAutomatic (picks up where it left off)
Best forKnown, structured tasksLarge, exploratory tasks

Use manual subagents when you know exactly what each agent should do. Use dynamic workflows when the task is too large or complex to plan manually.

Availability

  • Max plan: Enabled by default
  • Team plan: Enabled by default
  • Enterprise plan: Off by default, admin can enable in Claude Code settings
  • API: Available via Claude API, Amazon Bedrock, Vertex AI, Microsoft Foundry
  • Pro plan: Not available

FAQ

How do I know if my task needs a dynamic workflow?

If it touches more than 20 files, requires parallel investigation, or would take a single agent more than an hour, it is a good candidate. For smaller tasks, normal Claude Code is faster and cheaper.

Can I watch the workflow run?

Yes. Claude Code shows progress as subagents complete their work. You can see which subtasks are running, which have completed, and what the current status is.

What happens if a workflow fails midway?

Progress is saved. You can resume from where it stopped. The orchestration script tracks completed subtasks and skips them on restart.

Does it work with Sonnet or Haiku?

Technically yes, but results are significantly better with Opus 4.8. The improved tool calling and self-correction in 4.8 make workflows more reliable. Anthropic recommends Opus for dynamic workflows.

Can I customize the orchestration?

Not directly in the current research preview. Claude generates the orchestration script based on your prompt. You can influence it by being specific about your requirements, quality bars, and constraints.

How does this compare to Codex CLI’s parallel execution?

Codex CLI can run parallel tasks but does not have the same planning, verification, and convergence loop. Dynamic workflows are more autonomous β€” they plan, execute, verify, and iterate without human intervention.