Claude Code Workflows

Claude Code Dynamic Workflows: Official Step-by-Step Guide

Dynamic workflows let Claude Code turn a hard task into a script-driven, multi-agent run. This guide explains what launched on May 28, 2026, how to use it, and where the official docs draw the limits.

Editorial hero illustration for Claude Code dynamic workflows showing orchestration layers, subagent panels, and cost-control nodes.

Get the latest on AI, LLMs & developer tools

New MCP servers, model updates, and guides like this one — delivered weekly.

What Launched

On May 28, 2026, Claude introduced dynamic workflows in Claude Code. The official launch post describes them as long-running, parallel runs where Claude writes orchestration code, fans work out to many subagents, and checks results before reporting back. The verified ClaudeDevs thread framed the product behavior more directly: use the word workflow in a prompt to get started.

The useful way to read this launch: workflows are not another prompt template. They are a new orchestration path inside Claude Code for work that is too large for one conversational loop: codebase audits, service-wide bug hunts, large migrations, cross-checked research, and plans that should be attacked from several angles before you accept them.

The workflow shape:

Your prompt
  -> Claude writes workflow JavaScript
  -> Runtime starts background phases
  -> Subagents investigate, edit, test, or review
  -> Results are cross-checked
  -> One coordinated answer returns to the session

Definition

A Claude Code dynamic workflow is a JavaScript orchestration script that Claude writes for your task, then a separate runtime executes in the background.The agents do the actual reading, writing, shell work, research, and review. The script coordinates the run and stores intermediate results outside the main chat context.

That distinction is the whole feature. In normal chat, Claude decides what to do next turn by turn, and every result has to fit back into the conversation. In a workflow, the plan, loops, branches, and intermediate values live in the workflow script. The main session stays responsive and receives the coordinated result.

Requirements and Availability

The operational source of truth is the Claude Code workflow docs. They say dynamic workflows are in research preview, require Claude Code v2.1.154 or later, and are available on paid plans and through supported API/provider deployments. The launch blog and ClaudeDevs thread also list Claude Code CLI, Desktop, VS Code, the Claude API, Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry.

RequirementWhat to checkCommand or place
Claude Code versionUse v2.1.154 or later for workflows.claude --version
Feature enabledPro users may need to enable the Dynamic workflows row./config
Plan or providerUse a paid plan or supported provider path.Claude account, API, Bedrock, Vertex AI, Foundry
Tools/deep-research needs web search access.Tool settings and permission allowlist
# Check your version
claude --version

# Update if needed
claude update

# Inside Claude Code, open settings and confirm Dynamic workflows
/config

There is one launch-day nuance: the blog and X thread emphasize Max, Team, and Enterprise availability, while the docs currently give the more specific paid-plan setup note and mention Pro enablement through /config. For actual setup, follow the docs page and your account's settings screen.

Mental Model: Subagents, Skills, and Workflows

Claude Code already had several ways to parallelize or reuse work. Dynamic workflows sit above subagents: they use subagents, but the coordination moves into a script. That is why the feature is useful for repeatable fan-out and verification patterns.

FeatureWhat holds the plan?Best useScale
SubagentClaude decides turn by turn.One side task that would clutter context.A few delegated tasks per turn.
SkillReusable instructions Claude follows.A repeatable procedure or domain rule.Similar to normal/subagent work.
Dynamic workflowThe workflow script decides the phases.Audits, migrations, research, adversarial review.Dozens to hundreds of agents per run.

Use subagents when you need one or two isolated investigations. Use skills when the know-how should be reusable. Use workflows when the orchestration itself should be repeatable: fan out, compare findings, restart failed agents, save the successful run, and reuse it as a command.

Quickstart: Run the Built-In Workflow

The fastest safe test is /deep-research, the bundled workflow documented by Claude Code. It fans out searches across angles, fetches sources, cross-checks claims, and returns one cited report. Pick a bounded question first so you can see usage and behavior before trying a large migration.

Step 1: Start Claude Code in a project

