Dynamic Workflows
What it is
Dynamic workflows are a Claude Code feature (research preview, May 2026) that allows Claude to dynamically write orchestration scripts and run tens to hundreds of parallel subagents in a single session. The feature handles large-scale tasks end-to-end, including progress save/resume for runs that extend into hours or days.
Key capabilities:
- Parallel subagent execution (10s to 100s of agents)
- Independent verification of results before folding them in
- Progress saved during runs; interrupted jobs resume where they left off
- Coordination happens outside the conversation, keeping the main plan on track
- Adversarial agents challenge findings to drive convergence
Why it matters
Dynamic workflows represent a shift from single-pass agent execution to orchestrated multi-agent systems within one Claude Code session. This changes the unit of work an individual agent can handle from minutes to days, and from localized tasks to codebase-wide operations.
The Bun port from Zig to Rust (750,000 lines, 99.8% test pass rate, 11 days) demonstrates that this is not a theoretical capability but a production-scale execution pattern.
Key points
- Two activation modes: explicit request ("Create a workflow") or the
ultracodesetting (effort level xhigh with automatic workflow triggering) - Available on CLI, Desktop, VS Code extension, API, Amazon Bedrock, Vertex AI, and Microsoft Foundry
- Requires Max, Team, or Enterprise plans (admin-enabled)
- Token consumption is substantially higher than typical sessions; first trigger shows a confirmation prompt
- Organization admins can disable workflows through managed settings
- Adversarial agent convergence: parallel agents first attempt solutions independently, then adversarial agents challenge the answers iteratively until convergence — simulating senior engineering team collaboration (gregisenberg, 2026-05-29)
- Cost context: Anthropic warns of extremely fast token consumption, but spending $500 to complete in one week a codebase migration that would otherwise require a team for three months is considered high cost-effectiveness (gregisenberg, 2026-05-29)
Six Core Patterns (Thariq, 2026-06-02)
Thariq Shihipar (Anthropic) identified six composable patterns that Claude uses when building dynamic workflows:
| Pattern | What it does | Best for |
|---|---|---|
| Classify-and-act | Classifier agent routes task to appropriate subagent | Multi-type task queues |
| Fan-out-and-synthesize | Split task into many small steps, run agents in parallel, merge results | Large-scale analysis, codebase-wide operations |
| Adversarial verification | Each output checked by independent verifier agent | Security reviews, factual claims |
| Generate-and-filter | Generate many ideas, filter by rubric, dedupe | Brainstorming, naming, design exploration |
| Tournament | N agents compete on same task, judging agent picks winner | Taste-based decisions, solution selection |
| Loop until done | Spawn agents until stop condition met (no new findings, no more errors) | Unknown-scope tasks, incident investigation |
Use Cases (from production practice)
- Migrations and refactors: Bun rewritten from Zig to Rust using workflows. Each fix in its own worktree subagent → review agent → merge (jarredsumner, 2026-06-02)
- Deep research: Fan-out web searches → fetch sources → adversarially verify claims → synthesize cited report. Also works for Slack context compilation or codebase exploration
- Deep verification: One agent identifies all factual claims → subagent checks each in detail → verification agent checks source quality
- Sorting at scale: Tournament or pairwise-comparison pipeline for qualitative ranking (e.g., support tickets by severity). Comparative judgment more reliable than absolute scoring
- Memory and rule adherence: Verifier agent per rule checks compliance; skeptic persona reviews rules to avoid false positives. Reverse: mine sessions for recurring corrections → cluster → verify → distill into CLAUDE.md
- Root-cause investigation: Separate agents for logs, files, data generate independent hypotheses → panel of verifiers and refuters. Applies to sales drops, pipeline failures, any post-mortem
- Triaging at scale: Classify → dedupe → act (fix or escalate). Quarantine pattern: untrusted-content agents barred from high-privilege actions
- Exploration and taste: Generate solutions → review agent with rubric → tournament selection. Task complete when review agent satisfied
- Evals: Spin off agents in worktree → comparison agents grade against rubric
- Model routing: Classifier agent researches task complexity → routes to Sonnet or Opus based on expected difficulty
Why dynamic workflows work: three failure modes they solve
- Agentic laziness: Claude stops after partial progress (e.g., 20 of 50 security items). Workflows enforce completion via isolated subagents with focused goals.
- Self-preferential bias: Claude favors its own results when verifying. Workflows use independent adversarial agents for verification.
- Goal drift: Original constraints lost across many turns, especially after compaction. Workflows preserve goals in isolated context windows.
Tips for building workflows
- Prompting: Detailed prompting creates best results. Even "quick workflows" for small adversarial reviews help.
- Combine with /goal and /loop: For repeatable workflows (triage, research, verification), pair with /loop for regular intervals and /goal for hard completion requirements.
- Token budgets: Set explicit budgets (e.g., "use 10k tokens") to cap consumption.
- Saving and sharing: Press "s" in workflow menu to save. Check into
~/.claude/workflowsor distribute via skill. In skill, reference workflow files in SKILL.MD and prompt Claude to treat them as templates rather than verbatim scripts. - Quarantine for triage: Untrusted public-content agents should not take high-privilege actions; acting agents handle those separately.
Evidence across sources
| Source | Key Claim | Relevance |
|---|---|---|
| Anthropic Blog — Introducing Dynamic Workflows | Claude dynamically writes orchestration scripts for parallel subagents | Official product announcement; defines feature scope and activation modes |
| Anthropic Blog | Bun ported from Zig to Rust: 750K lines, 99.8% pass rate, 11 days | Concrete scale demonstration of production-grade migration |
| AI Briefing 2026-05-29 Morning | "Create a workflow" or ultracode triggers hundreds of parallel agents with cross-checking | User-facing description of adversarial convergence pattern and cost framing |
| AI Briefing 2026-05-29 Evening | CC Mirror enables Dynamic Workflows with any model (e.g. GLM 5.1), lowering cost | Third-party extension broadens accessibility beyond official Opus 4.8 requirement |
| Thariq — A Harness for Every Task | Six core patterns (classify-act, fan-out-synthesize, adversarial-verify, generate-filter, tournament, loop-until-done) + 10 use cases + three failure modes | Deep operational guidance from feature author; expands pattern library and practical tips |
Open questions
- How does token cost scale with workflow depth and agent count? The blog warns of "substantially more tokens" but provides no formula.
- What is the failure mode when a subagent diverges or gets stuck? The blog mentions convergence checking but not deadlock handling.
- How does
ultracodedecide when to trigger a workflow vs. staying in single-agent mode? - Will this pattern generalize beyond coding tasks (e.g., research synthesis, document review)?
- When should "quick workflow" be used vs. full workflow? Thariq suggests even small adversarial reviews benefit from workflow isolation, but the token overhead may not always justify it.
- How do saved workflows in
~/.claude/workflowsinteract with skills? Can a skill reference multiple workflow templates and let Claude choose based on task type?
Prompts for witness
- When have you encountered a task that was "too big for one pass"? How did you break it down, and what would change if you had 100 parallel agents?
- The Bun port took 11 days with 750K lines. What is the largest refactoring or migration you have attempted? What made it succeed or fail?