Ai Agents 3 min read

How to Orchestrate Parallel Subagents in Claude Code

Learn how to use dynamic workflows in Claude Code to manage up to 1,000 parallel subagents, handle resumable state, and optimize your Opus 4.8 API costs.

Anthropic’s addition of dynamic workflows to Claude Code allows you to orchestrate up to 1,000 subagents for large-scale engineering tasks. Released in Claude Code v2.1.154 alongside the Claude Opus 4.8 model, this architecture replaces standard conversational turns with generated JavaScript orchestration scripts. This approach isolates intermediate steps into script variables rather than flooding your primary context window.

Enabling Dynamic Workflows

Dynamic workflows are available as a research preview in Claude Code v2.1.154 across the CLI, Desktop app, and VS Code extension. The feature is enabled by default for Max and Team plan users. Enterprise administrators must manually enable it at the organization level.

If you are on a Pro plan, you need to explicitly activate the feature via the configuration menu. Run /config in your terminal or command palette, navigate to the features section, and toggle dynamic workflows to active.

Triggering Parallel Execution

When you initiate a workflow, Claude Code generates a script specifically for your task. A separate background runtime executes this script, spinning up dozens of parallel subagents to distribute the workload. The runtime limits execution to 16 concurrent agents to prevent rate limiting.

You can trigger this behavior by explicitly using the keyword “workflow” in your prompt. For predefined tasks, Claude Code includes a built-in /deep-research command that automatically parallelizes web searches and cross-checks sources before delivering a cited report.

To give the model maximum autonomy for complex codebase migrations or security sweeps, use the effort command. Running /effort ultracode sets the effort level to xhigh. This allows Claude to automatically decide when a standard prompt should be promoted to a full dynamic workflow.

State Management and Verification

Standard agent runs often fail on massive codebases because a single error derails the entire context chain. Dynamic workflows solve this through aggressive checkpointing. Every workflow is automatically checkpointed and resumable.

If a network error interrupts an hour-long refactor, Claude Code resumes exactly where the last subagent left off. This durability makes the tool viable for migrating hundreds of thousands of lines of code without requiring constant supervision.

Before presenting the final output, workflows use adversarial verification. Independent agents automatically critique the generated results, looking for logic flaws or security vulnerabilities introduced by the primary subagents. The workflow only concludes when the adversarial check passes.

Opus 4.8 Performance and Costs

Dynamic workflows rely on Claude Opus 4.8, a hybrid reasoning model equipped with a 1-million-token context window. The model scored 84% on the Online-Mind2Web benchmark and introduces a “fast mode” that executes tasks 2.5× faster than the standard tier.

You should adjust your tier based on the urgency of the task to reduce LLM API costs.

Execution ModeInput Tokens (per 1M)Output Tokens (per 1M)
Standard$5.00$25.00
Fast Mode$10.00$50.00

Standard mode is ideal for background tasks like extensive bug hunting or repository-wide dependency updates. Reserve fast mode for interactive workflows where you are waiting on the result to continue your local development.

To test dynamic workflows on your own codebase, update your CLI to v2.1.154, run /effort ultracode, and prompt Claude to map out a structural migration across multiple directories.

Get Insanely Good at AI

Get Insanely Good at AI

The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.

Keep Reading