TL;DR
Claude Code dynamic workflows turn orchestration into a JavaScript script that runs up to 1,000 agents per run - here is how scripts, schemas, budgets, and resume actually work.
Read next
Ultracode is two documented things: a prompt keyword that turns one task into a dynamic workflow, and an /effort setting that pairs xhigh reasoning with automatic orchestration. Here is exactly what the docs say.
8 min readClaude agents vs skills, untangled: agents are workers with their own context window, skills are instructions loaded on demand. Here is the decision table.
8 min readAuto mode replaces permission prompts with a background safety classifier - here is how the Shift+Tab cycle, hard_deny rules, and glob deny patterns actually fit together.
8 min readLast updated: June 11, 2026
Dynamic workflows are the biggest change to how Claude Code parallelizes work since subagents shipped. Instead of Claude deciding turn by turn what to spawn next, it writes a JavaScript orchestration script for your task, and a runtime executes that script in the background across dozens to hundreds of agents while your session stays responsive. The feature landed in v2.1.154 as a research preview; the official workflows documentation covers the full surface.
This guide walks through triggering a run, the script layer, schemas, budgets, and resume. If you are still picking between orchestration options, start with subagents vs agent teams vs workflows and come back here for the deep dive.
Per the workflows docs, dynamic workflows require Claude Code v2.1.154+ and are available on all paid plans, with Anthropic API access, and on Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry. On Pro they are opt-in via the Dynamic workflows row in /config. InfoQ's coverage describes the June 2026 launch as a research preview aimed at tasks that exceed what one agent can coordinate.
The cleanest mental model comes straight from the official comparison table: who holds the plan?
| Subagents | Agent teams | Workflows | |
|---|---|---|---|
| What it is | A worker Claude spawns | A lead agent supervising peer sessions | A script the runtime executes |
| Who decides what runs next | Claude, turn by turn | The lead agent, turn by turn | The script |
| Where intermediate results live | Claude's context window | A shared task list | Script variables |
| Scale | A few delegated tasks per turn | A handful of long-running peers | Dozens to hundreds of agents per run |
| Interruption | Restarts the turn | Teammates keep running | Resumable in the same session |
That third column is the differentiator. With subagents and teams, every intermediate result lands in a context window somewhere. A workflow keeps them in script variables, so Claude's context holds only the final answer - which is what makes hundreds of agents per run feasible.
What a workflow is not: a replacement for subagents. The workers it spawns are subagents; the workflow is the orchestration layer above them. Nor is it an agent team - teammates message each other and self-claim tasks, while workflow agents only execute the step the script hands them.
The fastest way to feel the difference is the bundled workflow. /deep-research fans out web searches across several angles, cross-checks the sources it finds, votes on each claim, and returns a cited report with failed claims filtered out. It requires the WebSearch tool.
/deep-research What changed in the Node.js permission model between v20 and v22?
Claude Code asks whether to allow the workflow, then the run starts in the background. Run /workflows and press Enter on the run for the progress view: per-phase agent counts, token totals, elapsed time, and drill-down into any agent's prompt, tool calls, and result. Four footer keys are worth memorizing: p pauses or resumes, x stops an agent or the whole run, r restarts a running agent, s saves the script as a reusable command.
Every custom workflow follows the same pattern: phases of agents, one synthesized result, nothing accumulating in context.
Three ways to start one for your own task:
ultracode keyword. Include it in a prompt to run that one task as a workflow without changing the session's effort level: ultracode: audit every API endpoint under src/routes/ for missing auth checks. Before v2.1.160 the literal trigger keyword was workflow; a /config setting disables keyword triggering entirely./effort ultracode. A session-level setting combining xhigh reasoning with automatic workflow planning for every substantive task. One request can become several workflows in a row: understand, change, verify. It resets each session and costs more tokens per request - drop back to /effort high for routine work.Before the run starts, the CLI shows the planned phases with options to run, run and never ask again for that workflow in that project, view the raw script (Ctrl+G opens it in your editor), or cancel. In bypass-permissions mode, claude -p, and the Agent SDK, runs start immediately.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
From the archive
Jun 11, 2026 • 8 min read
Jun 11, 2026 • 9 min read
Jun 11, 2026 • 9 min read
Jun 11, 2026 • 8 min read
Every run writes its script to a file under ~/.claude/projects/, and Claude receives the path when the run starts - so you can read the orchestration, diff it against a previous run, edit it, and ask Claude to relaunch from the edited version.
The most detailed public writeup of the script API is alexop.dev's deterministic orchestration deep dive, which documents four primitives from the research preview:
agent(prompt, opts) spawns one subagent. Options include label and phase for the progress UI, model to override the model per call, isolation: "worktree" for parallel file writes, and schema for validated structured output.parallel(thunks) runs tasks concurrently as a barrier - it waits for every thunk before returning. Throwing thunks resolve to null instead of rejecting the call.pipeline(items, ...stages) streams items through stages with no barrier: item A can be in stage three while item B is still in stage one.workflow(name, args) composes another workflow inline, sharing the parent's concurrency cap, agent counter, and token budget, limited to one nesting level.The author's rule for choosing between the two flow primitives: default to pipeline(), and use a barrier only when a stage genuinely needs all prior results at once - deduplication, early-exit logic, or cross-item comparison. A sketch of the auth-audit example in that shape:
const verified = await pipeline(
routeFiles,
(file) => agent(`Audit ${file} for missing auth checks.`, {
schema: FINDING_SCHEMA,
phase: "audit",
}),
(finding) => agent(`Try to refute this finding: ${JSON.stringify(finding)}`, {
phase: "verify",
})
);
The schema option matters more than it looks. It forces the subagent to call a structured-output tool, validation happens at the tool-call layer, and the model retries automatically on a mismatch - far more reliable than asking for JSON in the prompt and hoping.
One sharp edge: determinism is enforced. Date.now(), Math.random(), and an argless new Date() all throw inside a workflow script, because the runtime journals calls to make runs resumable. Timestamps must come in through args, and variety across agents comes from varying prompts by index. It is the first error most people hit.
For the broader patterns workflows make practical - fan-out and reduce, adversarial verification, judge panels - see seven AI agent orchestration patterns and the walkthrough in building multi-agent workflows in Claude Code.
There is no per-run dollar budget setting. What bounds cost is hard runtime limits plus visibility, all documented on the official page:
| Constraint | Value |
|---|---|
| Concurrent agents | Up to 16 (fewer on low-core machines) |
| Total agents per run | 1,000 |
| Mid-run user input | None - only agent permission prompts pause a run |
| Script filesystem/shell access | None - only agents touch files and shell |
Runs count toward your plan's usage and rate limits like any other session, and the docs are direct that a run can use meaningfully more tokens than working through the task in conversation. The recommended budgeting practice: pilot on a small slice first - one directory instead of the whole repo. The /workflows view shows each agent's token usage live, and stopping a run there does not lose completed work.
The other budget lever is model routing. Every agent uses your session's model unless the script routes a stage to a different one, so check /model before a large run and ask for a smaller model on stages that do not need the strongest one. For deciding which model deserves the expensive stages, the scoring framework in Fable 5 vs Opus 4.8 applies directly.
One permission detail that surprises people: workflow subagents always run in acceptEdits mode and inherit your tool allowlist regardless of your session's permission mode. File edits are auto-approved; shell commands and web fetches outside your allowlist can still prompt mid-run, so add the commands your agents will need before a long run. To disable workflows entirely: toggle in /config, set "disableWorkflows": true, or set CLAUDE_CODE_DISABLE_WORKFLOWS=1 - orgs can enforce the same through managed settings.
Resume is checkpoint-based: stop a run, resume it in /workflows with p, and completed agents return cached results while only the rest run live. The honest limitation is the session boundary - resume works within the same Claude Code session, and exiting mid-run means the next session starts the workflow fresh. For long-horizon work that must survive restarts, the checkpointing habits in the overnight agents workflow still apply.
When a run does what you wanted, press s in /workflows to save its script as a slash command. Two locations: .claude/workflows/ in the project (shared via the repo) or ~/.claude/workflows/ (personal, every project). A project workflow wins a name collision.
Saved workflows accept structured input through an args global. Say "Run /triage-issues on issues 1024, 1025, and 1030" and Claude passes the list as structured data the script can call array methods on directly. Omit input and args is undefined.
The agents overview page draws the line well: workflows are for jobs that outgrow a handful of subagents or need findings verified against each other - a codebase-wide audit, a 500-file migration, cross-checked research. If a side task would merely flood your context, a plain subagent is cheaper. If workers need to talk to each other over hours, agent teams fit better. And since there is no mid-run user input, a process needing sign-off between stages should be split into one workflow per stage. When a run goes sideways, start with debugging AI agent workflows.
Claude Code v2.1.154 or later, on any paid plan (Pro, Max, Team, Enterprise), via the Anthropic API, or on Bedrock, Vertex AI, and Microsoft Foundry. On Pro the feature is off by default - enable it from the Dynamic workflows row in /config.
The script holds the plan. With subagents and agent teams, Claude or a lead agent decides turn by turn what runs next. A workflow encodes the loop in JavaScript, keeps intermediate results in script variables, and scales to hundreds of agents per run within caps of 16 concurrent and 1,000 total.
Within the same session, yes - completed agents return cached results on resume and only unfinished work runs live. Across sessions, no: exiting Claude Code mid-run means the next session starts the workflow fresh.
The runtime journals calls so runs can resume deterministically, which means nondeterministic functions throw inside the script. Pass timestamps in through args and create variety across agents by varying prompts by index.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Anthropic's agentic coding CLI. Runs in your terminal, edits files autonomously, spawns sub-agents, and maintains memory...
View ToolAnthropic's flagship reasoning model. Best-in-class for coding, long-context analysis, and agentic workflows. 1M token c...
View ToolInteractive TUI dashboard that shows exactly where your Claude Code and Cursor tokens are going, in real time.
View ToolMac app for running parallel Claude Code, Codex, and Cursor agents in isolated workspaces. Watch every agent work at onc...
View ToolEvery coding agent in one window. Stop alt-tabbing between Claude, Codex, and Cursor.
View AppTurn a one-liner into a working Claude Code skill. From idea to installed in a minute.
View AppUnlock pro skills and share private collections with your team.
View AppConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsA complete, citation-backed Claude Code course with setup, prompting systems, MCP, CI, security, cost controls, and capstone workflows.
ai-developmentA concrete step-by-step guide to moving your development workflow from Cursor to Claude Code - settings, rules, keybindings, and the habits that transfer.
Getting Started
Nimbalyst Demo: A Visual Workspace for Codex + Claude Code with Kanban, Plans, and AI Commits Try it: https://nimbalyst.com/ Star Repo Here: https://github.com/Nimbalyst/nimbalyst This video demos N...

Composio: Connect AI Agents to 1,000+ Apps via CLI (Gmail, Google Docs/Sheets, Hacker News Workflows) Check out Composio here: http://dashboard.composio.dev/?utm_source=Youtube&utm_channel=0426&utm_...

Anthropic has released Channels for Claude Code, enabling external events (CI alerts, production errors, PR comments, Discord/Telegram messages, webhooks, cron jobs, logs, and monitoring signals) to b...
Claude agents vs skills, untangled: agents are workers with their own context window, skills are instructions loaded on...
Ultracode is two documented things: a prompt keyword that turns one task into a dynamic workflow, and an /effort setting...
Auto mode replaces permission prompts with a background safety classifier - here is how the Shift+Tab cycle, hard_deny r...
Anthropic says persistent file-based memory improved Fable 5 three times more than it improved Opus 4.8. Here is the ful...
Task budgets give Claude a token countdown for the whole agentic loop, so the model paces itself instead of discovering...
An ops guide to managing a fleet of Claude agents: spawning patterns, worktree isolation, build gates, orphaned-agent fa...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.