How cpaczek/any-buddy works
any-buddy is a Claude Code companion-pet customizer and binary patching tool. Users enter through the CLI, choose or configure a pet in the TUI or with flags, search for a matching salt, and apply it to Claude Code; they can also preview, restore, rename, manage personalities, and switch saved profiles. The graph includes the documented builder, presets, and saved-buddy experiences alongside sampled generation, patching, and configuration modules. Some command implementations were not excerpted, so those documented paths and relationships are represented only where README or index evidence supports them.
Main entry points: apply/index.ts Apply flow · interactive.ts Interactive flow · preflight.ts Preflight checks · tui/index.ts Command router
Components 23
CLI and TUI
- CLI entry
src/cli.ts - Command router
src/tui/index.ts - Interactive flow
src/tui/commands/interactive.ts - Apply flow
src/tui/apply/index.ts - Restore command
src/tui/commands/restore.ts
Pet Customization
- Pet builder
src/tui/builder/index.ts - Builder state
src/tui/builder/state.ts - Curated presets
src/presets.ts - Personality options
src/personalities.ts
Generation and Search
- Pet generation
src/generation/roll.ts - Hash computation
src/generation/hash.ts - Salt search
src/finder/orchestrator.ts - Search workers
src/finder/worker.ts
Binary and Configuration
- Binary patching
src/patcher/patch.ts - Binary discovery
src/patcher/binary-finder.ts - Preflight checks
src/patcher/preflight.ts - Pet profiles
src/config/pet-config.ts - Claude settings
src/config/claude-config.ts - Auto-patch hooks
src/config/hooks.ts
Preview and Profiles
- Preset browser
src/tui/presets/index.ts - Saved buddies
src/tui/gallery/index.ts - Sprite rendering
src/sprites/render.ts
Other components
- Pet owner
Connections 26
- Pet owner → CLI entry: runs
README.md - CLI entry → Command router: dispatches
src/cli.ts - Command router → Interactive flow: routes to
src/tui/index.ts - Command router → Restore command: routes to
src/tui/index.ts - Interactive flow → Pet builder: opens builder
src/tui/commands/interactive.ts - Pet builder → Builder state: updates
src/tui/builder/index.ts - Interactive flow → Curated presets: reads
src/tui/commands/interactive.ts - Interactive flow → Apply flow: starts apply
src/tui/commands/interactive.ts - Preset browser → Curated presets: browses
src/tui/presets/index.ts - Pet builder → Sprite rendering: renders preview
- Apply flow → Pet generation: generates pet
src/tui/apply/index.ts - Pet generation → Hash computation: computes hash
src/generation/roll.ts - Apply flow → Salt search: searches salt
src/tui/apply/index.ts - Salt search → Binary discovery: locates binary
src/finder/orchestrator.ts - Apply flow → Binary patching: patches binary
src/tui/apply/index.ts - Preflight checks → Binary discovery: checks binary
src/patcher/preflight.ts - Preflight checks → Binary patching: restores if needed
src/patcher/preflight.ts - Preflight checks → Pet profiles: loads config
src/patcher/preflight.ts - Apply flow → Pet profiles: saves profile
src/tui/apply/index.ts - Apply flow → Claude settings: updates companion
src/tui/apply/index.ts - Apply flow → Auto-patch hooks: sets up hook
README.md - Saved buddies → Pet profiles: switches profiles
README.md - Restore command → Binary patching: restores binary
README.md - Restore command → Auto-patch hooks: removes hook
README.md - Interactive flow → Personality options: offers personality
src/tui/commands/interactive.ts - Salt search → Search workers: delegates search