Dynamic Workflows

Dynamic Workflows & Ultracode

Use dynamic workflows and ultracode to orchestrate many subagents through repeatable workflow scripts.

What Dynamic Workflows Are

Dynamic workflows are Claude Code's large-scale orchestration layer. Instead of asking Claude to solve a task turn by turn, Claude writes a workflow script that coordinates many agents, tracks intermediate results outside the main conversation, and returns a final report or result.

Use dynamic workflows when a task needs breadth, cross-checking, or repeatable orchestration:

  • Audit every route, component, migration, or package in a large codebase.
  • Run independent research branches and compare conclusions.
  • Have agents verify each other's findings before reporting them.
  • Turn a repeated multi-agent process into a saved command.

Ultracode

Ultracode is the session-level way to let Claude decide when dynamic workflows are worth using:

text
/effort ultracode

With ultracode on, Claude combines xhigh reasoning effort with automatic workflow orchestration. A single substantive request can become several workflows: one to understand the codebase, one to implement, and one to verify.

Ultracode is powerful, but expensive. It lasts only for the current session. Drop back when the work becomes routine:

text
/effort high

You can also trigger one workflow without changing the whole session by including the keyword:

text
ultracode: audit every API endpoint under src/routes for missing auth checks

Natural requests like "use a workflow" or "run this as a workflow" also opt in.

How Workflows Differ From Subagents and Agent Teams

MechanismOrchestrationCommunicationScaleBest for
SubagentsMain session delegatesReport back to parentA few workersContext isolation
Agent teamsTeam lead and teammatesPeer messagingA few long-running peersLive collaboration
Dynamic workflowsScript runtime coordinates agentsScript aggregates resultsDozens to hundreds per runAudits, research, migrations, cross-checking

The key difference is where the state lives. Subagent and team results flow back into Claude's context. A workflow script keeps intermediate state in variables and gives the main conversation only the useful final result.

Built-In Workflow: /deep-research

Claude Code includes /deep-research as a bundled workflow:

text
/deep-research What changed in the Node.js permission model between v20 and v22?

It fans out research across multiple angles, fetches and cross-checks sources, filters weak claims, and returns a cited report.

Watch and Manage Runs

Workflows run in the background. Use /workflows to inspect them:

text
/workflows

From the workflow view you can inspect phases and agents, stop a run, resume a paused run, watch token usage, or save the script as a command.

Approval and Permissions

Before a workflow starts, Claude Code can show the planned phases and ask for approval. The exact prompt depends on your permission mode.

Important boundaries:

  • In default and acceptEdits, workflow runs usually ask before launch unless previously approved.
  • In auto, first launch records consent; ultracode can skip the launch prompt.
  • In bypassPermissions, claude -p, and Agent SDK contexts, runs start without an interactive launch prompt.
  • Workflow subagents run in acceptEdits mode and inherit your tool allowlist, regardless of your session mode. Add required shell commands, web fetches, and MCP tools before starting long runs.

Save a Workflow for Reuse

If Claude writes a workflow you will repeat, save it from /workflows. Project workflows go under .claude/workflows/; personal workflows go under ~/.claude/workflows/.

Saved workflows become slash commands:

text
/api-auth-audit src/routes

Use saved workflows for repeatable engineering rituals: security sweeps, release readiness checks, migration audits, or cross-package consistency scans.

Limits and Tradeoffs

Dynamic workflows are not just "more agents." They are a different execution model.

  • They use more tokens and time than a normal turn.
  • They are best when the task can be parallelized.
  • They are awkward when the task requires frequent human judgment mid-run.
  • The workflow script coordinates; agents do the file and shell work.
  • A single run can use up to 16 concurrent agents and up to 1,000 total agents.
  • Runs are resumable within the same session, but they are still heavier than ordinary subagents.

When to Use What

SituationUse
"Search this package and report findings"Subagent
"Coordinate frontend and backend work with peer discussion"Agent team
"Audit hundreds of files with independent verification"Dynamic workflow
"Make every substantive task choose its own orchestration"Ultracode
"Repeat this orchestration every week"Saved workflow or routine

Official References

Continue with practice

You have finished the core ideas of Dynamic Workflows & Ultracode.

If you want to turn the idea into something reusable, continue practicing on AgentWay.