Claude Code Buddy System Explained: From a White Cactus to a Shiny Legendary Capybara

Core Question Answered in This Article

What exactly is the Claude Code /buddy pet system, how does its underlying technical architecture operate, and why does a seemingly “useless” command-line companion matter so much to the developer community?


The Birth of an Easter Egg: The /buddy Command and the Story Behind It

Anthropic quietly added a pet mode to Claude Code on April 1st. By typing /buddy, you can hatch an exclusive little command-line pet, complete with a rainbow-colored command prompt.

This timing was no accident. Based on the timestamps found in the 510,000 lines of Anthropic source code that leaked the day prior, the Buddy pet system was a planned feature, making its first appearance on April 1st right on schedule. With Easter Sunday just two days away, while others were hiding traditional eggs, Anthropic hid theirs inside /buddy.

Claude Code /buddy command interface

After entering the command, the system initiates a hatching sequence. You have no idea what is going to pop out; it feels exactly like opening a blind box. It comes with a species, attributes, a personality, and rather flashy presentation.

Pet hatching process

Personal Reflection: As a developer who spends countless hours staring at command-line interfaces, my first reaction to this feature was—what is the point? But upon reflection, the developer tool space is severely lacking in this kind of “useless romance.” We are conditioned to expect every feature to point directly toward efficiency gains, bug fixes, or faster deployments. Very few people are willing to put something into a tool that exists purely to bring a smile to your face. With this step, Anthropic is making a statement about attitude rather than functionality.

Creative coding setup
Image Source: Unsplash


How Complex is the Rarity and Attribute System?

The pet system is far more than a simple ASCII art face. Behind it lies a complete gamified design framework: tiered rarity, an independent Shiny probability, a five-stat attribute system, and a personality matrix that directly influences how the pet interacts with you.

Tiered Rarity and the Shiny Mechanic

The pet system employs a rarity tiering system similar to mobile gacha games. Based on the leaked source code, higher rarity tiers result in more visually spectacular pet appearances. Beyond standard rarity, there is an independent Shiny mechanic—the Shiny probability is fixed at 1%, completely unrelated to the pet’s base rarity tier.

This means that, theoretically, you could hatch a “Shiny Common” pet or a “Non-Shiny Legendary” pet. Because the two dimensions are entirely independent, the ultimate endgame combination is a “Shiny Legendary.”

The 18 Pet Species

The source code reveals a total of 18 distinct pet species in the system. Here are some of the confirmed types:

# Species Notes
1 Duck
2 Mushroom
3 Owl
4 Snail
5 Ghost
6 Capybara The star of this story
7-18 Other Species Verifiable in source code, totaling 18
Overview of 18 pet species

Every single species features its own unique animation effects. When you are writing code, the pet sits next to your input box, moving around and making various facial expressions.

The Five-Stat Attribute System

Each pet possesses five distinct stats. These are not just for show—they directly dictate the style of interaction your pet will have with you:

Attribute Behavioral Impact
Debugging Influences the pet’s feedback style during debugging scenarios
Patience Affects how the pet behaves while waiting for your input
Chaos Determines the unpredictability of the pet’s actions
Wisdom Influences the “depth” of the pet’s responses
Snark Controls the frequency and intensity of the pet’s roasts about your code
Pet five-stat panel

Higher rarity results in higher base stat values. Every pet randomly designates one stat as its peak strength, one as its critical weakness, and leaves the remaining three at an average level.

Real-World Scenario: Imagine you are debugging a nasty bug late at night. Your pet is hovering nearby. If it is a high-Snark, low-Patience pet, it might frequently “mock” your code. If it is a high-Wisdom, high-Debugging pet, it might offer feedback that feels surprisingly “professional.” The stats are not decorative; they are behavioral control parameters.

In the original author’s case, the very first hatch yielded a White Common Cactus. Because the rarity was at the absolute bottom, the stat distribution was tragic—the highest stat was a mere 62, and the lowest was a devastating 4. This extreme gap in numbers directly and visibly impacted the pet’s interactions.


Bones + Soul: The Technical Details of the Dual-Layer Architecture

The reason the system can guarantee “appearance locked to the account, personality resettable locally” comes down to its elegant dual-layer architecture design.

The Bones Layer: Determining What Your Pet Looks Like

The Bones layer is responsible for generating every visual attribute of your pet: species, eye style, hat, rarity tier, and so on. The generation logic works as follows:

  1. Take your account’s userID
  2. Add a fixed offset value to it
  3. Feed the result through the Mulberry32 pseudorandom number generator algorithm to produce a deterministic random sequence
  4. Extract each visual attribute’s value sequentially from this sequence

