Branch Battle: Compare Two Approaches Side by Side
Branch Battle is one of SuperBuilder's most unique features. Give the same prompt to two AI agents simultaneously, let them work independently in isolated git branches, and compare the results side by side. Pick the winner. Discard the other.
Why This Matters
AI agents don't always produce the same output twice. Sometimes the first approach is clean and idiomatic. Sometimes it's overengineered. Sometimes it misses the point entirely. You don't know until you see it — and by then, you've already committed to one direction.
Branch Battle removes that uncertainty. Instead of running one agent and hoping for the best, you run two at the same time and compare. It costs a bit more in tokens, but it saves hours of going back and forth.
How It Works
- Open a thread in SuperBuilder and click Start Battle
- Write your prompt — exactly what you'd normally send to one agent
- SuperBuilder spawns two agents simultaneously, each in its own git worktree and branch
- Both agents work in parallel, reading the same codebase but writing independently
- When both finish, you see a side-by-side diff of what each agent produced
- Choose the approach you prefer, or cherry-pick parts from both
Each agent is completely isolated — they can't see each other's work in progress. You get genuinely independent approaches.
When to Use Branch Battle
Ambiguous requirements — When you're not sure which direction to take a feature, let two agents interpret the brief differently. One might go simple, one might go extensible. You see both.
Risky refactors — Before committing to a large structural change, run two agents with different approaches. Compare the before/after of each and pick the one that fits your codebase style better.
Learning — Comparing two implementations teaches you things. You see trade-offs you might not have considered.
Testing prompt quality — If your results feel inconsistent, run a battle to see how much variance there is. A well-scoped prompt produces similar output from both agents.
Architecture decisions — "Should we use a class or a composition of hooks here?" Let each agent try one approach and compare.
Reviewing the Results
The Battle view shows:
- File-by-file diff for each agent's branch
- Token cost and time taken per agent
- Test pass/fail status if your project has a test suite
- Side-by-side code comparison for changed files
You can also open either branch in your editor directly. Once you decide, one click merges the winner. The losing branch is archived — you can always go back.
Combining Both Approaches
Sometimes neither agent gets it perfectly right, but together they do. You can:
- Take the structure from Agent A and the implementation detail from Agent B
- Use Agent A's output as a starting point and continue the thread from there
- Start a new agent thread that references both approaches and synthesizes them
Branch Battle isn't just "pick one." It's a richer way to explore the solution space.
Practical Examples
"Refactor the auth middleware to support OAuth2"
- Agent A produces a clean middleware class with clear separation of concerns
- Agent B inlines the OAuth logic and keeps it simple
- You see both, pick the one that fits your team's style
"Add pagination to this API endpoint"
- Agent A uses cursor-based pagination
- Agent B uses offset pagination with a total count
- You compare the trade-offs without having to implement both yourself
"Write tests for the checkout flow"
- Agent A writes unit tests with mocks
- Agent B writes integration tests hitting real endpoints
- You can take both — they're not mutually exclusive
Frequently Asked Questions
Does Branch Battle cost twice as much?
Yes — two agents means roughly double the token usage. But you save the time of going back and forth on a single approach. For decisions that would otherwise take a day of back-and-forth, the cost is well worth it.
Can I start a battle with a specific model for each agent?
Yes. You can configure each agent in a battle to use a different model. Common pattern: Agent A uses Claude Sonnet (fast, good for first pass), Agent B uses Claude Opus (slower, more thorough).
What if one agent fails?
If one agent fails or produces obviously broken output, you can re-run just that agent. You don't have to restart the whole battle.
Can I run more than two agents?
Currently, battles are limited to two agents. Multi-agent races (3+) are on the roadmap.
How long does a battle take?
The same as a single agent run, since both agents run in parallel. You get two results in the time it would have taken for one.