Multi-Agent Wiki

Dynamic Workflows Overview

How code-orchestrated subagents change the design space for large-scale agentic engineering tasks.

Dynamic Workflows is a Claude Code capability (currently in research preview) that lets Claude write a JavaScript orchestration script for a large task and have a runtime execute that script in the background, spawning subagents to do the actual work.

This page maps the full spectrum of multi-agent orchestration in Claude Code, from single agents to full dynamic workflows.

Orchestration Spectrum

SQL
Single Agent
  ↓
Subagents
  ↓
Agent View / Background Sessions
  ↓
Agent Teams
  ↓
Dynamic Workflows

Single Agent

Best for tasks that fit within one conversational pass. Most reliable, lowest overhead, easiest to debug. Start here.

Subagents

Spawn one or more subagent sessions from the main agent to isolate side-task context. The main agent coordinates subagents turn by turn through its primary reasoning. Good for delegating well-scoped subtasks with independent context needs.

Agent View / Background Sessions

Manually dispatch multiple independent Claude Code sessions from a user interface. Useful when you want parallel work but are willing to coordinate results yourself. No shared task list or inter-agent messaging.

Agent Teams

Multiple Claude Code sessions with a shared task list, inter-agent messaging, and a designated lead agent. The lead coordinates, delegates, and synthesizes. Good for complex tasks where different agents have different specializations and need to communicate findings.

Dynamic Workflows

A script holds the plan, parallel structure, intermediate variables, quality checks, and convergence logic. Subagents do the actual reading, editing, shell, web, and MCP work. The runtime runs the script in the background.

When to choose Dynamic Workflows over Agent Teams:

DimensionAgent TeamsDynamic Workflows
Plan representationImplicit in lead agent reasoningExplicit script artifact
Intermediate stateLives in agent contextsLives in script variables / runtime
ParallelismLead dispatches tasksScript controls fan-out shape
RecoveryNoneCheckpoint within session
ReuseConversation onlySave to .claude/workflows/
ScaleTens of agentsTens to hundreds of agents

Dynamic Workflow Pattern

See the full engineering pattern page: Dynamic Workflow / Code-Orchestrated Subagents

Triggering a Workflow

  • Mention workflow explicitly in your prompt: "run a workflow to audit all authentication-related files".
  • Use /effort ultracode for maximum agent resources.
  • Run a saved workflow command from .claude/workflows/ or ~/.claude/workflows/.

Monitoring

Use /workflows to see running workflows and history. The progress view shows:

  • Current phase
  • Active agent count
  • Token total
  • Elapsed time
  • Phase-level status

Saving Workflows

Workflows can be saved to .claude/workflows/ (project-level) or ~/.claude/workflows/ (user-level) and rerun with different parameters.

Further Reading