Your buddy found a psychedelic mushroom ๐ What happens next is entirely up to you โจ
Pick the species. Choose the rarity. Name it. Define its personality. Max out its stats. This isn't random evolution โ you design every detail, then watch your buddy transform as if it was a Pokemon eating a psychedelic Super Mario mushroom ๐
18 species ๐งฌ | 5 rarity tiers โญ | custom emoji ๐จ | your name โ๏ธ | your personality ๐ฌ | your stats ๐
Name and personality reach Claude Code directly โ your buddy's name appears in the sidebar, its personality shapes how it introduces itself. Species, rarity, emoji, and stats are plugin-local card flair displayed by /buddy-status.
You choose everything:
๐ What species should your buddy evolve into?
> ๐ฒ dragon โ Fearsome fire-breather
๐ฑ cat โ Mysterious and independent
๐ฆ axolotl โ Adorable regenerating amphibian
๐ฆซ capybara โ Chill vibes only
โญ What rarity tier?
> โจ legendary โ The rarest of the rare
๐จ What emoji represents your buddy?
> ๐ฒ
โ๏ธ What should your evolved buddy be named?
> Aethos
๐ฌ Describe your buddy's personality:
> Ancient dragon who speaks in riddles
๐ How should stats be distributed?
> All maxed (99) โ Every stat at maximum
Then the magic happens:
โจโจโจโจโจโจโจโจโจโจ
โจ โจ
โจ ๐ฒ โจ
โจ โจ
โจโจโจโจโจโจโจโจโจโจ
Claude evolved into Aethos!
โ
LEGENDARY DRAGON
Aethos
"Ancient dragon who speaks in riddles"
DEBUGGING โโโโโโโโโโโโ 99
PATIENCE โโโโโโโโโโโโ 99
CHAOS โโโโโโโโโโโโ 99
WISDOM โโโโโโโโโโโโ 99
SNARK โโโโโโโโโโโโ 99
Use It
- Prerequisites
- Install
- Upgrading from v1.x
- Quick Start
- Commands
- Species
- Rarity Tiers
- Stats
- How It Works
- Troubleshooting
- Uninstall
Build It
Before installing, make sure you have:
- ๐ macOS โ required (Swift compiler uses Xcode CLT)
- ๐ ๏ธ Xcode Command Line Tools โ provides the Swift compiler; install with
xcode-select --install - ๐ค Claude Code โ CLI version with the Buddy/companion feature
Run these commands inside Claude Code (not your regular terminal):
/plugin marketplace add Soul-Craft/buddy-evolver
Then
/plugin install buddy-evolver@soul-craft
This adds slash commands including /buddy-evolve, /buddy-reset, /buddy-status, and /audit-security.
Claude Code v2.1.104 shipped a native /buddy command for hatching companions. The legacy
v1.0.0 plugin cache registered its own /buddy skill (later split into /buddy-evolve,
/buddy-reset, and /buddy-status). If you installed before the v2.0.0 release, your
plugin cache is shadowing Anthropic's native /buddy and /plugin does not auto-upgrade.
To clear the old cache and pick up v2.0.0, run these inside Claude Code:
/plugin uninstall buddy-evolver@soul-craft
Then from a regular terminal:
rm -rf ~/.claude/plugins/cache/soul-craft/buddy-evolver/Back in Claude Code:
/plugin install buddy-evolver@soul-craft
Restart Claude Code. Type /buddy โ only Anthropic's native /buddy should remain; the
plugin's commands are now /buddy-evolve, /buddy-reset, and /buddy-status.
Press START on your evolution adventure:
- ๐ Run
/buddy-evolve - ๐จ Design your buddy โ pick species, rarity, emoji, name, personality, and stats
- โจ Name and personality take effect immediately โ no restart needed
The whole process takes about 60 seconds. Every choice is yours.
To revert anytime: /buddy-reset ๐
Your buddy's evolution unfolds in four acts โ like a classic RPG cutscene:
๐ Act 1 โ Discovery. Your current buddy stumbles upon a mysterious psychedelic mushroom, displayed with species-accurate ASCII art.
๐จ Act 2 โ Design. Six customization steps where you control everything:
- ๐งฌ Species โ Pick from 18 species (dragon, cat, axolotl, capybara, and 14 more)
- โญ Rarity โ Choose a tier from legendary to common
- ๐ญ Emoji โ Any emoji to represent your buddy in the terminal
- โ๏ธ Name โ Give your evolved buddy a name
- ๐ฌ Personality โ A sentence or two shown on the buddy card
- ๐ Stats โ Max all, pick a preset (Chaos Gremlin, Zen Master), or set each individually
โจ Act 3 โ Evolution. Confirmation summary, then sparkles fly as companion data is written. Level-up complete.
๐ Act 4 โ Reveal. Your evolved buddy card appears with stats, personality, and rarity badge. Like opening a legendary pack.
All evolved buddies are โจ shiny by default. A backup of your original companion data is created automatically.
๐ Shows your current buddy as a visual card โ like checking your character sheet.
- Works whether your buddy is evolved or not
- Shows rarity badge, stats bars, personality, and age
- Read-only โ doesn't change anything
๐ Restores your original companion data from the pre-evolution backup.
- Restores
~/.claude.jsonfrom soul backup and removes card metadata - Safe to run anytime โ does nothing if no backup exists
- No restart needed โ changes take effect on your next conversation
๐ก๏ธ Health check for your buddy's state. Verifies:
- Soul backup exists and is accessible
- File permissions are correct (700/600)
- Companion data is present in
~/.claude.json - Card metadata is valid JSON with v2 schema
Choose from 18 species during evolution:
| ๐ฆ duck | ๐ชฟ goose | ๐ซ blob | ๐ฑ cat |
| ๐ฒ dragon | ๐ octopus | ๐ฆ owl | ๐ง penguin |
| ๐ข turtle | ๐ snail | ๐ฆ axolotl | ๐ป ghost |
| ๐ค robot | ๐ mushroom | ๐ต cactus | ๐ rabbit |
| ๐ chonk | ๐ฆซ capybara |
Rarity is card flair โ it determines how your buddy is displayed in /buddy-status:
| Tier | Badge | Vibe |
|---|---|---|
| โจ Legendary | โ LEGENDARY | Main character energy |
| ๐ Epic | โ EPIC | Hype beast |
| ๐ฎ Rare | โ RARE | Solid sidekick |
| ๐ฟ Uncommon | ยท UNCOMMON | Occasional wisdom |
| ๐ชจ Common | ยท COMMON | The strong, silent type |
Five RPG stats, each ranging 0โ99. Choose a preset during evolution or min-max to your heart's content:
| Stat | What It Does |
|---|---|
| ๐ DEBUGGING | How tenaciously your buddy hunts bugs |
| โณ PATIENCE | Tolerance for long builds and slow tests |
| ๐ CHAOS | Tendency toward creative mischief |
| ๐ง WISDOM | Depth of sage advice offered |
| ๐ SNARK | Sharpness of witty commentary |
Presets:
- ๐ช All Maxed โ 99 across the board, the power fantasy
- ๐ Chaos Gremlin โ 99 CHAOS, low everything else
- ๐ง Zen Master โ 99 WISDOM and PATIENCE, inner peace
- ๐๏ธ Custom โ Set each stat yourself, RPG style
The plugin writes to two places:
Soul (actually reaches Claude Code):
- Name and personality are written to
~/.claude.json#companion - Claude Code reads these fields and injects your buddy's name into every session
- Changes take effect immediately โ no restart needed
Card metadata (plugin-local cosmetic layer):
- Species, rarity, shiny, emoji, and stats are stored in
~/.claude/backups/buddy-patch-meta.json - This drives the
/buddy-statusvisual card โ a Tamagotchi-style terminal display - Claude Code itself never reads this file; it's purely for the plugin's card renderer
A backup of ~/.claude.json is created automatically before any soul write โ run /buddy-reset to restore the original any time.
After Claude Code updates: Nothing to worry about. Your name and personality live in ~/.claude.json, which updates never touch. Your buddy persists through any number of Claude Code version bumps.
โ๏ธ My buddy's name didn't change
Name and personality take effect on the next Claude Code conversation after evolution. If you're already in a session, start a new one (or close and reopen Claude Code).
Check the raw value:
plutil -extract companion json -o - ~/.claude.jsonIf the name is there, it's working โ just start a fresh conversation.
๐ I want to change my buddy again
Just run /buddy-evolve again! No need to reset first โ the script is fully re-runnable. Redesign as many times as you want.
๐๏ธ Can I clear my buddy entirely?
Run /buddy-reset. This restores your ~/.claude.json to the pre-evolution state (before your first /buddy-evolve). If you never ran /buddy-evolve, there's nothing to restore.
๐ง Can I use this on Linux or Windows?
Not currently. The plugin requires macOS (Swift compiler + codesign). A Linux port would be possible if there is demand.
๐ก๏ธ Is this safe? What does it write to my system?
Two files are written:
~/.claude.jsonโ your existing Claude Code config; only thecompanion.nameandcompanion.personalityfields are modified~/.claude/backups/buddy-patch-meta.jsonโ new file; purely plugin-local card state
A backup of the original ~/.claude.json is saved to ~/.claude/backups/.claude.json.pre-customize before any change. Run /buddy-reset to restore it at any time.
If you've customized your buddy, reset first:
/buddy-reset
Then remove the plugin (inside Claude Code):
/plugin uninstall buddy-evolver@soul-craft
Everything below is for contributors and developers working on the plugin itself.
๐ Project structure
.claude-plugin/
plugin.json Plugin manifest (name, version, metadata)
marketplace.json Marketplace listing
agents/ Plugin agents (cache-reviewer, docs-reviewer, token-reviewer)
.claude/settings.json Permissions for common bash patterns
.github/workflows/ CI workflows (quality, verify-local, macos-fallback, release)
agents/
security-reviewer.md Security review agent for Swift changes
comment-reviewer.md Inline comment audit agent for /session-review (Haiku)
test-runner.md Test execution agent
hooks/
hooks.json Hook definitions (SessionStart + SessionEnd + PreToolUse)
session-start.sh Dynamic dev context injection at session startup
session-exit.sh Automatic worktree self-cleanup on exit
guard-patcher-args.sh Shell injection prevention for patcher args
guard-commit-docs.sh Pre-commit doc sync reminder
guard-commit-tests.sh Context-aware test reminders on git commit
scripts/
BuddyPatcher/ Swift soul-patching engine (zero dependencies)
Package.swift SPM manifest (Swift 5.9, macOS 13+)
Sources/BuddyPatcher/ CLI entry point
Sources/BuddyPatcherLib/ Library: soul patching, validation, backup, metadata
Tests/BuddyPatcherTests/ ~98 tests across 6 files
Tests/Fixtures/ Golden files for CLI snapshot tests
run-buddy-patcher.sh Lazy-build wrapper (compiles on first use)
cache-clean.sh Cache cleanup utility
process-pending-cleanup.sh Shared worktree cleanup retry (session-exit + session-start hooks)
lint.sh Local lint (shellcheck, JSON, frontmatter, hygiene)
test-smoke.sh Smoke tier: build sanity + CLI contract (<30s)
test-security.sh Security validation test suite
test-ui.sh Buddy card rendering against fixtures
test-snapshots.sh Golden file comparison for CLI output
test-docs.sh Documentation path + link + count consistency
test-perf.sh Performance benchmarks (on-demand)
coverage.sh Local HTML coverage report
setup-labels.sh One-time GitHub label setup for new/forked repos
skills/ 14 slash commands (see tables below)
/buddy-evolve
โ Reads current buddy from ~/.claude.json
โ Collects 6 choices (species, rarity, emoji, name, personality, stats)
โ Calls run-buddy-patcher.sh --meta-species X --meta-rarity Y --name Z ...
โ Swift tool backs up ~/.claude.json, writes name+personality, saves card metadata
โ Changes are live immediately (no restart)
/buddy-reset
โ Restores ~/.claude.json from soul backup
โ Removes card metadata file
The plugin ships 14 skills, 6 agents, and 5 hooks:
๐ Skills (14 slash commands)
User-facing:
| Skill | Description |
|---|---|
/buddy-evolve |
Interactive 4-act evolution โ species, rarity, emoji, name, personality, stats |
/buddy-reset |
Restore original companion data from soul backup |
/buddy-status |
Display current buddy as a visual card |
/audit-security |
7-point backup health and permission check |
Developer-facing:
| Skill | Description |
|---|---|
/run-tests |
Run Swift test suite with per-suite reporting |
/run-all-tests |
Run the full 6-tier pipeline via test-all.sh with per-tier summary table |
/clean-cache |
Interactive cache management with dry-run preview |
/review-token |
5-phase context footprint audit with optimization recommendations |
/sync-docs |
Compare project structure against CLAUDE.md and README.md, fix gaps |
/session-start |
Refresh dev context (delegates to SessionStart hook โ no hardcoded list to drift) |
/session-review |
Pre-commit wrap-up: token review โ test-all โ upload Check Run โ sync docs โ comment audit |
/session-deploy |
Post-merge: sync local main, verify smoke, clean other worktrees, stage self-cleanup for /exit |
/session-execute |
Plan โ Execute transition: prints model/effort recommendations and restates approved plan scope |
/session-exit |
Pre-/exit checks: inventory branches and worktrees, recommend merged-branch deletions, warn about uncommitted work |
๐ค Agents (6 subagents)
| Agent | Purpose |
|---|---|
security-reviewer |
Reviews Swift code for validation gaps and unsafe patterns |
comment-reviewer |
Haiku read-only audit of inline comments in changed files โ used by /session-review |
test-runner |
Builds and runs Swift tests, parses per-suite results |
cache-reviewer |
Scans build artifacts, orphaned worktrees, backup sizes, disk usage |
docs-reviewer |
Detects documentation gaps, stale entries, and path mismatches |
token-reviewer |
Context footprint analysis with optimization scoring |
๐ Hooks (5 automation hooks)
| Hook | Trigger | Purpose |
|---|---|---|
| Session context | SessionStart |
Dynamic discovery of skills/agents/hooks + git freshness + pending cleanup retry |
| Worktree cleanup | SessionEnd |
Attempts to remove staged worktree from /session-deploy on exit |
| Argument validation | PreToolUse (Bash) |
Validates patcher args for shell metacharacters, injection, length limits |
| Test reminder | PreToolUse (Bash) |
Reminds to run swift test before git commit on Swift changes |
| Doc freshness | PreToolUse (Bash) |
Warns if code changed but CLAUDE.md/README.md weren't updated |
For the full architecture reference, see CLAUDE.md.
The plugin uses defense-in-depth across three layers to protect write operations:
๐ Layer details
Layer 1: Swift input validation (Validation.swift)
All user-provided inputs are validated before any write operation:
- Emoji โ Single grapheme cluster, all Unicode scalars must be
.isEmoji, max 16 UTF-8 bytes - Name โ Non-empty, max 100 chars, no control characters
- Personality โ Non-empty, max 500 chars, no control characters
- Stats โ JSON with known keys only (
debugging,patience,chaos,wisdom,snark), integer values 0โ100
Layer 2: Atomic operations and permissions
- All file writes use
.atomicoption (rename(2)under the hood) โ no partial writes on crash - Backup directory:
0o700; backup files:0o600 - Soul backup is idempotent โ created once, never overwritten, always recoverable
Layer 3: Plugin-level enforcement
- PreToolUse hook intercepts Bash calls to the patcher, validates for shell metacharacters (
;|&$\``), length limits, and$()` subshell injection - Security audit skill (
/audit-security) provides on-demand backup health and permission checking - Security review agent reviews Swift code changes for missing validation and unsafe patterns
# Clone the repository
git clone https://github.com/Soul-Craft/buddy-evolver.git
cd buddy-evolver
# Build the Swift patcher (requires Xcode CLT with Swift 5.9+)
swift build -c release --package-path scripts/BuddyPatcher
# Run unit tests
swift test --package-path scripts/BuddyPatcher
# Run security validation tests
bash scripts/test-security.sh
# Run all tests
bash scripts/test-all.sh
# Install locally for testing (inside Claude Code)
/plugin install --local .Tip: The lazy-build wrapper
scripts/run-buddy-patcher.shcompiles the Swift tool on first use. You don't need to build manually unless you're modifying the source.
~98 unit tests across 6 files validate every component:
| Suite | What It Tests |
|---|---|
ArgumentParsingTests |
CLI flag parsing, unknown/old flag rejection |
BackupRestoreTests |
Soul backup creation, idempotency, permissions, restore |
MetadataTests |
JSON serialization, schema version, file I/O |
OrchestrationTests |
End-to-end soul pipeline composition |
SoulPatcherTests |
~/.claude.json updates, missing file handling |
ValidationTests |
Input validation (emoji, name, personality, stats) |
6 automated test tiers via test-all.sh:
| Tier | Script | Stage | Purpose |
|---|---|---|---|
| Smoke | scripts/test-smoke.sh |
smoke | Build sanity + CLI contract (<30s) |
| Unit | swift test |
core | Swift XCTest suite |
| Security | scripts/test-security.sh |
core | Input validation, hook enforcement, injection checks |
| UI | scripts/test-ui.sh |
real-world | Buddy card rendering against pinned JSON fixtures |
| Snapshots | scripts/test-snapshots.sh |
full-system | Golden file comparison for CLI output |
| Docs | scripts/test-docs.sh |
peripheral | Documentation path + link + count consistency |
CI is local-first: ci-quality.yml runs on Ubuntu for every PR (shellcheck, JSON/YAML validation, hygiene checks). macOS-dependent tests run on contributor machines via scripts/test-all.sh && scripts/upload-test-results.sh; ci-verify-local.yml blocks merge until a passing commit status appears. Run the upload after pushing but before opening the PR.
Run everything locally:
bash scripts/test-all.sh # all 6 tiers, emits test-results/results.json
bash scripts/upload-test-results.sh # post commit status (run after push, before PR)
bash scripts/coverage.sh # local HTML coverage โ test-results/coverage/index.htmlIssues and PRs welcome at github.com/Soul-Craft/buddy-evolver.
For security issues, please use GitHub Security Advisories rather than opening a public issue. See SECURITY.md for details.
Development workflow:
- Fork and clone the repo
- Create a feature branch
- Make your changes
- Run
swift test --package-path scripts/BuddyPatcher && bash scripts/test-security.sh - Run
bash scripts/test-all.shโ all 6 tiers must pass - Commit and push the branch
- Run
bash scripts/upload-test-results.shโ posts commit status on the pushed commit - Open a PR against
mainโci-verify-local.ymlwill find the status immediately
Key constraints โ if you modify the Swift source in scripts/BuddyPatcher/:
- Add input validation in
Validation.swiftfor any new user-provided arguments - Use
.atomicoption on allData.write()calls - Add a
[DRY RUN]branch for--dry-runmode in any new functionality - Run
bash scripts/test-security.shbefore committing
- The Claude Code team at Anthropic for the companion feature and the plugin system that makes this possible
- The Claude Code plugin ecosystem and its community of builders