Because the input seed (userID + fixed offset) is fixed, and Mulberry32 is a deterministic algorithm, the exact same userID will always generate the exact same pet. It does not matter which computer you log in from, nor does it matter how many times you reinstall Claude Code.

This is precisely why the system tells you that you “cannot re-roll”—your appearance is cryptographically locked to your userID.

The Soul Layer: Determining What Your Pet Acts Like

The Soul layer operates independently from the Bones layer. It is stored locally on your machine. During the very first hatching process, Claude analyzes your pet’s species and visual attributes to generate a unique name and a personality description.

Pet Soul layer information

Soul layer data lives in your local configuration. Theoretically, it can be cleared and regenerated, but the Bones layer cannot be altered—unless you change the userID itself.

Personal Reflection: This design immediately reminded me of NFTs in the blockchain space: metadata is pinned on-chain and is immutable (Bones), while the display layer can be customized by the owner (Soul). Anthropic’s engineers clearly understand the “deterministic randomness + local storage” paradigm deeply rooted in game design. Splitting the unchangeable and the changeable into two distinct layers is a remarkably mature and elegant architectural choice.

Architecture and design concept
Image Source: Unsplash


How to Turn a White Cactus into a Shiny Legendary Capybara

The core principle of changing your pet can be summarized in a single sentence: Changing your userID is equivalent to changing your pet.

The problem is that under normal login flows, the userID (specifically the accountUuid) is bound to your Anthropic account and cannot be forged. The breakthrough lies in a specific logic gap between two different authentication methods.

Normal Login vs. OAuth Token Login Flows

Normal Official Login Flow:
When you use the standard login, Claude Code writes your accountUuid (your unique Anthropic account identifier) into ~/.claude.json. The /buddy command prioritizes reading the accountUuid as the random seed. This value is tied to your account and cannot be forged.

OAuth Token Login Flow (CLAUDE_CODE_OAUTH_TOKEN environment variable):
When you log in using the OAuth token environment variable, Claude Code does not write the accountUuid into ~/.claude.json.

Without an accountUuid present, /buddy falls back to reading the userID field inside ~/.claude.json. And this userID field? You can change it to absolutely anything.

This is the entire exploit in its essence: The two login methods have inconsistent write behaviors to the configuration file, which creates an exploitable degradation path for the random seed source.

Complete Step-by-Step Technical Guide

Step 1: Obtain an OAuth Token
Execute the setup command and follow the prompts to complete authentication.

claude setup-token

Step 2: Clean Up Old Configuration
Delete your existing ~/.claude.json to clear out the old accountUuid, preventing /buddy from prioritizing the old seed.

Step 3: Write a Minimal Configuration File
Create a new ~/.claude.json with only the most basic fields required:

{
  "hasCompletedOnboarding": true,
  "theme": "dark"
}

Note: At this stage, there is no userID and no accountUuid in the file.

Step 4: Launch Claude Code via Environment Variable
Start Claude Code using the CLAUDE_CODE_OAUTH_TOKEN environment variable. The critical part of this step is ensuring this launch method does not write an accountUuid back into your configuration file.

Step 5: Calculate the Target userID
This is where the brute-force magic happens. A community developer wrote a script called buddy-reroll.js that does something incredibly straightforward:

  1. Randomly generate a 32-byte hex string to act as a fake userID
  2. Use the exact same algorithm Claude Code uses (userID + fixed offset → Mulberry32 → attribute mapping) to calculate what pet corresponds to that userID
  3. Evaluate if it matches the target pet (e.g., Legendary rarity + Shiny + Capybara species)
  4. If it does not match, discard it and generate the next userID
  5. Loop this 50 million times—you will eventually collide with the exact userID that yields your desired Shiny Legendary Capybara

Step 6: Write the Target userID
Once the matching userID is found, insert it into your ~/.claude.json:

{
  "hasCompletedOnboarding": true,
  "theme": "dark",
  "userID": "the-hex-string-you-calculated"
}

Step 7: Restart and Verify
Reopen Claude Code, type /buddy, and your target pet will appear instantly.

From a white cactus to a Shiny Legendary Capybara

Scenario Explanation: The practical significance of this operation path lies in the fascinating “bootstrapping” phenomenon it demonstrates—Claude Code is being used to modify Claude Code’s own pet data. An AI tool is utilized to “hack” an easter egg mechanism within its own platform. This meta-operation is arguably more interesting than the easter egg itself.

Equivalent Operations for Third-Party API Users

If you are not using the official login method but are instead accessing Claude Code via a third-party API, the principle remains basically identical. You simply locate the field corresponding to userID in your configuration file and replace it directly with the calculated target value. Because third-party API logins do not generate an accountUuid in the first place, you can skip the bypass step entirely.


