I Got a Common Turtle

I got a Common turtle from Claude Code's deterministic buddy system, so I brute-forced the generation algorithm.

On April 1st, 2026, Anthropic shipped a tamagotchi-style terminal pet called Buddy as an easter egg inside Claude Code. Type /buddy and a little ASCII creature hatches next to your input line. It watches your conversations, drops comments in speech bubbles, and has its own name, personality, and stats. Delightful.

Your buddy is deterministic, generated from a hash of your account UUID. You don’t get to pick your species, rarity, or stats. You get what you get.

I got a Common turtle.

Baseline stats, no hat, no shimmer. A slow, unremarkable cretin assigned to me by the cold math of a hash function. People online are showing off Legendary Shiny Dragons with maxed-out chaos stats and tiny duck hats. Something had to be done.

So I brute-forced the generation algorithm and built a tool to hunt for better seeds.

The Generation Pipeline

flowchart LR
    A[accountUuid] --> B["+ salt 'friend-2026-401'"]
    B --> C[Wyhash → u32]
    C --> D[Mulberry32 PRNG]
    D --> E[rarity]
    D --> F[species]
    D --> G[eyes]
    D --> H[hat]
    D --> I[shiny]
    D --> J[stats]

The pipeline reads oauthAccount.accountUuid from ~/.claude.json, concatenates it with the salt "friend-2026-401", hashes it with Wyhash (Bun.hash()) truncated to u32, seeds a Mulberry32 PRNG, and rolls traits sequentially.

Same UUID in, same buddy out. Reinstalling changes nothing. Physical traits regenerate from the hash every launch. Only the name and personality persist locally.

The pipeline only cares about the UUID string. Swap it in the config for one that hashes to better traits and you get a different buddy. Auth tokens live separately, so login is unaffected.

Species

18 species, uniformly distributed. Dragons, capybaras, axolotls, ghosts, geese, etc. Assignment is purely a function of the hash.

Rarity

Weighted probabilities with a separate shiny roll:

RarityProbabilityStat FloorFeatures
Common60%5Basic appearance, no hat
Uncommon25%15Unlocks hat accessories
Rare10%25More accessory options
Epic4%35Exclusive accessories, high stats
Legendary1%50Top-tier accessories, max stats

Every buddy has an independent 1% shiny chance, adding iridescent shimmer and particle effects regardless of rarity.

Combined probabilities:

CombinationProbability
Legendary1/100
Shiny1/100
Legendary + Shiny1/10,000
Specific Species + Legendary~1/1,800
Specific Species + Legendary + Shiny~1/180,000

Appearance

6 eye styles: · ✦ × ◉ @ °

8 hats, gated by rarity. Common buddies get nothing. Uncommon unlocks crowns, top hats, and propellers. Rare adds halos and wizard hats. Epic gets beanies. Legendary gets the tiny duck.

Stats

5 attributes shape the buddy’s personality and interaction style, ranked here by coding utility:

RankStatWhy
1DebuggingThe whole point of a buddy
2WisdomPattern recognition, architecture sense
3PatienceLong sessions, complex problems
4ChaosCreative solutions, lateral thinking
5SnarkFun but least useful

A high-chaos goose with max snark will roast your bugs. A patient owl with high wisdom offers constructive advice. The species-attribute combination drives the entire interaction personality.

Every buddy has one peak attribute (highest) and one dump attribute (lowest). The rest distribute randomly. Total points scale with rarity. A Legendary buddy’s dump stat is higher than a Common buddy’s peak.

The formulas for a Legendary (stat floor 50):

TypeFormulaRange
Peakmin(100, floor(50 + 50 + rand × 30))100
Normalfloor(50 + rand × 40)50–89
Dumpmax(1, floor(50 − 10 + rand × 15))40–54

Theoretical max BST is 421: peak at 100, three normals at 89, dump at 54. Getting there requires every random roll to land at its absolute ceiling. Three normals at 89 each need rand in [0.975, 1.0), roughly 2.5% per roll. The dump at 54 needs rand in [14/15, 1.0), about 6.7%. Combined with the 1% legendary roll and the right peak/dump assignment, the odds of a perfect 421 land around 1 in 6 billion. Within u32 space, but barely.

