4  Introducing Dynamic Workflows in Claude Code

4.1 A New Class of Work

On May 28, 2026, Anthropic introduced dynamic workflows to Claude Code — a feature that lets Claude itself write the orchestration scripts that coordinate tens to hundreds of parallel subagents. The announcement was deceptively simple in framing, but it represented a structural change in what a single Claude Code session could accomplish.

Before dynamic workflows, a developer working with Claude Code operated in a fundamentally sequential loop: prompt, work, review, repeat. Subagents existed and could be spawned for isolated tasks, but the orchestration — deciding which subagents to run, in what order, and how to combine their outputs — was the human’s job. Dynamic workflows moved that orchestration into the model’s hands. Claude could now write a script that described a parallel computation over your entire codebase and then execute it.

The use cases were immediate and concrete: codebase-wide bug hunts, large-scale migrations, and critical work verification. Tasks that previously required a human to script a custom harness could now be expressed in natural language and executed by Claude.

4.2 What Dynamic Workflows Actually Do

A dynamic workflow is, at its core, an orchestration script that Claude writes and then runs. The script uses a set of special functions to spawn subagents, coordinate their execution, and synthesize their results. Each subagent runs in its own isolated context window, meaning it can do deep work without polluting the main session’s context.

The key properties are:

Property Description
Parallelism Tens to hundreds of subagents run concurrently
Isolation Each subagent has its own context window
Self-authored Claude writes the orchestration script itself
Persistent Progress saves automatically
Adversarial Verification agents try to break results before you see them
Note

The defining characteristic of a dynamic workflow is that Claude writes the harness. You describe the outcome in natural language; Claude decides how to decompose it, which subagents to spawn, and how to merge their work. This is a higher level of abstraction than writing a script yourself.

4.3 Two Ways to Start

Anthropic designed dynamic workflows to be accessible in two ways, depending on the user’s sophistication and intent.

4.3.1 Method 1: Ask Claude to Create a Workflow

The simplest way to invoke a dynamic workflow is conversationally. You describe what you want at a high level, and Claude decides whether a workflow is the right tool and, if so, writes and executes one.

> Find every place in this codebase where we handle user authentication,
  and check each one against the OWASP authentication checklist.
  Report any violations as a table.

Claude recognizes that this task — checking every auth handler against a checklist — is parallelizable across the codebase. It writes an orchestration script that spawns one subagent per auth handler (or per file), runs the checklist in each, and synthesizes a report.

4.3.2 Method 2: The “ultracode” Setting

For users who want dynamic workflows to be the default mode of operation, Claude Code introduced the ultracode setting. When enabled, ultracode sets the effort level to xhigh (the level introduced with Opus 4.7, sitting between high and max), which signals to Claude that it should invest maximum reasoning and tool use into every task.

# In your Claude Code settings
effort: ultracode

The effect of ultracode is that Claude becomes more aggressive about decomposing tasks into parallel workflows. Rather than sequentially working through a large task, it looks for opportunities to fan out — reading more files, running more tools, and spawning more subagents before checking in with you.

Tip

Use ultracode for tasks where thoroughness matters more than speed or cost — security audits, large migrations, and comprehensive verification. For routine work where you want quick turnarounds, the default effort is more cost-effective.

4.4 Primary Use Cases

The launch post highlighted three use cases that dynamic workflows were explicitly designed for.

4.4.1 Codebase-Wide Bug Hunts

A codebase-wide bug hunt asks Claude to scan the entire repository for a class of bug — null pointer dereferences, race conditions, SQL injection vectors, or anything else you can describe. The workflow fans out one subagent per file (or per logical unit), each running the same analysis, and synthesizes a prioritized list of findings.

The advantage over a traditional linter is that the subagents can understand the code, not just pattern-match it. A subagent can trace data flow across functions, reason about whether a null check exists three calls up the stack, and judge whether a given pattern is actually a bug in context.

4.4.2 Large Migrations

A large migration — porting between frameworks, upgrading a major version, or changing a pervasive pattern — is the canonical fan-out task. Dynamic workflows let Claude decompose the migration into independent units of work, assign each to a subagent, and merge the results with conflict resolution.

The key enabler is that each subagent sees the migration rules (what to change, what to preserve) plus the specific files it’s responsible for. The orchestrator handles dependency ordering and ensures that shared files aren’t modified by two subagents simultaneously.

4.4.3 Critical Work Verification

