When Claude Code dynamic workflows pay off on client sites

Use dynamic workflows when the job is wide and independently checkable, and skip them everywhere else. That’s my short answer after reading Chien Vu Minh’s writeup on Towards Data Science, which pushed Claude Code’s new multi-agent mode through the same audit four different ways and published the token counts. Two of his results changed how I’d plan this on client work: the specificity of your prompt matters more than which model runs the agents, and the cheapest model is rarely the cheapest run.

The mechanics first. A dynamic workflow is a JavaScript script Claude writes on the spot to orchestrate subagents, and a separate runtime runs it in the background while your session stays free. Loops, branches, and intermediate results live in script variables, and only the merged answer comes back to you. Anthropic’s framing is that one context window fails three ways on a big job: agentic laziness, where the agent stops early and reports the task done; self-preferential bias, where it grades its own work generously; and goal drift, where it forgets an instruction from an hour ago. If you’ve run long sessions on client code, you’ve met all three.

How to trigger one

You need a paid plan and Opus 4.8, since the orchestrator writes the harness itself. Put the word workflow in your prompt, or run /effort ultracode and let Claude decide per task. The official docs cover the caps and the save locations, .claude/workflows/ for the project and ~/.claude/workflows/ for yourself. Keep ultracode off for client work: it plans a workflow for every substantive task in the session and the bill follows. Watch a run with /workflows, which shows each agent, its model, and its token spend.

Where dynamic workflows fit WordPress work

Most client sites are wide rather than deep. A parent theme, a child theme, some mu-plugins, WooCommerce template overrides, and thirty plugins are a lot of parallel surface with almost no shared state. That’s the shape this feature wants, and it’s also why running parallel Claude sessions against a client repo pays off in the first place. Split finders by dimension: capability checks on admin pages and REST routes, output escaping, nonces on form handlers, direct file access guards, template overrides that drifted from the current WooCommerce version. Each finder reads its slice in a fresh context, verifier agents try to refute each finding, and a synthesizer ranks what survives. A hard bug in one filter chain is the opposite case, deep rather than wide, and a single session is the better tool there.

Run it in two passes

The most practical habit in the source article is asking for the script before anything runs. One extra sentence in the prompt does it: write the workflow and give me the link to access and revise it before running. Claude stops and hands you a readable file. The finder scopes are objects with a prompt string each, so scoping means editing a few lines instead of wrestling with prose.

{
  key: 'capability-checks',
  prompt: `Audit registered admin pages and REST routes in this plugin for missing current_user_can() checks. Read includes/admin and includes/rest. Ignore the webhook endpoint, it is authenticated by signature.`,
}

You know things the workflow can’t infer: wp-content/plugins is vendor code you don’t audit, the nonce check on that endpoint is deliberately absent because the webhook signs its requests, and the host already handles caching so transient findings are noise. Put that in the finder prompts, like the ignore line above. In the article, this editing pass cut the run to six finders that returned 44 candidates and confirmed 40 issues. The run used 51 agents and about 1.66 million tokens.

If you have a plugin-heavy client site and want this kind of adversarial audit scoped to what the site actually faces rather than everything Claude can find, that’s work I take on.

The model economics don’t work like you’d guess

The first run in the article put Opus 4.8 on every agent, six finders at roughly 50k tokens each plus about fifty verifiers, and the author watched the budget drain. He then moved the workers to a mid-tier model and kept Opus for orchestration and synthesis. That held the cost down and confirmed more issues. The surprise was Haiku. It costs roughly a third of Sonnet per token, but it needed about 1.5 times the tokens to do the same work because it re-read context on extra turns, so the two effects nearly cancel and the run landed near the same price. The cheapest model per token wasn’t the cheapest per finding.

The consistency result matters more for us. With a broad audit prompt, the Haiku and Sonnet runs disagreed on two findings, and Haiku was right both times. With a narrow prompt naming its angles (secrets, auth, injection, dependencies, data handling), all three issues the Haiku run confirmed also appeared in the Sonnet run. Everything else was the same, so the prompt’s specificity was the difference between noise and something you can hand to a client.

When a workflow is the wrong tool

The honest comparison is against a single agent doing one pass. That found 47 issues to the workflow’s 44, on a third of the tokens, and shipped two false positives the verifiers would have removed. If you’re willing to read findings yourself and discard the weak ones, one careful session is the economical default, and I’d start there on any single plugin or theme. Pay for the verification layer only when a wrong finding is expensive: a security report going to a client, a migration plan you’re about to execute. And remember the output is a ranked report rather than applied changes. You still review before any code moves. I haven’t tested this on a multisite where plugins are shared across sites, so I can’t say how the scoping holds up there.

This week I’d run one workflow: a narrow security audit of the oldest plugin in the client’s stack, finders on a mid-tier model, Opus on synthesis, scopes trimmed to the site’s real surface. If it returns a short verified list, that goes to the client as the audit. If it comes back noisy, one careful session is still the better deal.

author avatar
Ahmad Wael
I'm a WordPress and WooCommerce developer with 15+ years of experience building custom e-commerce solutions and plugins. I specialize in PHP development, following WordPress coding standards to deliver clean, maintainable code. Currently, I'm exploring AI and e-commerce by building multi-agent systems and SaaS products that integrate technologies like Google Gemini API with WordPress platforms, approaching every project with a commitment to performance, security, and exceptional user experience.

Leave a Comment