The Easier Way: Just Ask Claude Code Directly

The original author discovered an even more surreal operational path. Instead of manually running scripts, you can simply send a screenshot of the re-roll tutorial to Claude Code and tell it what pet you want. Claude Code will automatically execute all the aforementioned steps for you, including skipping Token verification and modifying the configuration file.

Telling Claude Code what you want
Claude Code automatically executing the modification

The author even pasted the wrong URL link when providing the Token. Claude Code responded that the Token was not strictly necessary and that there was a more convenient way to bypass it—then it modified its own files.

Claude Code skipping the Token to modify directly

Personal Reflection: Watching an AI assistant confidently say “I don’t need that credential, I’ll just bypass it and modify myself” is both hilarious and slightly unsettling. It highlights a unique aspect of modern AI coding tools: they have enough contextual understanding of their own infrastructure to act as independent agents for system modification, even when the task is as frivolous as hacking a digital pet.


What Role Does the Mulberry32 Algorithm Play in the Pet System?

A Brief Overview of the Algorithm

Mulberry32 is a lightweight 32-bit pseudorandom number generator (PRNG) created by Tommy Ettinger. Its defining characteristics are:

  • Exceedingly simple implementation, with the core algorithm taking up fewer than 10 lines of code
  • Takes a single 32-bit integer seed as input and outputs a deterministic pseudorandom sequence
  • The same seed will always produce the exact same sequence
  • Incredibly fast execution speed, making it suitable for high-frequency invocation scenarios

Its Function Within the Pet System

The Claude Code Buddy system utilizes Mulberry32 in the following pipeline:

userID (hex string) → Convert to numerical value → Add fixed offset → Use as Mulberry32 seed → Generate random sequence → Map to visual attributes

Because this entire chain is deterministic:

  • Same userID → Same seed → Same sequence → Same pet
  • Different userID → Different seed → Different sequence → Different pet
  • To get a specific pet → Reverse-search for a matching userID

This is exactly why brute-force searching is viable. The algorithm is public, the mapping rules are visible in the leaked source code, and the only variable is the userID itself. Fifty million loops sound like a massive number, but for a lightweight algorithm like Mulberry32, the computational cost is surprisingly manageable.

Personal Reflection: The choice of Mulberry32 over a more complex cryptographically secure pseudorandom number generator (CSPRNG) reveals that Anthropic was pursuing lightweight predictability rather than security for this easter egg. If they had used a CSPRNG, the feasibility of brute-force searching would have plummeted. This proves that the Buddy system was never designed as a feature that “needed protection”—it is an easter egg, a gift to developers.

Probability and dice concept
Image Source: Unsplash


Why Does a “Useless” Feature Deserve Serious Attention?

The Gamification Trend in Developer Tools

Anthropic has progressively rolled out features like the Dreaming mechanism and the Buddy pet system in Claude Code. The shared characteristic of these features is that they contribute absolutely nothing to your actual code output.

However, they are accomplishing something else entirely—pushing developer tools from being “pure efficiency machines” toward becoming “warm-blooded work companions.” Your terminal no longer solely consists of cold logs and error stacks; it now contains a Capybara making cheeky faces while you write bugs.

The Romance of Battling Probability

The original author drew a parallel to Pokémon: in those games, the chance of encountering a Shiny Pokémon is 1/4096. To hunt for one, people have been known to walk through the exact same patch of grass for hundreds of hours.

Does this have any practical meaning? No.

Yet fighting against probability might be one of humanity’s oldest forms of romance.

Now, that romance has been transplanted into the command line. You are in your terminal, chatting with Claude Code, and a Shiny Legendary Capybara is sitting next to your cursor, pulling a ridiculous face.

Is it useful? Not even slightly.

But you cannot help but glance at it, and the corners of your mouth turn up.

Shiny Legendary Capybara interacting in the command line

A Design Philosophy Worth Pondering

What makes Anthropic fundamentally different from many other AI companies is their creativity and inclusivity. They are genuinely applying a game-design mentality to developer tools.

This is not a sarcastic observation; it is a factual statement of their product strategy. One of the most core capabilities in game design is creating experiences where people willingly invest time despite zero practical utility. Pet systems, rarity tiers, Shiny probabilities—these are all classic elements of game design, and Anthropic packed them into a command-line interface.

Personal Reflection: I have seen far too many developer tools reach the absolute extreme of “boosting efficiency,” only to end up powerful but entirely devoid of personality. Claude Code’s Buddy system made me realize that the “personification” of a tool does not necessarily have to be achieved through intelligent dialogue. Sometimes, a Capybara making a funny face while you are struggling with a bug makes you feel “this tool gets me” better than any smart prompt ever could.