The third use case is verification of work that has already been done — by a human, by a previous agent run, or by another workflow. A dynamic workflow can spawn adversarial verification agents whose entire job is to try to break, refute, or find flaws in the work before it reaches the user.

This pattern is powerful because it creates a structured tension: the producing agent optimizes for completeness and correctness; the adversarial agent optimizes for finding gaps. The user sees the work only after the adversarial agent has signed off (or has flagged specific concerns).

4.5 How Progress and Persistence Work

One of the practical concerns with running hundreds of subagents is what happens if something goes wrong — a subagent hits an error, a rate limit, or produces garbage. Dynamic workflows address this with automatic progress saving.

As the orchestration script executes, it checkpoints state. If a subagent fails, the workflow can retry it, skip it, or report it — without losing the work already done by other subagents. This makes dynamic workflows robust to the kinds of transient failures that are inevitable at scale.

Note

Progress saving means you can start a large workflow, step away, and come back to a complete (or meaningfully partial) result. You do not need to babysit a dynamic workflow the way you might a single long-running agent session.

4.6 Adversarial Agents: Breaking Before You See

A distinctive feature of dynamic workflows is the use of adversarial agents in the verification phase. Before the synthesized result is presented to the user, one or more adversarial agents attempt to break it.

The adversarial agents operate by:

  1. Reading the proposed output (the bug list, the migration diff, the verification report).
  2. Actively trying to find problems — false positives, missed cases, logical errors, or edge cases that weren’t considered.
  3. Either confirming the result or flagging specific issues for the user to review.

This mirrors a well-established practice in security (red team / blue team) and in software engineering (author / reviewer). The difference is that the adversarial agent runs automatically, in its own context, without human effort.

4.7 Availability and Pricing

At launch, dynamic workflows were made generally available to Max, Team, and Enterprise plans. There was no separate pricing line item — workflows consumed the same tokens as any other Claude Code session, but because they spawn many subagents, the token consumption could be significantly higher than a single-agent session.

The ultracode setting, which drives more aggressive workflow use, was similarly available without additional configuration beyond setting the effort preference.

Plan Dynamic Workflows ultracode
Max ✅ GA
Team ✅ GA
Enterprise ✅ GA
Pro Limited Limited

4.8 Practical Considerations

4.8.1 Token Budgets

Because dynamic workflows can spawn many subagents, token consumption scales with the degree of parallelism. A workflow that spawns 100 subagents, each reading 50KB of code, will consume substantially more tokens than a single agent reading the same total code. The tradeoff is speed and thoroughness for cost.

Users are encouraged to set token budgets when running large workflows, especially in cost-sensitive environments. Claude Code can respect a budget and prioritize the most important subtasks if the budget is constrained.

4.8.2 When to Use Workflows vs. Single Agents

Dynamic workflows are not the right tool for every task. The guidance is:

  • Use a workflow when the task is parallelizable, large, and benefits from independent analysis (bug hunts, migrations, verification, research).
  • Use a single agent when the task is sequential, small, or requires tight back-and-forth iteration.

The overhead of writing and executing an orchestration script is worth it only when the parallelism pays for itself.

4.8.3 Combining with Other Features

Dynamic workflows compose well with other Claude Code features. Notably, they can be combined with /goal (goal-based loops with exit criteria) and /loop (time-based loops for recurring work). A workflow can be the body of a loop — executed repeatedly until a goal is met or on a schedule.

4.9 How Dynamic Workflows Differ from Existing Patterns

To appreciate what dynamic workflows introduced, it’s worth contrasting them with the patterns that preceded them.

4.9.1 vs. Manual Subagent Orchestration

Before dynamic workflows, a developer could manually orchestrate subagents — spawning them one at a time, collecting results, and synthesizing. The process worked but required the human to act as the orchestrator: deciding how many subagents to spawn, what each should do, and how to combine results. This was tedious for small tasks and infeasible for large ones.

Dynamic workflows move this orchestration into the model. Claude writes the orchestration logic (how many subagents, what each does, how results combine) as a script and executes it. The human specifies the outcome; Claude handles the process.

4.9.2 vs. Static Scripts and Custom Tooling

Organizations with complex needs sometimes wrote custom orchestration scripts — Python or shell scripts that coordinated multiple Claude API calls. These were powerful but rigid: each script solved one specific problem, and adapting it to a new task required rewriting.

