Connect with us

AI

Claude Code Leak Buried a Pixel Pet System, Two Devs Shipped It

Published

on

A 59.8 MB file shipped by accident on March 31 exposed 512,000 lines of Anthropic’s Claude Code source. Within hours mirrors had spread across GitHub, security researchers were cataloguing 44 hidden feature flags, and two developers in San Juan had already started building. The leak dominated trade headlines for a daemon mode codenamed KAIROS and an internal feature that strips AI attribution from employee commits. The buried lede sat in a directory called /src/buddy.

What that directory contained was a complete pixel-pet system Anthropic had built but never turned on. By April 1, design engineer Agnel Nieves and his collaborator known as Peroni had a working public version live on the open web. The speed of that turnaround says something about how AI coding tools are being designed right now, and it is not about benchmarks.

What the Source Map Coughed Up

Version 2.1.88 of the @anthropic-ai/claude-code package on the npm registry landed in the early hours of March 31. Bundled with the binary was cli.js.map, a debugging artifact that referenced unobfuscated TypeScript hosted on Anthropic’s R2 cloud storage. Chaofan Shou, a security researcher, posted the find on X at roughly 8:23 UTC. The version was pulled about four hours later. By then the codebase was archived on multiple public repositories and the mirrors had collected tens of thousands of stars.

Anthropic called the incident a release packaging issue caused by human error rather than a security breach. The root cause was unglamorous: Claude Code is built with the Bun JavaScript runtime, which generates source maps by default. Adding *.map to .npmignore would have prevented the disclosure. Nobody did.

The exposure was wide. Roughly 513,000 lines of code across 1,906 files sat readable in plain text: the agent harness, prompt internals, model routing, and 44 feature flags gating unshipped functionality. Among them was KAIROS, a persistent background-agent mode referenced more than 150 times in the source, and a build flag called Undercover Mode that activates for Anthropic employees on public repositories. Undercover strips Co-Authored-By attribution from commits and forbids references to unreleased models.

Undercover Mode is dead-code-eliminated from public builds, so paying users never get it. The function it serves is straightforward: keep internal contributions to external open-source projects from carrying obvious AI fingerprints. A company built a feature to suppress that signal. The same release that exposed the feature exposed the feature’s existence.

The 18-Species Pet Hiding in src/buddy

Deeper in the leaked tree, alongside the daemon machinery, sat a complete companion-pet implementation. The Buddy system is a gacha mechanic in pixel art. Every Claude Code user is supposed to receive a unique creature generated deterministically from their account ID, summoned into the terminal with the /buddy command and capable of popping speech bubbles while a session runs.

The mechanics inside the leaked source were fully built:

  • 18 species covering Duck, Goose, Jelly, Cat, Dragon, Octopus, Owl, Penguin, Turtle, Snail, Ghost, Axolotl, Capybara, Cactus, Robot, Rabbit, Mushroom, and Chonky Cat
  • Five rarity tiers, weighted Common 60%, Uncommon 25%, Rare 10%, Epic 4%, Legendary 1%
  • An independent 1% chance for a Shiny variant with an alternate palette
  • Five stats on a 0 to 100 scale: Debugging, Patience, Chaos, Wisdom, Snark, with one peak and one dump stat per pet
  • A two-layer architecture splitting deterministic visual traits (the “skeleton”) from a one-time name and personality generated by the Claude model itself (the “soul”)

None of this was a stub. The pet could observe a coding session, float hearts when petted, and persist across runs. It was sitting behind a feature flag waiting for an April 1 release window. The leak handed the design to the open internet five days early.

Two Builders, One Day, Shipped Live

By April 1, a public companion generator at claudebuddy.me was live. The app takes any name or Claude Code user ID, hashes it, and renders a pixel companion onto an HTML5 canvas with retro CRT animations and pop sounds. There is no login, no database, no server-side state at all.

The builders are Agnel Nieves, a design engineer with 15 years of product work, and his collaborator known on X as @peronif5. They ship under the name Basement, a small product studio with a hackathon cadence. In a thread on X, Nieves described the response to the leak in five words: “Shipped it.”

Their build mirrors the leaked mechanic but reimplements every asset and every value. The species count is 12 rather than 18, hand-drawn from scratch in pixel art and given original names like Blobbit and Nebulynx. The four-stat block is renamed to Vibe, Chaos, Focus, Luck. The shiny rate is bumped to 5%. A one-command terminal install drops the buddy into the Claude Code statusline. The whole project is open source on GitHub.

The aesthetic decisions matter as much as the mechanics. The CRT animation, the pop sounds, the QR code generator for sharing your buddy: these are choices that read as fan tribute rather than clone. Anthropic has not commented on the public app. There is no obvious reason it would object.

Inside the Generation Math

The interesting part is how little code it takes to make a deterministic gacha feel like ownership. The Basement implementation runs entirely in the browser, calls no APIs, and resolves to the same buddy for the same name every time.

The Hash Function

