defract › blog

Claude Code dynamic workflows: what they do and when you need more

2026-11-17 7 min read

Claude Code shipped dynamic workflows in research preview June 2, 2026, and has refined them since. The pitch is real: instead of a single context window trying to hold a 500-file migration, Claude writes a JavaScript orchestration script that fans the work out across dozens of subagents running in parallel. Each agent has its own focused context. Results are collected and synthesized before they reach you.

If you've been running into the ceiling where complex multi-file tasks stall, repeat work, or quietly miss things, dynamic workflows are worth understanding. Here is what they actually are, what they handle well, and where they hand back the problem unsolved.

What a dynamic workflow is

A dynamic workflow is a JavaScript script that the runtime executes in the background. Claude writes the script based on your task description; you can inspect it, save it, and rerun it. The script uses three primitives:

  • agent(prompt): spawns one subagent and returns its result
  • pipeline(items, ...stages): runs each item through a sequence of stages, with the fastest items advancing without waiting for the slowest
  • parallel(thunks): runs a set of tasks concurrently and waits for all of them

Intermediate results live in script variables rather than in Claude's main context window. With ordinary subagents, Claude is the orchestrator and all results flow back into one expanding context. With a workflow, the script holds the loop and the branching. Claude's context receives only the final synthesized answer.

The scale ceiling is 1,000 agents total per run, with 16 running concurrently by default. The default size guideline tells Claude to aim for fewer than 10 agents; you can raise it to "large" (fewer than 50) or "unrestricted" for jobs that genuinely need scale. Saved workflows go to .claude/workflows/ as a slash command you can run in any future session.

What they handle well

Anthropic identifies six patterns dynamic workflows apply:

  • Fan-out and synthesize: run one agent per file or source in parallel, then merge the findings. The classic use case is auditing every route handler in a large codebase, one agent per file, with a single summary report at the end.
  • Adversarial verification: spawn separate agents to dispute each finding before it's reported. Because the verifier agent is isolated from the reviewer, it doesn't inherit the reviewer's bias toward its own output.
  • Loop until done: keep running until stop conditions are met. Find flaky tests, record which ones fail intermittently, stop when two consecutive rounds find nothing new.
  • Tournament: agents compete through pairwise comparison. Useful for picking the best approach when several independent drafts are equally plausible.
  • Classify and act: route tasks by type to specialist agents rather than handling everything with one general prompt.
  • Generate and filter: produce many candidates, then apply quality criteria to prune them down.

These patterns are genuinely useful for what Anthropic targets: codebase-wide audits, large migrations, cross-checked research. The adversarial verification pattern closes a gap that plain parallel agent prompting leaves open: agents in the same context window tend to agree with what came before them. Isolating the verifier prevents that.

The bundled /deep-research command is the clearest example. It fans out web searches across several angles, fetches and cross-checks the sources in parallel, votes on each claim, and returns a cited report with claims that didn't survive cross-checking filtered out. You get a more trustworthy answer than a single-pass research conversation produces.

What they don't solve

Dynamic workflows automate the execution of a known task at scale. What they don't do is let you author the process itself, or put human approval gates inside it.

The documentation is direct: "No mid-run user input." A workflow pauses only for permission prompts or when it hits a usage limit. If you want sign-off between stages (reviewing a design before the agent starts coding it, approving an architecture before implementation begins), the documentation's recommendation is to "run each stage as its own workflow." Coordination between those stages is on you.

This is the right design for fully-automated tasks (a nightly migration, a security audit, a 500-file type migration). It becomes a gap when the task is a development lifecycle, a sequence of stages where human review at each gate is what keeps the output correct, and skipping a gate is how wrong things ship.

The workflow script itself is also generated by Claude per task, not authored by you once and enforced across tasks. Claude writes it; you approve it; the runtime runs it. That's fine for one-off research or audits. For a team that wants every feature to run through the same story→design→implementation→review sequence, with the same specialist reviewers and the same approval gates each time, the script-per-task model leaves that consistency unbuilt.

The gap the patterns don't fill

The six patterns are execution patterns: how to structure the work once you've decided what to do. What's separate is the process layer: how to decide what work to do next, who approves it at each stage, and how to enforce that the same sequence runs every time.

Consider the difference between an adversarial verification run (spawn agents to dispute findings from a parallel audit) and a gated code review in a development lifecycle (a reviewer sees the diff, applies specialist checks, and must return an approved verdict before the task can advance to merge). The first is a workflow pattern. The second is a stage gate. Dynamic workflows can run the first. The second requires that the stage can't advance without the reviewer's output, that the reviewer is scoped to that stage's work, and that the gate is the same for every task in the system, not rewritten each run.

Anthropic signals awareness of this. Their blog post on the feature describes dynamic workflows as Claude writing "its own harness on the fly, custom-built for the task at hand." A custom harness per task is powerful for heterogeneous work. A consistent harness across all tasks is what a team needs for reliability. The five agentic coding patterns that actually scale across larger codebases and multiple developers all depend on that consistency, not just on raw parallelism.

When to use dynamic workflows, and when to look further

Dynamic workflows are the right tool for:

  • A task that's too large for one context window and can run start to finish without human sign-off in the middle
  • Work that follows a pattern you can describe to Claude once and save as a reusable command (a nightly audit, a release checklist across a monorepo)
  • Research or analysis where adversarial cross-checking between agents improves the result

They're not the right tool for:

  • A development lifecycle where a human needs to approve the design before the agent starts implementing it
  • A team that needs the same review sequence to run consistently across every task, not just the tasks where someone remembers to describe the process
  • Work where the scope needs to be signed off before the agents start, not discovered during the run

For the second set, what you need is not a smarter way to spawn agents. It's a process layer: a defined lifecycle, human gates at defined points, and a tool that enforces the sequence rather than generating a new one each time.

defract is built for that layer. It runs on Claude Code and structures work into a fixed lifecycle (story → design → architecture → implementation → review → release), with approval gates between each stage. The design stage is visual. The review stage uses specialist agents. The process is the same for every task. If dynamic workflows answer the question "how do I run a 500-file audit without hitting a context limit", defract answers the question "how do I make sure my team ships the right thing, not just a fast thing."

defract

a structured lifecycle for your parallel Claude Code agents, with approval gates at every stage. free, no caps, no signup.