Claude Code Buddy Probability Lab — Truths Revealed by 10,000 Simulations
[01]The Experiment
Theory is elegant. Data is honest. The Claude Code Buddy engine uses a deterministic pipeline — FNV-1a hash → Mulberry32 PRNG → weighted rolls — that should produce specific probability distributions. But does it? We generated 10,000 random UUIDs, ran each through the exact same rollBuddy() function, and recorded every rarity, species, eye style, hat type, shiny status, and stat value. This article presents the raw results.
The simulation code mirrors the production engine exactly: same FNV-1a hash with the friend-2026-401 salt, same Mulberry32 PRNG, same weighted selection logic. The only variable is the input UUID, generated via Node.js crypto.randomUUID().
[02]Rarity Distribution: Theory vs Reality
The rarity system uses weighted random selection with weights of 60/25/10/4/1 (total 100). Here’s how 10,000 trials compared to the theoretical probabilities:
| Rarity | Expected % | Actual Count | Actual % | Deviation |
|---|---|---|---|---|
| Common | 60.0% | 6,027 | 60.3% | +0.3% |
| Uncommon | 25.0% | 2,502 | 25.0% | +0.0% |
| Rare | 10.0% | 974 | 9.7% | -0.3% |
| Epic | 4.0% | 405 | 4.0% | +0.0% |
| Legendary | 1.0% | 92 | 0.9% | -0.1% |
Verdict: The Mulberry32 PRNG delivers remarkably faithful weighted selection. The maximum deviation is just ±0.3 percentage points. The law of large numbers holds: given enough trials, the observed distribution converges tightly on the theoretical weights. Your chances of pulling a Legendary are genuinely 1-in-100.
[03]Species Frequency: Is Every Buddy Equally Likely?
With 18 species and uniform pick() selection, each species should appear in ~5.56% of rolls. Here are the top 5 and bottom 5:
| Rank | Species | Count | Actual % |
|---|---|---|---|
| 1 | 🐰 Rabbit | 599 | 5.99% |
| 2 | 🐧 Penguin | 598 | 5.98% |
| 3 | 🪢 Goose | 596 | 5.96% |
| ... | ... | ... | ... |
| 16 | 🦆 Duck | 527 | 5.27% |
| 17 | 🤖 Robot | 521 | 5.21% |
| 18 | 🐙 Octopus | 510 | 5.10% |
Verdict: The spread from most common (Rabbit, 5.99%) to least common (Octopus, 5.10%) is less than 1 percentage point. This is well within normal statistical variance for N=10,000. There is no hidden species weighting — every species is genuinely equally likely.
[04]Eyes, Hats & Shiny: Cosmetic Probabilities
Eyes are selected uniformly from 6 styles. The observed range was 16.39% to 17.11% (expected: 16.67% each). No eye style is rarer than another.
Hats are only rolled for non-Common buddies (N=3,973 in our sample). Among 8 hat types, Crown was most common at 13.29% and Beanie least at 11.30% (expected: 12.50% each). The deviation is within normal bounds.
| Hat | Count | Actual % | Expected % |
|---|---|---|---|
| 👑 Crown | 528 | 13.29% | 12.50% |
| 🎩 Top Hat | 517 | 13.01% | 12.50% |
| 🧲 Propeller | 522 | 13.14% | 12.50% |
| 😇 Halo | 485 | 12.21% | 12.50% |
| 🧙 Wizard | 461 | 11.60% | 12.50% |
| 🧢 Beanie | 449 | 11.30% | 12.50% |
| 🦆 Tiny Duck | 514 | 12.94% | 12.50% |
| ∅ None | 497 | 12.51% | 12.50% |
Shiny Rate: 112 out of 10,000 buddies were shiny — a rate of 1.12% against the expected 1.00%. This slight overshoot is normal variance. Broken down by rarity: Common 1.14%, Uncommon 1.20%, Rare 0.92%, Epic 0.99%, Legendary 0.00%. The shiny roll is independent of rarity, confirmed by the data.
[05]The Stat Economy: Average Power by Rarity
Each buddy has 5 stats (DEBUGGING, PATIENCE, CHAOS, WISDOM, SNARK) generated with a floor based on rarity, a boosted peak stat, and a penalized dump stat. Here are the average totals:
| Rarity | Avg DEBUGGING | Avg PATIENCE | Avg CHAOS | Avg WISDOM | Avg SNARK | Total |
|---|---|---|---|---|---|---|
| Common | 28.9 | 29.8 | 29.2 | 29.3 | 28.7 | 145.9 |
| Uncommon | 39.2 | 39.1 | 39.6 | 39.1 | 38.1 | 195.1 |
| Rare | 49.2 | 47.5 | 49.0 | 49.5 | 49.1 | 244.3 |
| Epic | 59.5 | 59.2 | 59.1 | 59.2 | 56.2 | 293.2 |
| Legendary | 68.0 | 70.6 | 72.3 | 70.3 | 71.2 | 352.4 |
Key insight: Each rarity tier adds roughly +50 total stat points over the previous tier. A Legendary buddy averages 352 total points — more than double a Common's 146. The jump from Epic to Legendary (+59 points) is the largest single-tier increase, making Legendary buddies genuinely elite.
All 5 stats reached both the minimum (1) and maximum (100) across the 10,000 sample, confirming the full range is achievable. The global average per stat hovers around 35, with SNARK slightly lower at 34.6.
[06]Peak Stat Distribution & Stat Extremes
The peak stat is chosen uniformly from 5 options. Our data confirms near-perfect uniformity:
| Peak Stat | Count | Actual % | Expected % |
|---|---|---|---|
| CHAOS | 2,061 | 20.61% | 20.00% |
| WISDOM | 2,046 | 20.46% | 20.00% |
| PATIENCE | 2,002 | 20.02% | 20.00% |
| DEBUGGING | 1,968 | 19.68% | 20.00% |
| SNARK | 1,923 | 19.23% | 20.00% |
No stat is favored as a peak. The dump stat (lowest stat) is also chosen uniformly, but is re-rolled if it matches the peak — this means each non-peak stat has a 25% chance of being the dump, which our data also confirms.
Stat extremes across all 10,000 buddies: Every stat achieved both min=1 and max=100. The theoretical maximum for a single stat is 100 (Legendary peak: floor 50 + 50 + up to 29 = 100, capped). The theoretical minimum is 1 (Common dump: floor 5 - 10 + 0 = -5, clamped to 1).
[07]The Hunt for Legendary Shiny
The holy grail of Buddy collecting: a Legendary Shiny. The probability is 1% (Legendary) × 1% (Shiny) = 0.01%, or 1 in 10,000. In our simulation of exactly 10,000 trials, we found:
0 Legendary Shiny Buddies
This is actually the most likely outcome! With an expected value of 1.0, the Poisson distribution tells us there's a 36.8% chance of finding exactly zero in 10,000 trials. We were unlucky, but not unusually so. To have a 95% chance of seeing at least one Legendary Shiny, you'd need approximately 30,000 trials.
For context, our 92 Legendary buddies had a 1% shiny chance each, giving an expected 0.92 shinies among them. The fact that none were shiny is a coin-flip outcome — not a bug in the algorithm.
The rarest possible combination — a specific Legendary Shiny species with a specific hat, eye, and peak stat — has a probability of approximately 1 in 86,400,000. You'd need to generate UUIDs for the entire population of Germany to expect one.
[08]Conclusions
After 10,000 simulations, we can confirm:
- The PRNG is fair. Mulberry32 seeded by FNV-1a produces distributions that closely match theoretical expectations across all dimensions.
- No hidden weights. Species, eyes, hats, and peak stats are all uniformly distributed as documented.
- Rarity matters. Each tier adds ~50 total stat points, with Legendary buddies averaging 2.4× the stats of Commons.
- Shiny is truly rare. At 1.12% observed (1.00% expected), the shiny rate is honest and independent of rarity.
- Legendary Shiny is a unicorn. 0 found in 10,000 trials. The math checks out — you need extraordinary luck or extraordinary patience.
The beauty of deterministic generation is that your Buddy was decided the moment your UUID was created. These 10,000 simulations simply confirm that the dice are fair. Whether you got a Common Duck or a Legendary Shiny Dragon, the algorithm treated you honestly.