With subagents, Claude is the orchestrator: it decides turn by turn what to spawn next, and every result lands in its context. That works for a few delegated tasks. It strains when a job needs fifty agents, or when you want findings checked against each other rather than taken on trust.
A dynamic workflow moves the plan into code. Claude writes a JavaScript script for your task, and a runtime executes it in the background while your session stays responsive. The script holds the loop, the branching and the intermediate results in its own variables, so Claude’s context receives only the final answer.
What the script looks like
export const meta = { name: 'audit-routes', description: 'Check each route for an auth check' }
const list = { type: 'object', properties: { files: { type: 'array', items: { type: 'string' } } } }
const found = await agent('List the route files under src/routes/.', { schema: list })
const audits = await pipeline(found.files, (file) => agent(`Does ${file} check auth?`))
return audits.filter(Boolean)agent() spawns one subagent, pipeline() runs one per item in a list, and parallel() runs a set at once. Because the orchestration is code, it can apply a quality pattern, such as having independent agents adversarially review each other’s findings before anything is reported.
How you start one
Ask for it (“use a workflow to…”), or put the keyword ultracode in your prompt. /effort ultracode goes further: Claude plans a workflow for every substantive task in the session. To see one first, run the bundled /deep-research <question>. Before a run starts, Claude Code shows its planned phases for approval (how often depends on your permission mode).
/workflows lists runs and opens a progress view of each phase and agent. Press s there to save a run’s script to .claude/workflows/ (shared with the repo) or ~/.claude/workflows/ (just you), and it runs as /<name> from then on, like a skill that holds a process instead of instructions.
The catch
Cost. A run spawns many agents and can use far more tokens than doing the task in conversation. Try it on one directory before the whole repo; Claude Code flags a Large workflow past 25 agents or a projected 1.5 million tokens.
Limits. No input from you mid-run, and the script itself can’t touch files or the shell; its agents do that, under your usual permission rules. Up to 16 agents run at once by default, and 1,000 per run. A stopped run can be resumed in the same session.
Workflows are on for paid plans; on Pro, switch them on under Dynamic workflows in /config.