Claude Code Buddy Modification Guide: Paano Makakuha ng Shiny Legendary Pet

4/2/2026
7 min read

Claude Code Buddy Modification Guide: Paano Makakuha ng Shiny Legendary Pet

Noong Abril 1, 2026, tahimik na inilunsad ng Anthropic ang isang Easter egg feature sa Claude Code 2.1.89 — /buddy pet system. Kapag nag-type ka ng /buddy sa terminal, isang ASCII style na maliit na hayop ang "huhulma" sa tabi ng iyong input box, kasama ka sa pagsusulat ng code at pag-criticize ng bug.

Bawat Buddy ay nabuo mula sa account ID gamit ang deterministic algorithm, nangangahulugang ang parehong account ay palaging makakakuha ng parehong pet. Ngunit sa pamamagitan ng pagbabago ng userID sa configuration file, maaari nating "i-re-roll" ang nais na pet. Detalyado naming tatalakayin ang prinsipyo ng algorithm at ang kumpletong modification script.

I. Pangkalahatang-ideya ng Buddy System

18 Uri ng Species

Sa kasalukuyan, ang sistema ay naglalaman ng 18 cute na species:

  • duck - Bibe (classic na Rubber Duck Debugging)

  • goose - Gansa (pilyo)

  • blob - Jelly (malambot at hindi tiyak)

  • cat - Pusa (mataas ang lipad)

  • dragon - Dragon (makapangyarihang tagapangalaga)

  • octopus - Pugita (multi-threaded na pag-iisip)

  • owl - Kuwago (matalinong guro)

  • penguin - Penguin (pormal na pagdalo)

  • turtle - Pagong (matatag at maaasahan)

  • snail - Suso (mabagal ngunit maingat)

  • ghost - Multo (nawawala at lumilitaw)

  • axolotl - Axolotl (cute at nakapagpapagaling)

  • capybara - Capybara (mabait na guro)

  • cactus - Cactus (nakakaaliw na halaman)

  • robot - Robot (rasyonal na pag-iisip)

  • rabbit - Kuneho (masigla)

  • mushroom - Kabute (tahimik na nagmamasid)

  • chonk - Matabang hayop (bilog at malambot)

5 Antas ng Rarity

  • Common (Karaniwan) - 60% na posibilidad, walang dekorasyon na sumbrero

  • Uncommon (Bihira) - 25% na posibilidad, nag-unlock ng sumbrero

  • Rare (Bihira) - 10% na posibilidad, higit pang dekorasyon

  • Epic (Epiko) - 4% na posibilidad, eksklusibong dekorasyon

  • Legendary (Legendaryo) - 1% na posibilidad, pinakamataas na dekorasyon
Mayroon ding hiwalay na 1% Shiny (Kislap) na posibilidad, ang mga shiny pets ay may rainbow-colored na micro-animation! Ang posibilidad ng shiny legendary ay 1% × 1% = 0.01%, mga isa sa sampung libo.

II. Malalim na Pagsusuri ng Prinsipyo ng Algorithm

Ang pagbuo ng Buddy ay gumagamit ng deterministic random algorithm, ang pangunahing proseso ay ang mga sumusunod:

1. Pagsasama ng Seed String

const SALT = "friend-2026-401"; // Abril 1 na Easter egg const key = userId + SALT;

Ang Salt value na friend-2026-401 ay kumakatawan sa Abril 1 — isang maingat na dinisenyong Easter egg.

2. FNV-1a 32-bit Hash

I-convert ang seed string sa 32-bit integer:

function hashString(s) { let h = 2166136261; // FNV offset basis for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 16777619); // FNV prime } return h >>> 0; }

3. Mulberry32 PRNG

Gamitin ang hash value upang i-initialize ang pseudo-random number generator: function mulberry32(seed) { let a = seed >>> 0; return function() { a |= 0; a = (a + 0x6d2b79f5) | 0; let t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; }

Mulberry32 ay isang magaan na PRNG na karaniwang ginagamit sa pagbuo ng laro, na angkop para sa programatikong pagbuo at mga talahanayan ng loot drop.

4. Pagkuha ng Rarity (Mahalaga!)

const RARITIES = ["common", "uncommon", "rare", "epic", "legendary"]; const RARITYWEIGHTS = { common: 60, uncommon: 25, rare: 10, epic: 4, legendary: 1 };

function rollRarity(rng) { const total = 60 + 25 + 10 + 4 + 1; // = 100 let roll = rng() total; for (const rarity of RARITIES) { roll -= RARITYWEIGHTS[rarity]; if (roll < 0) return rarity; } return "common"; }

重要:RARITIES 数组的顺序必须是从低到高,这是加权随机选择的标准实现。

三、完整 Reroll 脚本

以下脚本可以搜索并生成闪光传说级 Buddy 的 userID:

// Claude Code Buddy Reroll 脚本 // 基于 Claude Code 源码逆向分析

// FNV-1a 32-bit hash function hashString(s) { let h = 2166136261; for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 16777619); } return h >>> 0; }

// Mulberry32 PRNG function mulberry32(seed) { let a = seed >>> 0; return function() { a |= 0; a = (a + 0x6d2b79f5) | 0; let t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; }

const SPECIES = [ "duck", "goose", "blob", "cat", "dragon", "octopus", "owl", "penguin", "turtle", "snail", "ghost", "axolotl", "capybara", "cactus", "robot", "rabbit", "mushroom", "chonk" ];const RARITIES = ["common", "uncommon", "rare", "epic", "legendary"]; const RARITYWEIGHTS = { common: 60, uncommon: 25, rare: 10, epic: 4, legendary: 1 }; const SALT = "friend-2026-401";

function pick(rng, arr) { return arr[Math.floor(rng() arr.length)]; }

function rollRarity(rng) { const total = Object.values(RARITYWEIGHTS).reduce((a, b) => a + b, 0); let roll = rng() total; for (const rarity of RARITIES) { roll -= RARITY_WEIGHTS[rarity]; if (roll < 0) return rarity; } return "common"; }

function testUserId(userId) { const key = userId + SALT; const seed = hashString(key); const rng = mulberry32(seed); const rarity = rollRarity(rng); const species = pick(rng, SPECIES); const shiny = rng() < 0.01; return { rarity, species, shiny }; }

function randomUserId() { let id = ""; for (let i = 0; i < 64; i++) { id += Math.floor(Math.random() 16).toString(16); } return id; }

// Maghanap ng shiny legendary console.log("Maghanap ng shiny legendary Buddy...\n"); const targetSpecies = process.argv[2] || null;

while (true) { const userId = randomUserId(); const result = testUserId(userId);

if (result.rarity === "legendary" && result.shiny) { if (!targetSpecies || result.species === targetSpecies) { console.log("Nahanap na!"); console.log("Species:", result.species); console.log("Rarity: Legendary"); console.log("Shiny: Oo!"); console.log("userID:", userId); break; } } } }

IV. Mga Hakbang sa Paggamit

  • I-save ang script: I-save ang nakasaad na code bilang buddy-reroll.js

  • Patakbuhin ang script: node buddy-reroll.js (maaaring tukuyin ang species: node buddy-reroll.js dragon)

  • Kopyahin ang userID: Ang script ay magbibigay ng userID ng isang shiny legendary Buddy.- Baguhin ang Konfigurasyon
# I-edit ang ~/.claude.json cat ~/.claude.json | jq '.userID = "你的新userID" | del(.companion)' > /tmp/claude-new.json && mv /tmp/claude-new.json ~/.claude.json

  • I-restart ang Claude Code,i-type ang /buddy upang makita ang bagong alaga!

Limang, Prinsipyo ng Disenyo Laban sa Pandaraya

Ang disenyo ng Claude Code ay napaka-mahusay, gumagamit ng paghiwalay ng Skeleton (Bones) at Kaluluwa (Soul) na arkitektura:

  • Bones(骨架):uri, bihira, hitsura, katangian——bawat beses na muling kinakalkula mula sa userID, hindi kailanman pinapanatili

  • Soul(灵魂):pangalan, paglalarawan ng personalidad——pinapanatili sa lokal na config
Ibig sabihin, kahit na direktang i-edit mo ang rarity field sa config file, ang sistema ay papalitan ito ng resulta ng roll(userID) kapag binabasa. Ang komento ay nakasulat nang malinaw: editing config.companion can't fake a rarity.

Ngunit ang userID mismo ay maaaring baguhin, dito nakasalalay ang prinsipyo ng pamamaraang ito.

Anim, Buod

Ang Claude Code Buddy ay isang maingat na dinisenyong Easter egg na tampok, pinagsasama ang:

  • Deterministic Randomness:klasikong kumbinasyon ng FNV-1a + Mulberry32

  • Card Draw Mechanism:5 antas ng bihira + 1% shiny, ang diwa ng Gacha games

  • Disenyo Laban sa Pandaraya:paghiwalay ng skeleton/soul, tinitiyak ang patas na laro

  • April Fool's Easter Egg:ang salt value ay nagtatago ng timestamp ng Abril 1
Subukan mo na ngayon! Nawa'y makuha mo ang iyong pinapangarap na shiny legendary Buddy!

Mga Sanggunian:

  • Paglabas ng Source Code ng Claude Code 2.1.89 (npm source map incident)

  • Juejin: "Malalim na Pagsusuri ng Claude Code Buddy Mode: Isang Cactus sa Likod ng Deterministic Random Algorithm"- DEV.to: Pinunit Ko ang Claude Source Code
Published in Technology

You Might Also Like