cd /path/to/your/project
claude

Step 2: Run a scoped research workflow

/deep-research What changed in the Node.js permission model between v20 and v22?

Step 3: Approve the workflow

Claude Code shows the planned workflow before it runs. Choose Yes, run itif the phases match your intent. If you want to inspect the generated orchestration, choose View raw script. If the prompt is too broad, cancel and narrow it.

Step 4: Watch it from /workflows

/workflows

The workflow view shows phases, agent counts, token totals, and elapsed time. Drill into a phase to inspect each agent's prompt, recent tool calls, and result. When the run finishes, Claude inserts the report into your current session.

Create a Custom Workflow With One Prompt

To run your own task as a workflow without changing the whole session, include the word workflow anywhere in the prompt. Claude Code highlights the word and routes the task through workflow creation.

Run a workflow to audit every API endpoint under src/routes for missing auth checks.

Scope:
- read-only first pass
- group findings by endpoint
- verify each finding with an independent reviewer agent
- return only confirmed issues
- do not edit files unless I approve a follow-up workflow

The docs mention one small escape hatch: if Claude Code highlights workflowand you did not mean to trigger the feature, press alt+w to ignore it for that prompt.

Prompt Pattern

Prompt partWhy it mattersExample
ScopeControls token usage and blast radius.under src/routes only
Output contractPrevents a pile of raw agent notes.return confirmed issues with file paths
Verification ruleUses workflows for cross-checking, not just fan-out.independent reviewer agent must confirm
Edit policyAvoids surprise file changes on broad tasks.read-only unless I approve edits

Use Ultracode When You Want Claude to Decide

ultracode is not a normal model effort level. The model configuration docs define it as a Claude Code session setting: it uses xhigh reasoning effort and additionally has Claude orchestrate dynamic workflows for substantive tasks.

# Turn on automatic workflow orchestration for this session
/effort ultracode

# Return to normal high effort for routine work
/effort high

Use ultracode for a session where most tasks are large, ambiguous, or high-risk: migrations, deep audits, design stress tests, or repo-wide cleanup. Do not leave it on for routine edits. The workflow docs state that ultracode applies to every substantive task in the session, uses more tokens, takes longer, and resets when you start a new session.

Approval Flow: Read Before You Run

The CLI approval prompt shows the planned phases and gives four actions. Treat this as the last checkpoint before the run can consume meaningful usage or make approved file edits through agents.

ActionUse it when
Yes, run itThe phases are scoped and the permissions are acceptable.
Yes, and do not ask againYou trust this saved workflow in this project path.
View raw scriptYou want to inspect the JavaScript orchestration before approval.
NoThe task is too broad, the phases are wrong, or the tools are risky.

Two keyboard details matter. Ctrl+G opens the generated script in your editor. Tab lets you adjust the prompt before the run starts. In Desktop, the same decision appears as an approval card with Once, Always, and Deny actions.

Save a Workflow as a Slash Command

When a workflow produces a useful repeatable process, save it. Saved workflows become slash commands and appear in / autocomplete like bundled commands.

/workflows

# Select the completed run
# Press s
# Choose project or user location
# Press Enter to save

# Later:
/api-auth-audit
LocationWho gets it?Best for
.claude/workflows/Everyone who clones the repo.Team workflows: release audit, branch review, migration checker.
~/.claude/workflows/Only you, across projects.Personal research, private review style, local maintenance tasks.

If a project workflow and a personal workflow share a name, the project workflow wins. That is the right default for team consistency, but it also means workflow names should be specific.

Monitor, Pause, Resume, Restart, and Stop Runs

Workflows run in the background. Use /workflows to inspect live and completed runs, then use the keys shown in the footer. The task panel below the input also shows a one-line progress summary while a run is active.

KeyAction
Up / DownSelect a phase or agent.
Enter or RightOpen a phase, then open an agent detail view.
EscBack out one level.
j / kScroll inside a long agent detail.
pPause or resume the run.
xStop an agent or the whole workflow, depending on focus.
rRestart the selected running agent.
sSave the run's script as a command.

