0%
#simulation#data#probability#statistics#experiment

Claude Code Buddy Probability Lab — Truths Revealed by 10,000 Simulations

Published 2026-04-0510 min read

[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:

RarityExpected %Actual CountActual %Deviation
Common60.0%6,02760.3%+0.3%
Uncommon25.0%2,50225.0%+0.0%
Rare10.0%9749.7%-0.3%
Epic4.0%4054.0%+0.0%
Legendary1.0%920.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:

RankSpeciesCountActual %
1🐰 Rabbit5995.99%
2🐧 Penguin5985.98%
3🪢 Goose5965.96%
............
16🦆 Duck5275.27%
17🤖 Robot5215.21%
18🐙 Octopus5105.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.

HatCountActual %Expected %
👑 Crown52813.29%12.50%
🎩 Top Hat51713.01%12.50%
🧲 Propeller52213.14%12.50%
😇 Halo48512.21%12.50%
🧙 Wizard46111.60%12.50%
🧢 Beanie44911.30%12.50%
🦆 Tiny Duck51412.94%12.50%
∅ None49712.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:

RarityAvg DEBUGGINGAvg PATIENCEAvg CHAOSAvg WISDOMAvg SNARKTotal
Common28.929.829.229.328.7145.9
Uncommon39.239.139.639.138.1195.1
Rare49.247.549.049.549.1244.3
Epic59.559.259.159.256.2293.2
Legendary68.070.672.370.371.2352.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 StatCountActual %Expected %
CHAOS2,06120.61%20.00%
WISDOM2,04620.46%20.00%
PATIENCE2,00220.02%20.00%
DEBUGGING1,96819.68%20.00%
SNARK1,92319.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.

// COMMENTS

github_discussions.sh

Sign in with GitHub to leave a comment.

Ready to find your buddy?

CHECK YOUR BUDDY

Built by the community. Not affiliated with Anthropic.

All computation is local. No data is collected or transmitted.

> EOF