Skip to content

Toggle War: Roast My Code

Prompts are code. Test them like it.

Most teams ship a prompt change on a hunch: it felt better in three examples. Toggle War is a small, real example of the alternative: put the prompt behind a feature flag, split traffic, define success up front, and let a stats engine tell you which version wins.

The question

Does an AI code review written as a kind mentor or as a savage roast get copied more often? It's a deliberately playful question, because the point is the method: the same loop works for any prompt, model or tone you'd otherwise argue about in a meeting.

How the experiment is built

  1. 01
    Visitor

    random id, same reviewer every time

  2. 02
    Flagsmith flag

    review_prompt, bucketed 50/50

  3. 03
    Reviewer prompt

    the flag value goes to the model

  4. 04
    Review delivered

    logged as the exposure

  5. 05
    Copy = vote

    result_copied event

  6. 06
    Win probability

    Flagsmith's Bayesian engine

How to read the numbers

Flagsmith reports a win probability (the chance one version is truly better) and a 95% credible interval for the lift. A high probability isn't proof: if the interval still crosses zero, “no difference” hasn't been ruled out. Flagsmith also waits for at least 50 identities per variation (and 5 conversions) before comparing, and flags a sample-ratio mismatch if the split looks broken. The War Room draws the leading pod larger and plots the interval against the zero line.

Honest limitations

What I'd test next

FAQ

Is my code stored?
The app doesn't store or log what you paste. It is sent to Groq to generate the review, under Groq's own data policy. Don't paste secrets.
Why can't I get both reviewers?
Each visitor is bucketed once and sticks to that reviewer. If you saw both, the groups would blur together and the statistics would be meaningless.
Which model writes the reviews?
openai/gpt-oss-20b, served by Groq and called through the Vercel AI SDK. The model is the same for both reviewers; only the prompt differs.
How is the winner chosen?
Flagsmith Experimentation's Bayesian engine compares copy rates. The owner approves any rollout by hand; nothing ships automatically.
Is it open source?
Yes. Everything, including both prompts and the setup steps, is on GitHub.
Cast your vote →See the War Room