Claude Code Dynamic Workflows

Claude Code dynamic workflows, Cybrec blog cover
Author

Author

Piotr Kaluzny

Head Instructor

Nov 16, 2026

Some jobs are too big for one agent working step by step: reviewing every module of a project, migrating hundreds of files, or checking a question against many sources. Claude Code dynamic workflows split a job like that across many subagents, and the plan for the whole job lives in a script that Claude writes for you. You describe the task in one prompt, approve the plan, and watch the agents work in the background while your session stays free.

What a dynamic workflow is

A dynamic workflow is a short JavaScript program that says which agents to start, what each one gets as its task, which ones run side by side, and what happens to their results. Claude writes the script, and a runtime inside Claude Code runs it in the background, separately from your conversation. You don't need to read or write JavaScript to use it.

The difference from ordinary subagents is who holds the plan. With subagents, Claude decides turn by turn which one to start next, and every report lands in Claude's context window. To merge ten reviews, Claude has to read all ten. In a workflow, an agent's report goes back to the script, which keeps it in a variable and can hand it to the next agent. Only what the script returns at the end comes back to Claude, so the context stays small however many agents run.

In the run shown in this post, one prompt produced nine reviewers, one for each module of a small Python project, followed by a merge phase that turned their reports into one ranked list. Claude only received that list.

When a workflow fits

A workflow costs more than a normal conversation, so it should earn its place. It fits in three situations:

  • The same job runs on many files or items, such as one reviewer per module or one migration per component.
  • You want findings checked before you see them. Because the plan is code, a second set of agents can try to disprove each finding of the first set, and only what survives reaches you.
  • You will run the process again, like a review before every release. A saved workflow runs the same orchestration every time.

If none of these apply and the task is a couple of side jobs, let Claude delegate to subagents as usual. To see a workflow without writing a prompt for one, run /deep-research followed by a question. It's the workflow that comes with Claude Code: it searches the web from several angles, cross-checks the sources, and returns one cited report.

Turn workflows on and set the size

Dynamic workflows are available on all paid plans and with API access. On the Pro plan they are off until you turn them on: run /config and switch on the Dynamic workflows row. On the other plans they are already on.

The Dynamic workflow size row in /config sets a size guideline, which tells Claude how many agents to aim for when it writes a workflow:

  • small: fewer than 5 agents
  • medium: fewer than 10 agents
  • large: fewer than 50 agents
  • unrestricted: no guideline, Claude sizes the workflow to the task

The default is small on Pro and medium on the other plans. It's advice to Claude, not a cap, so your prompt wins. We asked for one reviewer per module with the guideline at small, and Claude wrote a reviewer for every module anyway and told us it was going past the guideline because the prompt asked for it.

The runtime has hard limits of its own, whatever the guideline says: up to 16 agents run at the same time by default, fewer on a machine with fewer processors, and one run can start at most 1,000 agents.

Start a workflow

Ask for a workflow in your prompt, in plain words. This is a shortened version of the prompt from our test run:

Use a workflow to review the code in rule_audit/ for bugs and design problems, one reviewer per module, then merge the findings into one ranked list. Don't change any files.

You can also include the keyword ultracode anywhere in a prompt you type. Claude Code highlights it, and it means the same thing: this task runs as a workflow. If you typed it by accident, Alt+W (Option+W on macOS) dismisses the highlight for that prompt.

ultracode: audit every route handler under src/routes/ for missing authentication checks

Before the run starts, Claude Code shows the planned phases and asks you to approve them:

  • Yes, run it starts the run.
  • View raw script shows the code first, so you can see exactly which agents will start and with what instructions.
  • No cancels it.

Ctrl+G opens the script in your editor.

Claude Code dynamic workflows approval prompt with the planned phases

How often you see this prompt depends on the permission mode. In auto mode, Claude Code asks only before your first workflow, and later runs start without asking. In manual mode, it asks before every run.