Team Testing: A Collective Carnival of “Unlucky” Players

The original author’s team members also tried the /buddy command en masse. Unsurprisingly, the results were a collective batch of “unlucky” pulls.

Team testing results

This outcome perfectly aligns with probability expectations. If the Legendary rarity probability is set low enough (similar to SSR rates in mobile games, typically around 1% to 3%), and you then stack an independent 1% Shiny probability on top of it, the combined probability of a “Shiny Legendary” drops to the one-in-ten-thousand range or even lower. At these odds, the vast majority of first-time hatches will inevitably yield a Common pet.

This also explains exactly why the re-roll method spread so rapidly. When a system makes “rarity” its core mechanic, but the acquisition path is technically locked, the inevitable response of the technical community is to find the key.

Cute animal for context
Image Source: Unsplash


Actionable Checklist

If You Just Want to See Your Pet

  • [ ] Open Claude Code
  • [ ] Type /buddy
  • [ ] Wait for the hatching sequence to complete
  • [ ] Review your species, rarity tier, and stat panel

If You Are a “Power Gamer” and Want a Specific Pet (Manual Method)

  • [ ] Run claude setup-token to obtain an OAuth Token
  • [ ] Delete your existing ~/.claude.json
  • [ ] Write a minimal configuration file (keep only hasCompletedOnboarding and theme)
  • [ ] Launch Claude Code using the CLAUDE_CODE_OAUTH_TOKEN environment variable
  • [ ] Use the buddy-reroll.js script to brute-force search for your target userID (expect ~50 million loops)
  • [ ] Insert the matching userID into ~/.claude.json
  • [ ] Restart Claude Code and type /buddy to verify

If You Want the Easiest Method

  • [ ] Take a screenshot of the re-roll tutorial post
  • [ ] Send the screenshot directly to Claude Code in your chat
  • [ ] Tell it explicitly which pet you want
  • [ ] Wait for it to modify its own configuration
  • [ ] Restart and verify

One-Page Summary

Item Details
Feature Name Claude Code Buddy Pet System
Trigger Command /buddy
Launch Date April 1st (confirmed via source code timestamps)
Pet Species 18 total (Duck, Mushroom, Owl, Snail, Ghost, Capybara, etc.)
Rarity Mechanic Tiered rarity system; higher tiers yield higher base stats
Shiny Probability Independent 1% chance, unrelated to rarity tier
Stat System Debugging, Patience, Chaos, Wisdom, Snark
Technical Architecture Bones (visuals, bound to userID) + Soul (personality, local storage)
Random Algorithm Mulberry32, a 32-bit deterministic PRNG
Re-roll Principle OAuth Token login omits accountUuid write → system falls back to editable userID
Brute-Force Volume ~50 million loops required to reliably hit a target combination

Frequently Asked Questions

Q: Is the /buddy command available in all versions of Claude Code?
A: Based on current information, the feature launched on April 1st. The exact version boundaries have not been specified outside of the leaked source code.

Q: Is my pet’s appearance permanently locked? Will it change if I switch computers?
A: It will not change. Appearance is determined by the Bones layer, which is bound to your userID. It is entirely independent of your physical device or the number of times you reinstall the software.

Q: Is the 1% Shiny probability independently calculated every time I type /buddy?
A: No. Because pet appearance is deterministically generated from your userID, the same userID yields the exact same result every single time. There is no concept of “trying multiple times to increase your odds.” The 1% refers to the proportion of possible userID values in the mathematical space that happen to generate a Shiny appearance.

Q: Will re-rolling my pet affect my normal Claude Code usage?
A: The modification only changes the userID field in ~/.claude.json, which exclusively affects the Buddy system’s seed reading. Your other features rely on accountUuid or your OAuth Token, both of which remain completely unaffected.

Q: Can I still re-roll if I use the official standard login method?
A: Standard login writes your accountUuid into the config file, which /buddy prioritizes reading. To re-roll, you must first switch to the OAuth Token login method and clear the existing accountUuid.

Q: Is the Mulberry32 algorithm secure? Could it be reverse-engineered?
A: Mulberry32 is a fully public algorithm by design, and Claude Code’s specific implementation is completely visible in the leaked source code. The system was never engineered for cryptographic security.

Q: Where is my pet’s personality description stored, and what happens if I delete it?
A: Personality description belongs to the Soul layer and is stored locally. If deleted, the next hatching process will regenerate it, but the visual appearance will remain exactly the same.

Q: Which of the 18 species is the rarest?
A: Rarity is not dictated by the species itself, but by the rarity tier mapped from your userID via the algorithm. Any species can theoretically spawn at any rarity level; it is purely a matter of probability distribution.