Dynamic workflows are adaptive. Because Claude writes the orchestration at runtime based on your description, the same mechanism handles bug hunts, migrations, research, and verification — without you writing custom scripts for each.

4.9.3 vs. Single Long-Running Agents

A single agent working through a large task sequentially is limited by its context window and the linear nature of its progress. A task that requires reading 500 files can’t fit in one context, and processing them one at a time is slow. Dynamic workflows parallelize this — 50 subagents each reading 10 files complete the work in a fraction of the time, with each subagent’s context fitting comfortably.

4.10 The Abstraction Leap

The deeper significance of dynamic workflows is an abstraction leap. Previously, the levels of abstraction in agentic coding were:

  1. API level: Call the Claude API directly, manage the loop yourself.
  2. Tool level: Use a tool-using agent that can read, write, and execute.
  3. Subagent level: Spawn isolated agents for specific tasks.

Dynamic workflows add a fourth level:

  1. Orchestration level: Describe the desired outcome; Claude writes and executes the coordination.

Each level raises the ceiling of what’s practical. At the API level, managing one agent is work. At the orchestration level, coordinating a hundred agents is a single prompt.

Note

The abstraction leap matters because it changes who can leverage parallelism. At the subagent level, using parallelism effectively required engineering skill — you had to design the decomposition, manage the coordination, and synthesize results. At the orchestration level, anyone who can describe an outcome can leverage parallelism. Claude handles the engineering.

4.11 Technical Considerations for Large Workflows

4.11.1 Rate Limits and Concurrency

When a workflow spawns hundreds of subagents, it can hit API rate limits. Claude Code manages this by pacing subagent creation and retrying on rate-limit errors. For very large workflows (hundreds of subagents), the pacing adds latency but ensures reliability.

4.11.2 Error Handling and Partial Results

Not every subagent will succeed. Some may encounter errors, produce unusable output, or time out. Dynamic workflows handle this by:

  • Isolating failures: one subagent’s failure doesn’t crash the workflow.
  • Retrying failed subagents automatically.
  • Reporting partial results when some subagents can’t complete, rather than failing entirely.

4.11.3 Context Management Across Subagents

Each subagent has its own context window, but they may need to share information. Dynamic workflows support passing context between subagents — the orchestrator can collect one subagent’s output and feed it as input to another. This enables workflows where later steps depend on earlier findings.

4.12 Real-World Workflow Examples

4.12.1 Example 1: Comprehensive Security Audit

> Perform a comprehensive security audit of this repository.
  Check for OWASP Top 10 vulnerabilities, inspect all
  authentication and authorization code, review cryptographic
  implementations, and check dependency vulnerabilities.
  Produce a prioritized report with severity ratings.

This prompts a dynamic workflow that fans out security-focused subagents across the codebase, each checking a specific vulnerability class. An adversarial agent reviews findings to eliminate false positives. The synthesizer produces a prioritized report.

4.12.2 Example 2: Framework Migration

> Migrate this codebase from Express to Fastify.
  Preserve all existing behavior, update all tests,
  and ensure the build succeeds.

This prompts a workflow that decomposes the migration file-by-file (or route-by-route), with each subagent handling its portion of the migration. A synthesizer resolves conflicts in shared files and runs the test suite.

4.12.3 Example 3: Documentation Generation

> Generate comprehensive API documentation for every
  public endpoint in this codebase. Include request/response
  schemas, authentication requirements, and usage examples.

This prompts a workflow with one subagent per endpoint, each generating documentation by reading the route handler, models, and tests. The synthesizer combines them into a cohesive API reference.

4.13 Key Takeaways

  • Dynamic workflows let Claude write the orchestration. Claude authors a script that spawns and coordinates tens to hundreds of parallel subagents.
  • Two ways to start: ask conversationally, or enable ultracode (sets effort to xhigh) for workflow-by-default behavior.
  • Three primary use cases: codebase-wide bug hunts, large migrations, and critical work verification.
  • Progress saves automatically. Failed subagents can be retried or skipped without losing completed work.
  • Adversarial agents verify results. Before you see output, adversarial agents try to break it — a built-in red-team step.
  • GA for Max, Team, and Enterprise. No separate pricing; token consumption scales with parallelism.
  • Set token budgets for large or cost-sensitive workflows to control spend.
  • Compose with /goal and /loop to run workflows repeatedly until a condition is met or on a schedule.