Why Jarred Sumner Ported 750,000 Lines of Code in 11 Days Using Claude Code
Claude Code's dynamic workflows allow developers to orchestrate large-scale coding tasks by moving orchestration logic out of the AI model's context window and into executable scripts. This architectural shift is what enabled Jarred Sumner to port 750,000 lines of Zig code to Rust in just eleven days, achieving 99.8% test suite compatibility. The breakthrough wasn't simply spawning more AI agents; it was codifying the orchestration plan itself.
What Are Dynamic Workflows and How Do They Differ From Standard AI Agents?
In Claude Code's standard subagent model, Claude acts as the orchestrator, deciding turn-by-turn which agents to spawn and storing every intermediate result in its context window. This works fine for small tasks, but at scale it becomes a problem. When you're running dozens of agents, the context window fills up, coherence degrades, and the model struggles to stay on task.
Dynamic workflows flip this architecture entirely. Instead of Claude managing the orchestration in its context, Claude writes a JavaScript orchestration script for the task you describe, and a runtime executes it in the background. Intermediate results stay in script variables rather than consuming context space. The plan lives in code, which means you can read it, rerun it, and version control it like any other codebase.
This distinction explains why the Bun migration succeeded. The orchestration wasn't just distributed across more agents; it was codified in a repeatable script. When something needed re-running, the same script handled it. That repeatability and transparency is the real value proposition.
How to Get Started With Claude Code Dynamic Workflows
- Enable the Feature: You'll need Claude Code CLI v2.1.154 or later, a paid plan (Pro, Max, Team, or Enterprise), and on Pro you must enable dynamic workflows from the Dynamic workflows row in the /config menu.
- Trigger a Workflow: Use the "ultracode" keyword anywhere in your prompt, or try natural language like "use a workflow to..." or "run a workflow that..." Both register as workflow triggers.
- Try the Built-in Example: Before writing a custom workflow, run /deep-research to see how workflows actually work. This bundled workflow fans out web searches across multiple angles, has agents verify each other's findings, filters claims that don't survive scrutiny, and returns a cited report.
- Automate Workflow Planning: If you want Claude to automatically plan a workflow for every substantive task in your session, run /effort ultracode. This setting uses more tokens on everything, so it's best reserved for sessions dedicated to a single large task.
What Are the Core Building Blocks of a Dynamic Workflow?
Workflows use six primitives, but three matter most for everyday use. The agent() function spawns a single subagent and accepts an optional schema parameter when you need structured JSON output you'll parse downstream. Without the schema, you're relying on the agent to format its response correctly.
The parallel() function runs concurrent tasks and waits for all of them before continuing, creating a synchronization barrier. The pipeline() function streams items through stages without waiting, allowing item A to be in stage three while item B is still in stage one. Most beginners overuse parallel() when pipeline() would be more efficient. If your middle stage has no cross-item dependency, you don't need every item from stage one to finish before stage two starts. Using pipeline() by default and reaching for parallel() only when you genuinely need the barrier prevents unnecessary synchronization points that add wall-clock time without adding correctness.
The hard limits are 16 concurrent agents (CPU-dependent) and 1,000 agents total per run. In practice, most tasks need 20 to 100 agents. The 1,000 cap exists to prevent runaway token spend, not because the architecture can't scale further.
What Do Developers Need to Know About Costs and Performance?
Costs scale roughly linearly with agent count. A three-agent security audit runs about $0.16 at Sonnet rates. A migration touching a hundred files will run $10 to $50. Large codebase work can exceed $100. These aren't dealbreakers for serious engineering tasks, but they're not free, and workflows aren't the right tool for tasks a single conversation can handle.
There's a specific gotcha worth knowing: the cache cliff. Workflow phases separated by more than 300 seconds miss the default five-minute time-to-live (TTL) cache window. When that happens, the runtime falls back to full cache re-writes, which cost 12.5 times more than cache reads. On a long workflow, this adds up fast. The fix is to enable the one-hour TTL extension before starting a multi-phase run.
The best cost-control practice is also the best quality-control practice: test on a small slice first. Run the workflow on one directory instead of the whole repository. The /workflows dashboard shows each agent's token usage live, and you can stop the run at any point without losing work that's already completed.
When Should You Use Dynamic Workflows, and When Should You Avoid Them?
Dynamic workflows are the right tool for breadth tasks like audits, migrations, and research requiring cross-verification. They're the wrong choice for sequential work where step B cannot start until step A completes; in those cases, use standard subagents instead. They're also not appropriate for anything a single conversation handles fine, and they fail silently in situations where agents need shared state. Each agent runs with an isolated context and has no visibility into what peer agents are doing. Architectures that assume shared state will break.
One more constraint: the orchestration script must be plain JavaScript. The runtime has no transpilation layer, so TypeScript annotations cause parse errors.
The Bun rewrite succeeded because someone used the right tool for the right job. Eleven days, 750,000 lines of code, one script. That's not magic; that's a plan in code, executed with precision.