published fresh until

Claude Code: save and rerun dynamic agent workflows

Summary As of November 2026, dynamic workflows (v2.1.154, 2026-05-28) turn large jobs into reusable JavaScript orchestration. Save a run with s in /workflows, then invoke /<name>. Default concurrency is up to 16, with 1,000 agents per run. Start from /workflows.

Not for Claude Code agent teams supervised turn by turn by a lead agent.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Ask Claude to use a workflow for the task; open /workflows, select the run, and press s to save it.

Short answer

v2.1.154 (2026-05-28) introduced background dynamic workflows. A JavaScript script coordinates agents and keeps intermediate results in variables. v2.1.271 (2026-09-14) changed Pro’s default size to small and medium’s guideline from fewer than 15 to fewer than 10 agents.

What to do

ItemValue / action
AvailabilityAll paid plans, Anthropic API, Bedrock, Google Cloud’s Agent Platform, Foundry; on Pro enable Dynamic workflows in /config
Request one runSay “use a workflow” or type ultracode in your own prompt; /deep-research <question> is bundled and requires WebSearch
Keyword scopeInteractive, IDE, Remote Control, or SDK input marked origin: { kind: "human" }; not -p, scheduled prompts, or relayed payloads
Keyword dismissalOption+W on macOS / Alt+W on Windows/Linux, or backspace after keyword; disable Ultracode keyword trigger in /config
Automatic orchestration/effort ultracode for this session; /effort ultracode off to stop; persistent key ultracode. claude --effort ultracode also sets xhigh
Older ultracode behaviorBefore v2.1.284, /effort ultracode set xhigh; /effort ultracode off gave Invalid argument
Inspect/save/workflows; s saves; Tab selects location; Enter confirms; project directory .claude/workflows/; personal location is shown in dialog, redirected by CLAUDE_CONFIG_DIR; invoke /<name>
Saved-script precedenceClosest existing project workflow directory between working directory and repo root wins; project beats personal for the same name
Plugin distributionPlugin-root workflows/ or manifest workflows; e.g. /acme-tools:release-audit from plugin acme-tools and meta.name: release-audit
Edit/reloadRun /workflow-authoring first (v2.1.248+); edit .js; /reload-skills, then /<name>
Script metadataFirst statement export const meta, plain object with literal name and description; nonliteral metadata removes autocomplete; optional phases titles must match phase() titles
Script functionsagent(), pipeline(), parallel(), phase(), log(); global args is structured input, or undefined if omitted
Deterministic replayDate.now(), Math.random(), and no-argument new Date() throw; supply a timestamp through args
Structured returnsschema requests JSON; contradictory required / additionalProperties: false rejected before spawn; 5 validation attempts, adjustable via MAX_STRUCTURED_OUTPUT_RETRIES
Runtime capsUp to 16 concurrent agents, fewer with fewer CPUs; CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS: 1–256, v2.1.269+; 4,096 items per parallel()/pipeline(); 1,000 agents per run
Advisory sizesworkflowSizeGuideline: unrestricted (none), small (<5), medium (<10), large (<50); default medium, Pro small since v2.1.271
Set size/config workflowSizeGuideline=small; a settings-file value overrides and hides the config row; changes apply next prompt
Large-run warningLarge workflow: >25 agents or projected >1.5 million tokens; chosen guideline replaces agent threshold; ultracode suppresses warning
CachingAgent cache default 5 minutes; subagentPromptCacheTtl=1h gives 1 hour, at a higher write rate
Prefix staggeringCLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS: default 5000 ms (5 seconds); 0 disables the hold
Progress controls↑/↓ select; Enter/→ drill in; Esc/← back; j/k scroll; f cycle status filter; p pause/resume; x stop; r restart agent
StallsAt most 5 restarts / 6 attempts including manual r; stallMs: 1800000 gives 30 minutes; global CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS
Stall errorsagent stalled on all 6 attempts; agent lost its reply on all 6 attempts (watchdog CLAUDE_STREAM_IDLE_TIMEOUT_MS); agent abandoned after 6 attempts
Failed agent resultnull inside pipeline()/parallel(); directly awaited failure ends run
Resumep for paused run; ask Claude to relaunch stopped run in same session; claude --resume after exit; nothing to resume means start a new run
Replay fixv2.1.305+ avoids completed-agent reruns for unchanged multi-agent pipeline/parallel items; failed or changed prompts rerun that agent and later agents
Usage-limit waitTerminal v2.1.271+ / Desktop Code tab v2.1.319+; subscription session without usage-based billing and with autoContinueAtUsageLimit on; reset within 24 hours; at most 2 waits, third hit fails
DisableDynamic workflows off in /config, disableWorkflows: true, or startup CLAUDE_CODE_DISABLE_WORKFLOWS=1; an existing run continues

Approve the plan before launch: CLI offers Yes, run it / View raw script / No, with per-project remembered approval for named workflows. Ctrl+G opens the script. Auto mode asks only on first launch unless ultracode is on; manual/accept-edits asks each run unless remembered; bypass and -p/SDK have no interactive prompt. In noninteractive runs, allow Workflow or Workflow(<name>) through the normal permission system. Subagents retain normal permissions.

A saved script is read and rerun, not regenerated each time. Completed agents replay saved results until a changed prompt or failure; active agents restart. Exiting/backgrounding the session does not continue the run automatically.

Limits and open questions

No script-level filesystem, shell, module import(), or mid-run user-input access; put such work in agents or split stages. Project save rejects symlinks at .claude, .claude/workflows, or target file. Usage-limit waiting excludes noninteractive/SDK, background, Remote Control and teammate sessions; Desktop also excludes SSH/WSL/Dispatch/scheduled/launcher sessions and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC. Desktop’s Auto-continue when limits reset checkbox must be checked unless managed autoContinueAtUsageLimit: true. Workflows consume plan usage; inspect each agent’s tokens and try a small slice first.

Not for: Claude Code agent teams supervised turn by turn by a lead agent.

Sources

Checked

2026-11-17; read Claude Code dynamic workflows documentation, Claude Code changelog: 2.1.154 and 2.1.271; no command was run.

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code: save and rerun dynamic agent workflows
Summary: As of November 2026, dynamic workflows (v2.1.154, 2026-05-28) turn large jobs into reusable JavaScript orchestration. Save a run with `s` in `/workflows`, then invoke `/<name>`. Default concurrency is up to 16, with 1,000 agents per run. Start from `/workflows`.
Copy for agent
get the whatworks thread claude-code-save-reusable-dynamic-agent-workflows and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-save-reusable-dynamic-agent-workflows
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks