{"kind":"doc","doc":{"title":"I Got a Common Turtle","section":{"slug":"posts","name":"Posts"},"rkey":"1775137360175-i-got-a-common-turtle","cid":"bafkreiazxmtmcafzirvirboxzm2dfnf26onavbp6ouzy6v7dwzldgqe2du","renderKey":"bafkreiazxmtmcafzirvirboxzm2dfnf26onavbp6ouzy6v7dwzldgqe2du@2026-04-02T06:42:00Z@2026-10-20T04:18:19Z@Posts|","href":"/posts/1775137360175-i-got-a-common-turtle","publishedAt":"2026-04-02T06:42:00Z","updatedAt":"2026-10-20T04:18:19Z","tags":["ai","claude-code","reverse-engineering","tools"],"description":"I got a Common turtle from Claude Code's deterministic buddy system, so I brute-forced the generation algorithm.","readingMinutes":6,"markdown":"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.\n\nYour 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.\n\nI got a Common turtle.\n\nBaseline 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.\n\nSo I brute-forced the generation algorithm and built a tool to hunt for better seeds.\n\n## The generation pipeline\n\n```mermaid\nflowchart TD\n  accTitle: How a buddy is rolled\n  accDescr: The account UUID plus a fixed salt is hashed with Wyhash to seed Mulberry32, which then rolls rarity, species, eyes, hat, shiny, and stats in that order, with rarity deciding whether a hat is rolled and how high the stats start.\n  U[Salted UUID] --> H[Wyhash]\n  H --> P[Mulberry32]\n  P --> R[rarity]\n  R --> S[species]\n  S --> E[eyes]\n  E --> T[hat]\n  T --> Y[shiny]\n  Y --> X[stats]\n  R -.->|none if common| T\n  R -.->|stat floor| X\n```\nEvery trait comes off one random stream in a fixed order, so rarity changes not just the hat and stat floor but every roll after it.\n\nThe 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 in order.\n\nSame UUID in, same buddy out. Reinstalling changes nothing. Physical traits regenerate from the hash every launch. Only the name and personality persist locally.\n\nThe 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.\n\n## Species\n\n18 species, uniformly distributed. Dragons, capybaras, axolotls, ghosts, geese, etc. Assignment is purely a function of the hash.\n\n## Rarity\n\nWeighted probabilities, plus a separate shiny roll:\n\n| Rarity    | Probability | Stat Floor | Features                          |\n|-----------|-------------|------------|-----------------------------------|\n| Common    | 60%         | 5          | Basic appearance, no hat          |\n| Uncommon  | 25%         | 15         | Unlocks hat accessories           |\n| Rare      | 10%         | 25         | More accessory options            |\n| Epic      | 4%          | 35         | Exclusive accessories, high stats |\n| Legendary | 1%          | 50         | Top-tier accessories, max stats   |\n\nEvery buddy has an independent **1% shiny chance**, which adds iridescent shimmer and particle effects regardless of rarity.\n\nCombined:\n\n| Combination                          | Probability     |\n|--------------------------------------|-----------------|\n| Legendary                            | 1/100           |\n| Shiny                                | 1/100           |\n| Legendary + Shiny                    | 1/10,000        |\n| Specific Species + Legendary         | ~1/1,800        |\n| Specific Species + Legendary + Shiny | ~1/180,000      |\n\n## Appearance\n\n6 eye styles: `· ✦ × ◉ @ °`\n\n8 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.\n\n## Stats\n\nFive attributes, ranked by whether they actually help you code:\n\n| Rank | Stat      | Why                                     |\n|------|-----------|-----------------------------------------|\n| 1    | Debugging | The whole point of a buddy              |\n| 2    | Wisdom    | Pattern recognition, architecture sense |\n| 3    | Patience  | Long sessions, complex problems         |\n| 4    | Chaos     | Creative solutions, lateral thinking    |\n| 5    | Snark     | Fun but least useful                    |\n\nA high-chaos goose with max snark will roast your bugs. A patient owl with high wisdom offers constructive advice.\n\nEvery 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.\n\nThe formulas for a Legendary (stat floor 50):\n\n| Type   | Formula                              | Range |\n|--------|--------------------------------------|-------|\n| Peak   | min(100, floor(50 + 50 + rand × 30)) | 100   |\n| Normal | floor(50 + rand × 40)                | 50–89 |\n| Dump   | max(1, floor(50 − 10 + rand × 15))   | 40–54 |\n\nTheoretical 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.\n\nThe ideal 421: debugging as peak (100), snark as dump (54), wisdom/patience/chaos all at 89.\n\n## How they talk\n\nTwo modes.\n\n**Passive:** the buddy watches your conversation with Claude and chimes in via speech bubble. Hit a tricky bug and it might encourage you or mock you, depending on its stats.\n\n**Active:** mention the buddy by name and its bubble responds directly. Claude steps aside.\n\nHigh snark roasts. High patience comforts. High chaos is a coin flip. The buddy's system prompt is injected at generation:\n\n```\nA small {species} named {name} sits beside the user's input box\nand occasionally comments in a speech bubble. You're not {name} —\nit's a separate watcher.\n```\n\nClaude treats the buddy as an independent entity and yields when you address it directly.\n\n## The Mulberry32 PRNG\n\n```typescript\nclass Mulberry32 {\n  constructor(seed: number) { this.state = seed >>> 0; }\n  nextU32(): number {\n    this.state = (this.state + 0x6d2b79f5) >>> 0;\n    let t = (this.state ^ (this.state >>> 15)) >>> 0;\n    t = Math.imul(t, 1 | this.state) >>> 0;\n    t = (t + (Math.imul((t ^ (t >>> 7)) >>> 0, 61 | t) >>> 0)) ^ t;\n    return (t ^ (t >>> 14)) >>> 0;\n  }\n  nextF64(): number { return this.nextU32() / 4294967296; }\n}\n```\n\nPure bitwise math. Millions of evaluations per second.\n\n## buddydex\n\nI put the hunter in a small Bun repo: a CLI, a web UI, and a Claude Code plugin, all on the same engine.\n\nCLI is `bunx buddydex`, or `bun add -g buddydex` if you want it installed.\n\n```bash\nbuddydex hunt --species dragon --rarity legendary\nbuddydex hunt --rarity legendary --perfect 70\nbuddydex hunt --shiny --tries 50000000\n```\n\nFilters include `--species`, `--rarity`, `--shiny`, `--min-stat chaos:90`, `--min-total 400`, and `--perfect` (every stat above a threshold). Default search space is 1M UUIDs.\n\nInject a result into `~/.claude.json`:\n\n```bash\nbuddydex inject <seed>\nbuddydex inject <seed> --preview\n```\n\nFirst injection backs up the original UUID. `buddydex restore` puts it back.\n\n```bash\nbuddydex show       # current buddy\nbuddydex restore    # restore original from backup\nbuddydex roll <id>  # preview what a UUID produces\n```\n\nThe web UI is at [buddydex.fun](https://buddydex.fun). Same engine in a Web Worker, Wyhash via `@zig-wasm/hash`, same results as the CLI.\n\nThere's also a Claude Code plugin:\n\n```bash\nclaude plugin add github:iammatthias/buddydex\n```\n\nThat adds `/reroll`. Claude parses the args, searches, shows the result, and can inject from the conversation.\n\nBun is required for the CLI because `Bun.hash()` is Wyhash. The web UI matches via the Zig WASM build. The brute-forcer only emits valid 8-4-4-4-12 UUIDs; the binary's parser crashes on non-hex.\n\nThe 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`.\n\n![](blob://bafkreiaghtpei6oudr2froeg24hkjaw5gpaah667m5kely5l6yhwiv6fxi)\n\n`bunx buddydex inject d4a815e8-f9e4-4f20-84a3-2756508023bf`","media":{"bafkreiaghtpei6oudr2froeg24hkjaw5gpaah667m5kely5l6yhwiv6fxi":{"mime":"image/png","width":586,"height":818,"dominantColor":"#383940","blurhash":"L99G{%%M4mE100RP_3x]-.ofIUM|","thumbCid":null}},"series":{},"related":[{"title":"Buddydex","href":"/experiments/1789660275000-buddydex","section":"experiments","description":"BuddyDex brute-forces the deterministic hashing pipeline behind Claude Code's short-lived April Fools' buddies, finding account ids that produce a desired species, rarity, stats, or shiny status.","publishedAt":"2026-09-20T05:15:21Z"},{"title":"Phosphene","href":"/art/1781816428977-phosphene","section":"art","description":"A camera that turns each photo into a poem, then paints a new image from those words.","publishedAt":"2026-06-18T21:00:28Z"},{"title":"Obsidian Plugins","href":"/experiments/1789490903000-obsidian-plugins","section":"experiments","description":"An overview of three Obsidian plugins the author built: an image uploader that sends embedded images to Pinata and rewrites references as ipfs:// URIs, plus AI-powered generators for note excerpts and tags.","publishedAt":"2026-09-20T05:10:12Z"},{"title":"Styx","href":"/experiments/1789407119000-styx","section":"experiments","description":"Styx is a library of eight agent souls plus a toolbox of skills for Hermes, Claude Code, or any LLM that takes a system prompt. It installs into ~/.hermes/styx or souls can be pasted into another runtime.","publishedAt":"2026-09-20T05:09:57Z"},{"title":"Replacing a Rabbit's Brain: Connecting the R1 to Hermes","href":"/posts/1775069974473-replacing-rabbit-s-brain-connecting-a-rabbit-r1-to-hermes","section":"posts","description":"I replaced the OpenClaw agent on my R1 with Hermes, running locally on a MacBook Pro.","publishedAt":"2026-04-01T11:59:00Z"},{"title":"OpenClaw and the Rabbit R1","href":"/posts/1774911232779-openclaw-and-the-rabbit-r1","section":"posts","description":"I got my Rabbit R1 talking to my Pinata-hosted agent. The agent did most of the work.","publishedAt":"2026-03-30T15:53:00Z"}],"prev":{"title":"Replacing a Rabbit's Brain: Connecting the R1 to Hermes","href":"/posts/1775069974473-replacing-rabbit-s-brain-connecting-a-rabbit-r1-to-hermes"},"next":{"title":"Farfield","href":"/posts/1779066375000-farfield"}}}