Resume is session-scoped. If you pause or stop a run, completed agents can return cached results and the remaining agents can run live when you resume in the same Claude Code session. If you exit Claude Code while a workflow is running, the next session starts the workflow fresh.

Runtime Behavior and Limits

The workflow runtime is isolated from the conversation. The workflow script coordinates the agents; the agents do the file, shell, web, and MCP work. The docs list concrete limits so users can reason about resource usage.

LimitPractical meaning
No mid-run user inputBreak sign-off-heavy processes into separate workflows.
No direct filesystem or shell access from the workflow scriptAgents perform those actions; the script coordinates.
Up to 16 concurrent agentsLarge runs still have local resource bounds.
1,000 agents total per runRunaway loops are bounded.

Cost and Usage Control

Both the docs and the ClaudeDevs thread warn that workflows can consume far more usage than a normal Claude Code conversation. A workflow can start many agents, and each agent uses your session's model unless the script routes a phase to another model.

# Before a large workflow
/model
/usage

# In your prompt
Use a smaller model for indexing and low-risk classification phases.
Use the strongest model only for final verification and architectural judgment.
  • Start with a scoped run, not the entire monorepo.
  • Check /model before launching expensive work.
  • Use /usage to inspect current session usage and plan-limit impact.
  • Ask Claude to route low-risk stages to a smaller model when appropriate.
  • Stop runaway or mis-scoped runs from /workflows.
  • Keep ultracode for sessions where most tasks justify workflow orchestration.

Permissions and Safety Details

Your permission mode controls the workflow launch prompt, but not every subagent action behaves like your main turn. The docs state that workflow subagents run in acceptEdits mode and inherit your tool allowlist. File edits are auto-approved. Shell commands, web fetches, and MCP tools outside the allowlist can still prompt mid-run.

RiskControl
Broad edits from a vague workflowStart with read-only prompts or path-limited scopes.
Long run blocks on tool promptsAdd required commands and MCP tools to the allowlist first.
Headless mode has no human promptConfigure permission rules before using claude -p or the Agent SDK.
Workflow writes too muchUse git branches/worktrees and inspect /diff before committing.

For high-risk work, use a two-stage pattern: first workflow produces confirmed findings only; second workflow applies the approved changes. That matches the docs' note that workflows do not accept arbitrary mid-run user input.

Turn Workflows Off

Dynamic workflows can be disabled at the user or organization level. When disabled, bundled workflow commands are unavailable, the workflow keyword no longer triggers a run, and ultracode is removed from the /effortmenu.

# Option 1: interactive setting
/config
# Toggle Dynamic workflows off

# Option 2: user settings
{
  "disableWorkflows": true
}

# Option 3: environment variable, read at startup
CLAUDE_CODE_DISABLE_WORKFLOWS=1 claude

Organization admins can also set "disableWorkflows": true in managed settings or use the Claude Code admin settings page. Use that for environments where multi-agent token usage or auto-approved file edits need central policy.

Workflow Examples You Can Adapt

Anthropic's launch post lists codebase-wide bug hunts, profiler-guided optimization, security audits, migrations, modernization work, and high-stakes double-checking as early workflow uses. The same post cites a Bun port from Zig to Rust as an at-scale example, with the caveat that it was not in production at publication time.

Example 1: API Auth Audit

Run a workflow to audit src/routes and src/api for missing authentication checks.

Rules:
- read files only
- group endpoints by auth pattern
- have one agent find issues and another verify them
- exclude test fixtures and generated files
- return confirmed findings with file paths and suggested fixes

Example 2: Migration Plan Before Edits

Run a workflow to plan the migration from the old payments client to the new billing SDK.

Do not edit files.
Map every call site, classify risk, propose phases, and have reviewer agents challenge the plan.
Return a phased migration plan with test commands for each phase.

Example 3: Cross-Checked Research

/deep-research Compare the official migration paths for React 19 Server Actions and Next.js 16 forms.

