Login
Back to Blog
Claude Code Dynamic Workflows, Rebuilt: A Practical Ultracode-Style Orchestration Template

Claude Code Dynamic Workflows, Rebuilt: A Practical Ultracode-Style Orchestration Template

C
Crazyrouter Team
June 3, 2026
2 viewsEnglishAI Coding
Share:

Claude Code Dynamic Workflows, Rebuilt: A Practical Ultracode-Style Orchestration Template#

Claude Code Dynamic Workflows and ultracode are getting attention because they change the shape of AI coding work.

Instead of asking one agent to do everything in one long conversation, the workflow pattern looks more like this:

  1. detect that a task is complex;
  2. write an orchestration plan;
  3. split the work into scoped packets;
  4. assign subagents or roles;
  5. require review and verification gates;
  6. keep trace evidence for what happened.

The important part is not the brand name. The important part is the orchestration pattern.

So we rebuilt the useful part locally as a reproducible template that works with an OpenAI-compatible model gateway like Crazyrouter.

Dynamic workflow score and latency chart

Why dynamic workflows are different#

A normal AI coding session is linear:

text
human prompt -> agent edits files -> human checks result

A dynamic workflow is closer to:

text
human goal
  -> planner packet
  -> implementer packet
  -> adversarial reviewer packet
  -> verifier packet
  -> trace log + go/no-go

That structure matters because complex coding tasks fail when everything is mixed together:

  • planning gets confused with implementation;
  • implementation gets reviewed by the same assumptions that created it;
  • tests are mentioned but not actually run;
  • the developer cannot tell what happened after a long agent session;
  • token usage explodes without a routing policy.

The local reproduction#

We created a small tool:

text
tools/agent_workflows/workflow_orchestrator.py

It creates a dynamic-workflow folder with role packets, verification gates, and trace logging.

Example:

bash
python tools/agent_workflows/workflow_orchestrator.py \
  --title "Claude Code Dynamic Workflows ultracode reproduction" \
  --task "Reproduce the useful part of Claude Code Dynamic Workflows / ultracode: split a complex coding request into scoped packets, assign model routes, require adversarial review, and verify with evidence." \
  --out generated/dynamic_workflows_20260603/ultracode_reproduction

Generated output:

text
ultracode_reproduction/
├── README.md
├── workflow.json
├── trace.jsonl
├── verify.sh
├── article_notes.md
└── packets/
    ├── 01-planner.md
    ├── 02-implementer.md
    ├── 03-adversarial-reviewer.md
    └── 04-verifier.md

This is not trying to clone Claude Code internals. It reproduces the workflow primitive in a way that is portable, inspectable, and publishable.

The four-packet workflow#

PacketRoleSuggested model routeCompletion gate
PlannerConvert request into scope, risks, acceptance criteria, file-level planclaude-opus-4-7Plan lists affected files, risks, tests, rollback
ImplementerApply the smallest safe patchcoding-optimized modelPatch maps to acceptance criteria
Adversarial reviewerChallenge assumptions, security, edge cases, testsalternate reviewer model, e.g. claude-opus-4-8Returns approve / request changes / block
VerifierRun tests or inspect evidencefast summary modelProduces command output or direct inspection notes

The point is role separation. The model that implements should not be the only model that reviews.

Crazyrouter model routing setup#

When model calls are needed, use one OpenAI-compatible base URL and switch only the model ID.

python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_CRAZYROUTER_API_KEY",
    base_url="https://cn.crazyrouter.com/v1"
)

planner = client.chat.completions.create(
    model="claude-opus-4-7",
    messages=[{"role": "user", "content": "Create a scoped implementation plan with risks and tests."}],
    temperature=0
)

reviewer = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Adversarially review this plan. Return approve, request-changes, or block."}],
    temperature=0
)

Keep API endpoints clean. Do not add UTM parameters to base_url.

Correct:

text
https://cn.crazyrouter.com/v1

Wrong:

text
https://cn.crazyrouter.com/v1?utm_source=blog

Why ultracode-style workflows can get expensive#

Dynamic workflows can fan out. A single request may create many sub-tasks, and each sub-task may ask for context, write code, review code, and run verification.

That is powerful, but it needs budget control.

A good workflow should log:

FieldWhy it matters
roleplanner / implementer / reviewer / verifier
modelmodel routing and cost attribution
latencyuser experience and bottleneck analysis
tokensusage and cost estimation
resultapprove / changes / blocked / verified
evidencetests, screenshots, logs, URLs

