Appearance
Dynamic 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 while your session stays responsive. Use workflows when a task needs more agents than one conversation can coordinate, a codebase-wide bug sweep, a 500-file migration, or a research question that needs sources cross-checked.

What you'll learn
- Workflows move the orchestration plan into code, the script holds the loop, branching, and intermediate results
ultracodekeyword triggers a workflow;/effort ultracodemakes Claude write one for every substantive task- The bundled
/deep-researchworkflow fans out web searches, cross-checks sources, and returns a cited report
The problem
Subagents handle a few delegated tasks per turn. But some tasks need dozens of agents working simultaneously, auditing 500 files, cross-checking 20 sources against each other, or generating a plan from five independent angles. Subagents flood your context. Workflows keep the orchestration in a script and return only the final answer.
Options & when to use each
| Tool | Scale | Orchestrator | Repeatable |
|---|---|---|---|
| Subagents | A few per turn | Claude, turn by turn | Worker definitions |
| Agent teams | Handful of peers | Lead agent | Team definitions |
| Workflows | Dozens to hundreds | JavaScript script | Full orchestration is replayable |
Build it
Step 1: Run a bundled workflow
You can invoke predefined workflows directly from the CLI using the slash command syntax. The /deep-research workflow, for example, orchestrates parallel web searches and source cross-checking to synthesize a comprehensive report.
bash
claude
# /deep-research What changed in the Node.js permission model between v20 and v22?Claude Code runs agents through web search, source fetching, cross-checking, and synthesis. Watch progress with /workflows.
Step 2: Trigger a workflow with ultracode
ultracode: audit every API endpoint under src/routes/ for missing auth checksThe keyword tells Claude to write a workflow script instead of working turn by turn. Or set it globally:
/effort ultracodeNow Claude writes a workflow for every substantive task.
Step 3: Watch workflow progress
Use the /workflows command to monitor background tasks in real time. This interactive dashboard displays active phases, agent token consumption, and provides controls to pause or terminate execution.
bash
/workflowsThe view shows each phase with agent counts, token totals, and elapsed time. Controls:
| Key | Action |
|---|---|
| Enter / → | Drill into phase, then into agent |
| Esc / ← | Back out |
| p | Pause/resume |
| x | Stop agent or workflow |
| s | Save script as a command |
Step 4: Save a workflow as a reusable command
After a successful run, press s in the workflow view. The script saves as a command you can invoke with /command-name.
Step 5: Set a size guideline
Open /config and set "Dynamic workflow size" to small (fewer than 5 agents), medium (fewer than 15), large (fewer than 50), or unrestricted (default).
What goes wrong
| Mistake | How you notice it | The fix |
|---|---|---|
| ultracode keyword not triggering | Prompt runs as normal, no workflow starts | The keyword only works on typed prompts in interactive sessions, not -p mode, not CI, not scheduled tasks. Use "use a workflow" phrasing |
| Workflow exceeds rate limits | Agents start getting 429 errors | Reduce the size guideline in /config, or set --max-budget-usd |
| Workflow agents all use the expensive model | Cost is higher than expected | Set CLAUDE_CODE_SUBAGENT_MODEL to haiku for cheaper agents, or specify model in the task description |
Confirm it worked
Launch Claude Code and initiate a small workflow to observe the orchestration in action. Monitor the job via the /workflows interface and wait for the synthesized report to ensure all agents completed their tasks.
bash
# 1. Start Claude Code
claude
# 2. Run a small workflow
# /deep-research What are the key features of Claude Code v2?
# 3. Watch progress with /workflows
# Press Enter on the run to see phases and agents
# 4. When it finishes, you should see a cited reportNext: Agent SDK