The ideal 421: debugging as peak (100), snark as dump (54), wisdom/patience/chaos all at 89.

Interaction Model

Buddies work in two modes.

Passive: the buddy watches your conversation with Claude and chimes in via speech bubble at key moments. Hit a tricky bug and it might encourage you or mock you, depending on its stats.

Active: mention the buddy by name and its bubble responds directly. Claude steps aside.

Response style is attribute-driven. High snark delivers witty roasts. High patience offers comfort. High chaos is unpredictable. The buddy’s system prompt is injected at generation:

A small {species} named {name} sits beside the user's input box
and occasionally comments in a speech bubble. You're not {name} —
it's a separate watcher.

Claude treats the buddy as an independent entity, yielding when the user addresses it directly.

The Mulberry32 PRNG

class Mulberry32 {
  constructor(seed: number) { this.state = seed >>> 0; }
  nextU32(): number {
    this.state = (this.state + 0x6d2b79f5) >>> 0;
    let t = (this.state ^ (this.state >>> 15)) >>> 0;
    t = Math.imul(t, 1 | this.state) >>> 0;
    t = (t + (Math.imul((t ^ (t >>> 7)) >>> 0, 61 | t) >>> 0)) ^ t;
    return (t ^ (t >>> 14)) >>> 0;
  }
  nextF64(): number { return this.nextU32() / 4294967296; }
}

Pure bitwise math. Millions of evaluations per second.

buddydex

Three interfaces, one shared engine. A Bun workspace monorepo with a CLI, a web UI, and a Claude Code plugin.

CLI

Runs directly with bunx buddydex or installs globally via bun add -g buddydex.

Hunt for buddies matching your criteria:

buddydex hunt --species dragon --rarity legendary
buddydex hunt --rarity legendary --perfect 70
buddydex hunt --shiny --tries 50000000

Filters include --species, --rarity, --shiny, --min-stat chaos:90, --min-total 400, and --perfect (every stat above a threshold). Default search space is 1M UUIDs.

Inject a result into ~/.claude.json:

buddydex inject <seed>
buddydex inject <seed> --preview

First injection backs up the original UUID. buddydex restore reverses everything.

buddydex show       # current buddy
buddydex restore    # restore original from backup
buddydex roll <id>  # preview what a UUID produces

Web UI

Live at buddydex.fun. A React + Vite app with the same engine running in a Web Worker. Uses @zig-wasm/hash, the same Zig Wyhash compiled to WASM. Results are identical to the CLI.

Slash Command

Registered as a Claude Code plugin:

claude plugin add github:iammatthias/buddydex

Adds /reroll inside Claude Code. Claude handles argument parsing, search, result presentation, and injection within the conversation.

Notes

Bun is required for the CLI. Bun.hash() uses Wyhash. The web UI gets the same results via @zig-wasm/hash.

UUID format is enforced. The binary’s UUID-to-BigInt parser crashes on non-hex input. The brute-forcer generates valid 8-4-4-4-12 format UUIDs only.

Auth is orthogonal. accountUuid is read only for buddy generation. OAuth tokens handle authentication independently. Swapping the UUID affects nothing else.

Shared engine. The engine package is an exact port of the deobfuscated binary logic: Wyhash, Mulberry32 PRNG, rollBones, and all the constants. Every interface uses it.

Project Structure

Bun workspace monorepo:

packages/
  engine/    Shared core: Wyhash, Mulberry32, rollBones, constants
  cli/       CLI tool: hunt, inject, restore, show, roll
  web/       Web UI: React + Vite + Web Worker
  plugin/    Claude Code integration: /reroll slash command

The best /buddy I have found so far is a Legendary Snail. It has as close as you can get to perfect stats, with the exception of shiny.

bunx buddydex inject d4a815e8-f9e4-4f20-84a3-2756508023bf