Dynamic workflows orchestrate many subagents from a script Claude writes and you can rerun. Use them for codebase audits, large migrations, and cross-checked research.
Get Started with WorkflowsSubagents, skills, agent teams, and workflows can all run a multi-step task. The difference is who holds the plan. Workflows move the plan into code.
The quickest way to see a workflow in action is to run /deep-research, the built-in workflow Claude Code includes for investigating a question across many sources.
Run /deep-research with a question you want investigated. It fans out web searches across several angles, fetches and cross-checks the sources it finds, and synthesizes a cited report.
Claude Code asks whether to allow the workflow. Select Yes to continue. The exact prompt depends on your permission mode.
The run starts in the background. Run /workflows, use the arrow keys to select the run, and press Enter to open its progress view.
When the run finishes, the report lands in your session. It cites the sources each claim came from, with claims that didn't survive cross-checking already filtered out.
You can have Claude write a workflow for your task in two ways, or run one you've already saved.
Include the word workflow anywhere in your prompt. Claude writes a workflow script for the task instead of working through it turn by turn. Press Option+W (macOS) or Alt+W (Windows/Linux) to dismiss the trigger for a single prompt.
Set /effort ultracode and Claude plans a workflow for each substantive task. Ultracode combines xhigh reasoning effort with automatic workflow orchestration. It lasts for the current session and resets when you start a new one.
When a run does what you wanted, press s in the /workflows view to save it as a command. Save to .claude/workflows/ in your project (shared with the team) or ~/.claude/workflows/ (personal use).
Workflows run in the background so your session stays responsive. Run /workflows at any time to list running and completed workflows.
| Key | Action |
|---|---|
| ↑ / ↓ | Select a phase or agent |
| Enter or → | Drill into the selected phase, then into an agent |
| Esc | Back out one level |
| p | Pause or resume the run |
| x | Stop the selected agent or the whole workflow |
| r | Restart the selected running agent |
| s | Save the run's script as a command |
The workflow runtime executes the script in an isolated environment, separate from your conversation. Intermediate results stay in script variables instead of landing in Claude's context.
Only agent permission prompts can pause a run. For sign-off between stages, run each stage as its own workflow.
Agents read, write, and run commands. The script coordinates the agents — it does not access files or the shell directly.
Fewer on machines with limited CPU cores. This bounds local resource use.
Total agent cap per run prevents runaway loops.
Whether you see a confirmation prompt depends on your permission mode.
| Permission Mode | When You're Prompted |
|---|---|
| Default, accept edits | Every run, unless you've selected "Yes, and don't ask again" for that workflow in this project. |
| Auto | First launch only. Any "Yes" records consent in your user settings. Skipped when ultracode is on. |
Bypass permissions, claude -p, Agent SDK | Never. The run starts immediately. |
Toggle dynamic workflows off in /config, set "disableWorkflows": true in settings, or use the admin settings page for your organization.
Quick answers to the most common questions about Claude Code workflows.
A dynamic workflow is a JavaScript script that orchestrates subagents at scale. Claude writes the script for the task you describe, and a runtime executes it in the background.
Codebase-wide bug sweeps, 500-file migrations, research questions that need cross-checked sources, and plans worth drafting from several independent angles before committing.
Run /deep-research with a question. It fans out web searches, cross-checks sources, and returns a cited report.
Yes. From the /workflows view, select the run and press s to save it as a reusable command.
Up to 16 concurrent agents and 1,000 total agents per run.
Yes. Resume from /workflows by selecting it and pressing p. Cached results are reused for completed agents.
Toggle Dynamic workflows off in /config, or set "disableWorkflows": true in your settings.
Workflows move the plan into code. With subagents, Claude decides turn by turn. With workflows, the script holds the loop, branching, and intermediate results.
Dig deeper into multi-agent orchestration with Claude Code.