There is also /effort ultracode, which makes Claude plan a workflow for every substantive task in the session, without waiting for you to ask. Every request then uses more tokens, so on a subscription you reach your limits sooner. Turn it off with /effort ultracode off when you go back to routine work.

Watch and control the run

The run works in the background, and a one-line progress summary appears below the prompt. For the details, run /workflows. It opens the progress view: the phases first, each with its agent count.

Claude Code workflows progress view with phases and agents

The footer shows the keys for whatever is selected. These are the ones you will use most:

  • Enter opens the selected phase, then an agent's details: its prompt, its recent tool calls, and its result. Esc goes back one level.
  • p pauses the whole run, and p again resumes it.
  • x stops the selected agent, or the whole workflow when the run itself is selected.
  • r restarts an agent that is still running, for example one that seems stuck.
  • f filters the agent list by status.
  • s saves the run's script as a command.

One finding from our test: press p both times on the phases list. We paused there, then pressed the second p inside an agent's details, and the run stayed paused when we left the view.

A stopped run isn't lost. In the same session, ask Claude to relaunch the workflow, and the agents that had already finished return their saved results instead of running again. A run can't ask you questions halfway through, though: it only stops on its own for an agent's permission prompt or to wait for a usage limit to reset. If you want to sign off between stages, run each stage as its own workflow.

What a run costs

Many agents use many tokens. Every agent sends its own requests, and all of them count toward your plan's usage limits. The agents run on the model your session uses unless the script names a different one for a stage, so check /model before a large run. You can also ask Claude to use a smaller model for the stages that don't need the strongest one.

Claude Code flags a run that grows big. When a workflow schedules more than 25 agents, or its projected total passes 1.5 million tokens, the progress line shows a "Large workflow" warning. The warning doesn't stop anything. It points you to /workflows, where you can stop the run, and where each agent's token usage is listed while it works. If you chose a size guideline yourself, its agent count replaces the 25.

If a run hits the usage limit of your Claude subscription in an interactive session, it pauses instead of failing: the agents that hit the limit wait for the reset and then continue on their own.

For a new workflow, try it on a small part first: one folder instead of the whole project, or a narrow question instead of a broad one. You see the shape of the run and what it costs before you commit to the full job. For scale, in one of our test runs of this review, nine agents worked for 1 minute 14 seconds and returned 15 ranked findings, without changing a file.

Save a workflow as a command

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

  • .claude/workflows/ in the project, shared with everyone who clones the repository.
  • ~/.claude/workflows/ in your home folder, available in all your projects but only to you.

Enter saves it. From then on, the workflow is a command named after it, for example /review-rule-audit, and it appears in the slash-command list. You can give it input in the same line, such as "Run /review-rule-audit on cli.py only". When you run a saved workflow, the approval prompt also offers Yes, and don't ask again for that workflow in that project. If a project workflow and a personal one share a name, the project one runs.

To change a saved workflow, edit its file or ask Claude to, then run /reload-skills so the session picks up the new version.

One more finding: Claude can pick a saved workflow on its own when a request matches it. After we saved the review workflow, we asked the same project for a review by an agent team, and Claude started the saved workflow instead. If you want a different approach for a similar task, say so in the prompt, or work in a folder without the saved file.

Conclusion

Claude Code dynamic workflows move the plan for a large job out of the conversation and into a script: Claude writes it, a runtime runs the agents in the background, and only the final result comes back. Turn the feature on in /config if you are on Pro, ask for a workflow in plain words, read the phases before you approve, and use /workflows to watch, pause, stop, and save the run. Start small, because every agent counts toward your usage.

Relevant Training

Dynamic workflows are covered in Supervising Claude Code Agents, part of Cybrec's Claude AI training program, together with goals, steering and rewinding a running agent, and agent teams.

0 Comments

Claude Code dynamic workflows, Cybrec blog cover
Author

Author

Piotr Kaluzny

Head Instructor

Nov 16, 2026