Jarred Sumner, Bun creator, rewrote Bun in Rust in six days using Anthropic's new Claude Code dynamic workflows
The feature automates complex migrations using parallel subagents.
Dynamic workflows and adversarial code review was part of what made it possible to rewrite Bun in Rust in 6 days.
New in Claude Code (research preview): dynamic workflows. Claude writes an orchestration script on the fly, then spins up a large fleet of coordinated subagents in parallel to take on your most complex tasks. Use the word "workflow" in a prompt to get started.
(still writing blog post, this isn’t that)
Dynamic workflows and adversarial code review was part of what made it possible to rewrite Bun in Rust in 6 days.
Example prompt:
Write a workflow where for each finding in ./REPORT.md.
Step 1: Fix the bug. Do not use any git or build commands to avoid stepping on another Claude running in the same branch. Step 2: Use 2 adversarial review agents to refute the bugfix. Uncover every flaw. Do not use any git or build commands to avoid stepping on another Claude running in the same branch.
After all are complete:
Step 3: Apply all the bugfixes, run the build and get the relevant tests to pass. Once passing, commit and make a PR.
Start by splitting up the ./REPORT.md into individual files with bugs and pass these files to the workflow.
A pattern that works well For each unit of work: 1) Do the work. Don’t use git / cargo, slow commands are banned 2) Adversarial review 3) Apply changes Examples: - Rewrite every .zig file to .rs following patterns in ./PORTING and ./LIFETIMES.tsv - Get the crates to compile
A pattern that works well
For each unit of work: 1) Do the work. Don’t use git / cargo, slow commands are banned 2) Adversarial review 3) Apply changes
Examples: - Rewrite every .zig file to .rs following patterns in ./PORTING and ./LIFETIMES.tsv - Get the crates to compile
Dynamic workflows, in my personal opinion, is the state of the art today for reliably using agents to complete medium - large projects. For extra large projects, I especially like using workflows with /loop.
Each individual step within a workflow gets the same prompt with arguments, and then within those steps a different context window (or a fork). Workflows split up work more deterministically than subagents. It’s closer to a bespoke build system for a project than chat.
Example prompt: Write a workflow where for each finding in ./REPORT.md. Step 1: Fix the bug. Do not use any git or build commands to avoid stepping on another Claude running in the same branch. Step 2: Use 2 adversarial review agents to refute the bugfix. Uncover every flaw. Do not use any git or build commands to avoid stepping on another Claude running in the same branch. After all are complete: Step 3: Apply all the bugfixes, run the build and get the relevant tests to pass. Once passing, commit and make a PR. Start by splitting up the ./REPORT.md into individual files with bugs and pass these files to the workflow.
When you split up the work this way, Claude focuses on just the task it needs to and empirically this makes it more effective.
I’ve seen individual workflows run for 10 hours continuously. I imagine this will be very common.
Each individual step within a workflow gets the same prompt with arguments, and then within those steps a different context window (or a fork). Workflows split up work more deterministically than subagents. It’s closer to a bespoke build system for a project than chat.
Workflows can cost a lot of tokens. And that plus the split context windows are part of what makes them effective.
You can ask Claude to use a ballpark number of tokens to use more for harder tasks or to save tokens for easier tasks
When you split up the work this way, Claude focuses on just the task it needs to and empirically this makes it more effective. I’ve seen individual workflows run for 10 hours continuously. I imagine this will be very common.