Home › Rules › Claude Code workflows

Claude Code workflows: /deep-research, running and saving dynamic workflows, and what they cost

From Anthropic's own Claude Code docs (Dynamic workflows, Run agents in parallel, Skills, Subagents, Commands, Manage costs, Settings reference, Environment variables, Model configuration, Hooks), checked Nov 13, 2026. Sources below.

Short answer: a Claude Code dynamic workflow is a JavaScript file, written by Claude, that coordinates many subagents in parallel in the background, while your session stays free. The script holds the plan and the in-between results, so only the final answer comes back into your chat. Try one with the built-in /deep-research, start your own by typing ultracode or "use a workflow" in a prompt, watch it with /workflows, and press s there to save a run as your own /command. Anthropic's warning: "a single run can use meaningfully more tokens than working through the same task in conversation." So try a small slice first.

Which "workflow" do you mean?

Three things in Claude Code are called workflows:

Dynamic workflows are on every paid plan, with Anthropic API access, and on Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry. On the Pro plan they're off until you turn on the Dynamic workflows row in /config.

Start with /deep-research

/deep-research is the one workflow that ships with Claude Code. Give it a question and it searches the web from several angles, fetches and cross-checks the sources, votes on each claim, and hands back one report with citations. Claims that didn't hold up are already filtered out. Claims its checkers couldn't verify (after a rate limit, say) are marked unverified, not wrong. It needs the WebSearch tool.

  1. Type /deep-research and your question, for example /deep-research what changed in the Node.js permission model between v20 and v22? (Anthropic's example).
  2. Claude Code asks whether to allow the workflow. Pick Yes.
  3. It runs in the background. Type /workflows to watch it.
  4. The report shows up in your session when it's done.
The workflow commands, from Anthropic's docs
/deep-research <question>        # the bundled research workflow
/workflows                       # list runs, open one to watch, pause, stop or save it
/effort ultracode                # Claude plans a workflow for each big task (this session)
/effort ultracode off            # back to normal
/config workflowSizeGuideline=small
/workflow-authoring              # load the script reference before you edit a saved workflow
/reload-skills                   # re-read the workflow folders after an edit
claude --effort ultracode        # start a session at xhigh with ultracode on

The /workflows screen

Arrow keys and Enter open a phase or an agent (its prompt, tool calls and result), and Esc backs out. p pauses or resumes, x stops the selected agent or the whole run, r restarts a running agent, f filters by status, and s saves the run as a command. It also shows each agent's token use as it goes.

Three ways to start your own workflow

The keyword only counts in a prompt you type yourself, not in a claude -p prompt, a scheduled task, or a webhook or pull request comment passed into the chat. To type the word without starting anything, turn off Ultracode keyword trigger in /config (the workflowKeywordTriggerEnabled setting).

Anthropic's example prompts show the shapes that fit: audit many files for one problem, fix until a check passes, migrate many files in parallel, review every changed file into one summary, and research across many sources. Three of ours in the same style:

Our example (VibeKits): three workflow prompts
ultracode: check every page under src/pages/ for images with no alt text, and verify each finding before reporting it

use a workflow to read every rules file in this repo (CLAUDE.md, AGENTS.md and .cursor/rules/) and list the instructions that contradict each other

use a workflow to run npm test and fix the failing test files one at a time, using a smaller model for the first pass, and stop when two rounds in a row make no progress

Approving a workflow before it runs

In the terminal, the approval prompt lists the planned phases and gives you Yes, run it, View raw script, No, and, for a bundled, saved or plugin workflow you ran by name, Yes, and don't ask again for that workflow in that project. Ctrl+G opens the script in your editor. Whether you see the prompt at all depends on your permission mode:

Permission modeWhen Claude Code asks
Manual, accept editsEvery run, unless you picked "don't ask again" for that saved workflow
AutoThe first launch only (any Yes is remembered in your user settings); never while ultracode is on
Bypass permissionsNever. The run starts right away
claude -p, Agent SDKNever shows the prompt. The launch goes through your normal permission rules instead

So in a claude -p script, a workflow won't start unless something allows it: an allow rule (Workflow for all, or Workflow(name) for one saved workflow), auto or bypass mode, a PreToolUse hook that returns allow (not enough on its own in plan mode), or your host's approval. The Desktop app shows a card with the phases, a token-use caution and Once, Always or Deny.

Approving the workflow doesn't approve what its agents do. They follow your normal permission rules, so before a long run, allow the tools the agents need or the run can sit paused on a prompt.

Saving a workflow as your own command

When a run did what you wanted, open /workflows, pick the run and press s. Tab switches between two places to save it:

From then on it runs as /name and shows in / autocomplete next to /deep-research. A saved workflow can take input: "Run /triage-issues on issues 1024, 1025, and 1030" (Anthropic's example) passes the list to the script as a global named args.

What a saved workflow file looks like

You don't have to write these, but it helps to read one before you approve it. Here is our own small workflow in Anthropic's documented format: a meta block first, then plain JavaScript. agent() starts one subagent, pipeline() runs one per item in a list, phase() groups what follows under a title in the progress view, and log() prints a line above the phases.

Our example (VibeKits): a workflow that checks your rules files for dead commands
export const meta = {
  name: 'check-rules-files',
  description: 'Check every CLAUDE.md and AGENTS.md for commands and paths that no longer exist',
}

const root = typeof args === 'string' ? args : '.'

phase('Find the files')
const found = await agent(`List every CLAUDE.md and AGENTS.md under ${root}. Skip node_modules.`, {
  schema: { type: 'object', required: ['files'], properties: { files: { type: 'array', items: { type: 'string' } } } },
})

phase('Check each file')
const reports = await pipeline(found.files, file =>
  agent(`Read ${file}. For each command it mentions, check it exists in package.json scripts or the Makefile. For each file path, check it exists. List only the wrong ones with their line. Don't edit any files.`, { label: file }),
)

phase('One list')
log(`Checked ${found.files.length} files`)
const summary = await agent(`Merge these findings into one list, most serious first, and drop duplicates:\n\n${reports.filter(Boolean).join('\n\n')}`)
return summary

What it does: one agent lists the rules files, one agent per file checks its commands and paths, and a last agent merges the findings. Run it as /check-rules-files (or add a folder name; if Claude doesn't pass it as plain text, the script checks the whole repo). The schema makes the first agent return JSON. .filter(Boolean) drops the empty results from agents that were stopped, hit an API error or stalled every time.

The rules Claude Code enforces on these files:

And a settings file to go with it:

Our example (VibeKits): small workflows, and our saved one allowed in claude -p
{
  "workflowSizeGuideline": "small",
  "permissions": {
    "allow": ["Workflow(check-rules-files)"]
  }
}

"small" asks Claude for fewer than 5 agents per workflow. The allow rule lets only our saved workflow start in claude -p and Agent SDK runs.

Workflows vs skills vs subagents vs agent teams vs hooks

The first four columns are Anthropic's own comparison, shortened. We added the hooks column from Anthropic's Hooks guide because people mix them up too ("n/a" where the docs don't say).

WorkflowsSkillsSubagentsAgent teamsHooks (ours)
What it isA script the runtime runsInstructions Claude followsA worker Claude startsA lead agent running other sessionsYour shell command at set points
Who decides the next stepThe scriptClaude, following the skillClaude, turn by turnThe lead agentNobody: it always runs when its event fires
Where results goScript variables; only the answer reaches your chatYour chat's contextYour chat's contextA shared task listn/a
ScaleDozens to hundreds of agentsSame as subagentsA few per turnA handful of long-running peersn/a
If interruptedCan resume in the same sessionRestarts the turnRestarts the turnTeammates keep goingn/a
Use it forAudits, migrations, cross-checked researchA procedure you keep pastingA side job that would flood your chatSplitting a project across workersThings that must happen every time: format, block, notify

Workflows vs skills in one line: a skill tells Claude how to do a job and Claude stays in charge; a workflow moves the plan into code so many agents can run it and check each other. Anthropic says you can point Claude at a skill that fans work out and ask for a workflow that does the same. Copy-paste starting points: Claude Code skills examples, subagents examples and hooks examples. Agent teams are experimental and off by default; how to turn them on and what they cost: Claude Code agent teams. Background sessions, agent view and worktrees: Claude Code multi-agent setup.

Matching kit: MVP Spec-to-Build Pack ($7)

The free rules set the boundaries. The MVP pack gives you the build order: a 1-page spec to fill in first, then 7 prompts in sequence (skeleton, review, login, database, security, one feature at a time, polish), plus a "did I leak user data?" checklist.

See the MVP Spec-to-Build Pack ($7) →

Instant download. 7-day refund, no questions asked.

What workflows cost, in Anthropic's words

"A workflow spawns many agents, so a single run can use meaningfully more tokens than working through the same task in conversation. Runs count toward your plan's usage and rate limits." Every agent sends its own requests on top of your main chat. What the docs suggest:

workflowSizeGuidelineAgents Claude aims for
smallFewer than 5. The default on Pro (Claude Code v2.1.271 or later)
mediumFewer than 10. The default on other plans
largeFewer than 50
unrestrictedNo guideline; Claude sizes it to the task

Set it in /config or a settings file (the file wins). A run that plans more than 25 agents, or more than 1.5 million tokens, shows a Large workflow warning on its progress line; if you picked a size yourself, its agent count replaces the 25. The warning doesn't stop anything. Hard limits: 16 agents at once by default (CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS, 1 to 256, v2.1.269 or later), 4,096 items per pipeline() or parallel() call, and 1,000 agents per run.

Hitting your limit mid-run: in an interactive terminal session on a claude.ai subscription without usage-based billing (v2.1.271 or later), the run pauses and carries on after the reset, if autoContinueAtUsageLimit is on, the reset is within 24 hours and it hasn't already waited twice. Otherwise, as in claude -p, the agents fail; ask Claude to relaunch after the reset.

Workflows, effort and ultracode

Turn workflows off and ultracode goes too; it also needs a model with xhigh effort. While it's on, the Large workflow warning doesn't show, the session's 20-subagent limit isn't enforced, and auto mode skips the first-launch approval. Anthropic says a session with it on "reaches a session or weekly limit sooner than the same work with it off", so use /effort ultracode off when you're back to small jobs. Workflow agents with the same model, effort level, agent type, tools, output schema and folder can share a prompt cache. Every level and setting is on Claude Code effort levels.

Stopping, pausing and resuming

Press p in /workflows to pause and again to resume. For a stopped run, ask Claude to relaunch the workflow with the same script. Finished agents return saved results, but a failed agent reruns along with every agent started after it, and stopping one agent with x counts as failing. If you exit Claude Code mid-run, the run doesn't continue by itself: resume the session with claude --resume and ask Claude to relaunch it. In a fresh session Claude has no earlier run, so it starts over. If a relaunch fails with nothing to resume, ask Claude to start the workflow over as a new run.

Turning workflows off

For yourself: switch off Dynamic workflows in /config, or set CLAUDE_CODE_DISABLE_WORKFLOWS=1. For a whole company: "disableWorkflows": true in managed settings or the toggle on the Claude Code admin settings page. With them off, /workflows, workflow commands and /workflow-authoring disappear, the keyword stops working, and ultracode leaves the /effort slider. A run already going keeps going.

Workflow problems: 8 things to check

  1. /workflows or /deep-research isn't there. On Pro, turn on Dynamic workflows in /config; otherwise a setting, the environment variable or your admin turned them off. disableBundledSkills (or CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1) also removes the bundled workflows, and claude --safe-mode loads no workflows.
  2. /deep-research can't search. It needs the WebSearch tool to be available in your session.
  3. You typed ultracode and nothing happened. The prompt came through claude -p, a scheduled task or a webhook, or the keyword trigger is off in /config.
  4. A workflow started that you didn't want. Alt+W (Option+W) dismisses the keyword before you send; at the prompt pick No; once running, x in /workflows stops it.
  5. Your saved workflow isn't in / autocomplete. meta isn't the first statement or holds something other than plain values. Fix it and run /reload-skills. A workflow named anthropic-skills (or inside that namespace) never loads; that name is reserved.
  6. The script throws right away. It calls Date.now(), Math.random() or new Date(), or has an import(). Pass values in through args and move library work into an agent's task.
  7. A claude -p run never starts its workflow, or a long run sits waiting. Add a Workflow or Workflow(name) allow rule for the launch, and allow the tools the agents need before you start.
  8. An agent shows (retry 1) or fails with "stalled on all 6 attempts". Give it more time with stallMs on that agent() call, or CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS for all. "Lost its reply on all 6 attempts" is a different timeout: CLAUDE_STREAM_IDLE_TIMEOUT_MS.

Where Anthropic's own pages don't agree

Related setups

Workflows sit on top of the rest of a Claude Code setup. Put your project rules in CLAUDE.md, save step-by-step jobs as skills, hand off single side jobs with subagents, pick the model on Claude Code models, and set how hard Claude thinks on effort levels. Need a starting rules file? The free rules generator writes one.

Next step for Claude Code: Agent Skills

Skills are folders your AI coding agent loads only when the job comes up, and Claude Code, Cursor and OpenAI Codex all read the same SKILL.md format. The Vibe Coder Skills Pack ($9) is 6 ready-to-copy SKILL.md skills (fix-one-bug, stop-the-loop, leak-check, ship-check, explain-project, builder-handoff) for Claude Code, Cursor and OpenAI Codex. Also included in the 6-kit bundle.

Get the Skills Pack for $9 on Gumroad → See what's inside

One .zip of skill folders plus one markdown file. 7-day refund, no questions asked.

Best value

All 6 kits for $29 — or $20.30 with code WELCOME30 (through Nov 30)

A workflow runs many agents on a plan Claude writes for one job. The kits give your AI the plan for a whole project, step by step: a small game, a Discord bot, an email-triage agent, an MVP, or a cleanup of messy code.

Get all 6 kits for $29 → See what's in each kit

$29 instead of $48 for the six kits bought separately; WELCOME30 takes 30% off that at checkout ($20.30). Instant download from Gumroad. 7-day refund, no questions asked.

Related

Sources

Every command, setting, limit and version number here was checked Nov 13, 2026 on Anthropic's own Claude Code docs. Workflows change often (Claude Code ships new versions most days), so run claude --version and check the Workflows page if something looks different. If something here no longer matches, tell us at [email protected].

Free rules starter pack for Cursor, Claude Code, Codex and Antigravity

One shared AGENTS.md that works across Cursor, Claude Code, Codex, Copilot and Antigravity, plus database and test rules in each tool's format. Unzip it into your project and fill in two sections. I'll email you the link.

After that, an occasional email when I publish a new guide or rules file.

Free. No spam. Unsubscribe anytime. See our privacy note.