We also created:

text
tools/agent_workflows/agent_trace_logger.py

Example trace summary:

text
By model:
- claude-opus-4-7: calls=1, avg_latency=7.46s, total_tokens=1800
- claude-opus-4-8: calls=1, avg_latency=4.59s, total_tokens=1500

Dynamic workflow test matrix

A practical routing policy#

For teams using AI coding agents, start simple:

Workflow stepRouting rule
Planningstronger reasoning model, low temperature
Implementationcoding-specialized or cost-balanced model
Reviewdifferent model from implementer
Verification summaryfast/cheap model only after tests run
High-risk changesrequire human approval before merge

The mistake is using the most expensive model for every step. The other mistake is using the cheapest model for steps where failure is expensive.

A gateway lets you route by step.

What we shipped#

For this reproduction, we created:

  • tools/agent_workflows/workflow_orchestrator.py
  • tools/agent_workflows/agent_packetizer.py
  • tools/agent_workflows/agent_trace_logger.py
  • generated/dynamic_workflows_20260603/ultracode_reproduction/
  • growth_ops/codex_claude_search_report_20260603.md
  • growth_ops/twitter_codex_claude_cases.md

This turns a trending workflow idea into reusable operating infrastructure.

FAQ#

Is this the same as Claude Code Dynamic Workflows?#

No. It is a local reproduction of the useful workflow pattern: orchestration, packets, review, verification, and trace logging.

Why not just use one agent?#

One agent is fine for small tasks. For complex tasks, role separation catches more mistakes and creates better evidence.

Why use Crazyrouter here?#

Crazyrouter provides an OpenAI-compatible API gateway so each workflow step can route to a different model without rewriting client code.

Should every task use dynamic workflows?#

No. Use them for multi-file changes, migrations, security-sensitive edits, large refactors, or tasks where review evidence matters.

What is the next improvement?#

The next step is to connect the orchestrator to real model calls, collect token/latency data automatically, and compare routing policies.

Final take#

Dynamic workflows are not magic. They are structured orchestration.

The winning pattern is:

text
plan -> implement -> adversarial review -> verify -> log evidence

If you combine that with model routing, you get something more useful than a single long AI coding chat: a measurable engineering workflow.

Try the API gateway here: Crazyrouter

Implementation Guides

Related Posts

"Claude Plans, Codex Reviews: Rebuilding the Viral Two-Agent Coding Workflow with Crazyrouter"AI Coding

"Claude Plans, Codex Reviews: Rebuilding the Viral Two-Agent Coding Workflow with Crazyrouter"

"Twitter is full of Codex-in-Claude-Code workflows. We rebuilt the useful part: one agent plans or implements, a second agent reviews adversarially, and the whole process becomes reproducible packets instead of copy-paste chaos."

Jun 3
Claude Code Pricing 2026: Pro vs Max vs Team vs API CostsPricing

Claude Code Pricing 2026: Pro vs Max vs Team vs API Costs

A practical Claude Code pricing guide based on live coding workflow tests through https://cn.crazyrouter.com/v1, comparing subscription plans with API routing and cost per successful task.

May 26
Ernie Bot API Guide 2026: Baidu AI API for DevelopersGuide

Ernie Bot API Guide 2026: Baidu AI API for Developers

Complete guide to Baidu's Ernie Bot API — model comparison, setup, code examples in Python and Node.js, pricing, and how it compares to Western AI models.

Apr 8
AI Palm Reading with GPT-image-2 — Generate Professional Palmistry Analysis from a Single PhotoTutorial

AI Palm Reading with GPT-image-2 — Generate Professional Palmistry Analysis from a Single Photo

Use GPT-image-2 via Crazyrouter API to generate stunning palm reading infographics. Complete code in Python, curl, and Node.js.

May 1
GTutorial

Gemini CLI Complete Guide 2026: Repo Automation, CI Agents, and Multi-Model Routing

If you searched for **gemini cli complete guide**, you probably do not need another shallow feature list. You need to know what Gemini CLI is, how it compares with alternatives, how to use it in a dev...

May 26
Kimi K2 Thinking Guide 2026: Reasoning Agents, Evaluation Workflows, and API Cost ControlGuide

Kimi K2 Thinking Guide 2026: Reasoning Agents, Evaluation Workflows, and API Cost Control

A developer guide to Kimi K2 Thinking for reasoning-heavy applications, agent evaluation, long-context tasks, and budget-aware model routing.

May 23