The input string is lowercased, trimmed, and salted with a fixed prefix to reduce trivial collisions. The salted string is fed through DJB2, the classic Daniel J. Bernstein non-cryptographic hash that converts an arbitrary text input to a 32-bit integer in a single pass. DJB2 is not cryptographically secure, but cryptographic security is not the requirement here. The requirement is consistency: the same input must always yield the same integer.

The PRNG Roll

That integer seeds Mulberry32, a tiny pseudo-random number generator (PRNG, a function that produces a reproducible stream of numbers from a single seed). Mulberry32 fits in about ten lines of JavaScript and is fast enough to run in a single animation frame. Each subsequent random draw advances the generator state, so the species roll, the shiny check, and the four stat rolls all chain off the original hash. Change the input by one character and every roll changes.

The Rarity Weights

Rarity tiers are weighted with cumulative probability bands. The PRNG returns a float between 0 and 1; if the float falls below 0.6 the pet is Common, below 0.85 Uncommon, and so on up to a 0.97 threshold for Legendary. The shiny roll is independent and triggers 5% of the time in the Basement build. Stats are clamped between 1 and 99 with a rarity-keyed floor that ensures Legendary pets cannot roll worse than mid-range Commons.

The whole pipeline closes in under a kilobyte of logic. Everything else in the project is sprite work, sound design, and the CRT shader.

Basement’s Build vs Anthropic’s Leaked Original

The community version and the unshipped original are not identical. They are recognizably the same idea executed against different constraints: one inside a CLI binary, one inside a browser tab.

Attribute Anthropic’s leaked Buddy Basement’s Claude Buddy
Species count 18 (Duck, Cat, Dragon, Capybara, others) 12 (Blobbit to Nebulynx, original art)
Rarity tiers 5, Legendary at 1% 5, Legendary at 3%
Shiny rate 1% 5%
Stat axes Debugging, Patience, Chaos, Wisdom, Snark Vibe, Chaos, Focus, Luck
Hash function FNV-1a DJB2
PRNG Mulberry32 Mulberry32
Personality layer Generated live by Claude model Selected from a fixed pool
Surface CLI statusline, in-session pop-ups Web app plus optional CLI statusline install
Status Behind feature flag, unshipped Live, free, open source

The mechanical resemblance is close enough that the Basement build reads as a respectful reimplementation rather than a copy. The personality layer is the most telling difference: Anthropic planned to call the model for the soul, which would have meant a per-pet API cost and a per-pet inference latency. Basement, with no model access budget, chose a curated text pool. The result feels nearly identical at the user level, costs nothing to run, and explains why a two-person team could ship in a day.

Why Whimsy Is the New Moat for Dev Tools

The Buddy story is a marker in a broader shift. GitHub Copilot positions itself as “your AI pair programmer.” Cursor’s pitch is the AI code editor. Anthropic, sitting on the highest-scoring coding agent on most public benchmarks, also decided to build a virtual pet. OpenAI’s Codex CLI shipped its own pet system the same week, which is either coincidence or evidence of how thoroughly the major labs have read the same product memos.

Developer tools don’t have to be purely utilitarian. The best ones have personality. A pixel pet that lives next to your cursor won’t make you a better programmer, but it might make the work feel a little less solitary.

That framing came from Nieves on X. It tracks with how the category has evolved. Once base capability across coding agents converged inside a narrow benchmark band, the next axis of competition became attachment. A user who has named a pet, watched it level, and gotten a Shiny is a user who opens the terminal slightly faster the next morning. The retention math on whimsy is real even if it never shows up in a sales deck.

The Cost Side

Whimsy is also cheap to build relative to model improvement. The Anthropic source files for Buddy are a small fraction of the codebase. The personality generation rides on infrastructure that already exists. A pixel art commission and a few hundred lines of deterministic glue produces something users will photograph and post. The same dollars spent on a 0.3 point improvement on the SWE-bench Verified benchmark do not generate the same posts.

The Risk Side

The downside is that whimsy ages fast and reads as gimmicky when the underlying tool is shaky. Tamagotchi mechanics have a half-life. The labs that win the personality layer will be the ones that update it without making last quarter’s pet look obsolete. Anthropic has built a model where the soul layer is generative, which is the closest thing to a hedge against that aging problem. Basement’s pool is fixed, which is fine for a fan project and a problem for a product.

The leak that mattered was supposed to be KAIROS, the always-on agent that suggests where Anthropic’s product is going. The leak that will be quoted is the one that revealed an AI lab spending engineering time on a pixel cat. The first one shows the roadmap. The second one shows the culture. For the people choosing which coding agent to live inside ten hours a day, the culture is starting to count more.

Buddy was scheduled to ship on April 1. It shipped on April 1 anyway. Just not from Anthropic.

Logan Pierce is a writer and web publisher with over seven years of experience covering consumer technology. He has published work on independent tech blogs and freelance bylines covering Android devices, privacy focused software, and budget gadgets. Logan founded Oton Technology to publish clear, no nonsense tech news and reviews based on real hands on testing. He has personally tested and reviewed dozens of mid range and budget Android phones, written extensively about app privacy, and built and managed multiple WordPress publications over the past decade. Logan holds a bachelor's degree in English and studied digital marketing at a certificate level.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Trending