Focus on official docs.
Return only claims that are supported by source links.

Example 4: Save a Team Review Command

Run a workflow to review this branch for correctness bugs.

Scope:
- current git diff only
- no style-only feedback
- verify each finding against code
- include test commands that would catch the bug

# After the run succeeds:
/workflows
# press s and save to .claude/workflows/branch-correctness-review

Common Mistakes

MistakeWhy it failsBetter pattern
Run a workflow to improve the appThe scope is too broad, so usage and edits are hard to control.Limit paths, output, and edit policy.
Using workflows for one-file editsThe orchestration overhead is not buying much.Use normal chat or a single subagent.
Leaving ultracode on all dayEvery substantive task may become a heavier run.Turn it on for focused sessions, then return to /effort high.
Approving without reading phasesThe generated plan may not match your actual risk boundary.Inspect the phase list and raw script for high-risk tasks.
Running headless without permission rulesNo one is present to approve unexpected tool calls.Configure allow/deny rules before claude -p or SDK use.

Launch Checklist

  • Confirm claude --version is at least v2.1.154.
  • Open /config and confirm Dynamic workflows are enabled.
  • Run a small /deep-research workflow before code edits.
  • Use /workflows to inspect phases, token totals, and agent output.
  • For custom workflows, include path scope, output format, verification rule, and edit policy.
  • Use /effort ultracode only for sessions where most tasks justify it.
  • Save repeatable workflows to .claude/workflows/ for team commands.
  • Use /usage, /model, and smaller-model routing for cost control.
  • Disable workflows through /config, settings, env vars, or managed settings when policy requires it.

FAQ

What are dynamic workflows in Claude Code?

Dynamic workflows are JavaScript orchestration scripts that Claude writes for a task. The workflow runtime runs many Claude subagents in the background, keeps intermediate state in script variables, and returns a coordinated final result.

How do I start a Claude Code workflow?

Run the built-in /deep-research workflow, include the word workflow in a prompt, run a saved workflow command, or enable /effort ultracode so Claude decides when a substantive task should become a workflow.

What Claude Code version do workflows require?

The workflow docs say dynamic workflows require Claude Code v2.1.154 or later. Run claude --version to check your install and update before relying on the feature.

What is ultracode?

Ultracode is a Claude Code session setting. It uses xhigh reasoning effort and lets Claude automatically plan dynamic workflows for substantive tasks in that session.

Can I save a workflow as a reusable command?

Yes. Open /workflows, select the run, press s, and choose either .claude/workflows/ for a project-shared command or ~/.claude/workflows/ for a personal command.

Are dynamic workflows expensive?

They can be. The official docs and ClaudeDevs thread both warn that workflows can consume substantially more usage because one run can spawn many agents. Start with a scoped task, check /usage, and stop runs from /workflows if needed.

Can admins disable workflows?

Yes. Individuals can toggle Dynamic workflows off in /config, set disableWorkflows in settings.json, or set CLAUDE_CODE_DISABLE_WORKFLOWS=1. Organizations can disable workflows through managed settings or Claude Code admin settings.

Glossary

TermMeaning
Dynamic workflowA Claude-written orchestration script executed by the workflow runtime.
SubagentA delegated Claude worker with its own task context.
Workflow runtimeThe isolated runner that executes the orchestration script.
/deep-researchThe bundled workflow for cross-checked research.
/workflowsThe progress view for running and completed workflows.
UltracodeA session-only setting that uses xhigh effort and automatic workflows.
Accept editsA mode where file edits can be applied without individual edit prompts.
Tool allowlistThe set of commands, web fetches, and MCP tools allowed by your settings.
Managed settingsOrganization-controlled Claude Code settings users cannot override.
Saved workflowA workflow script stored as a reusable slash command.

Official Sources

This post intentionally uses only official Claude, Claude Code, Anthropic-owned, and verified ClaudeDevs sources.

Related: the Opus 4.8 official launch breakdown and the Opus 4.8 API migration guide.

Sponsored AI assistant. Recommendations may be paid.