If two people type the same account ID into the same function, they should get the same answer every time. That's the entire spec for the checker on Claude Buddy Community Hub, a fan-made site for the /buddy pet inside Claude Code. It's a fun little problem, and it has a few lessons that apply to any "deterministic random" feature.

Hash the ID, seed a PRNG

Your buddy isn't a fresh roll each time you hatch one; it's derived from your account UUID, so the same account always gets the same pet. In principle that means nothing has to be stored: the result can be recomputed from the ID alone. The checker page describes the shape of it: hash the UUID together with a salt, then feed a pseudo-random generator that decides species, rarity, eyes, hat and the five stats. There are 18 species to land on.

The detail I like is on the checker itself. It offers a hash choice: Node.js (FNV-1a) works today, and Bun (wyhash) is listed as coming soon. That's a good reminder that "deterministic" always means "deterministic given the same hash function". Two runtimes that hash the same string differently will hand you two different pets, and neither is wrong.

The odds multiply, so say so

Rarity has five tiers: Common 60%, Uncommon 25%, Rare 10%, Epic 4% and Legendary 1%. On the rarity page there's a small probability calculator. A Legendary is 1%. A Legendary of one specific species is 0.056%. Shiny is a separate 1%, so Legendary and Shiny together is 0.01%, and adding a specific species brings it to 0.0006%.

None of that is clever. It's independent odds multiplied, and 1% divided by 18 species gives the 0.056%. But it's easy to read "1%" and "1%" and picture something near 2%, when the real figure is 0.01%. Printing the arithmetic next to the claim makes the scale obvious at a glance.

The input is the hard part

The obvious failure for a tool like this is "the checker shows a different pet than my terminal". The UUID guide covers the likely causes: there are two IDs in the config file, accountUuid and userID, and Team or Pro accounts should use accountUuid. You can find it with grep accountUuid ~/.claude.json. The other cause it lists is a reroll tool that changed the local salt, which, by definition, changes the output of a deterministic function.

The generator is a few lines of logic. Telling people which of two near-identical strings to paste is the part that needs real writing, so that's where the page spends its words: the exact command, the fallback, and a troubleshooting list for when the result still doesn't match. A deterministic function is only as reliable as the input you let people feed it.

This is a community-built site and is not affiliated with the official project. Disclosure: it's my site.

When your program has to be "random but repeatable", which part do you pin down first: the hash, the seed or the input format?