Companion Collection
Save, list, or switch to a collected companion pet
Your task
Manage the user's companion collection in ~/.claude/plugins/cc-companion/config.json.
The collection field is an array of saved pets:
{
"collection": [
{ "name": "Gold Dragon", "salt": "65lGplfSYq3stdD", "species": "dragon", "rarity": "legendary" },
{ "name": "Capy", "salt": "wLt7wpVaXCIRr8I", "species": "capybara", "rarity": "legendary" }
]
}
Step 1: Read config and ask what to do
Read ~/.claude/plugins/cc-companion/config.json, then ask:
- "save" — save current pet to collection
- "list" — show all collected pets
- "switch" — switch to a collected pet
- "remove" — remove a pet from collection
If save:
- Show current pet:
PLUGIN_DIR=$(ls -d "${CLAUDE_CONFIG_DIR:-$HOME/.claude}"/plugins/cache/cc-companion/cc-companion/*/ 2>/dev/null | awk -F/ '{ print $(NF-1) "\t" $0 }' | sort -t. -k1,1n -k2,2n -k3,3n | tail -1 | cut -f2-)
"$HOME/.bun/bin/bun" "${PLUGIN_DIR}scripts/companion.mjs"
- Ask for a name. Default name is:
<Rarity> [Shiny] [Hat] <Species>in English (e.g. "Legendary Shiny Crown Dragon"). If user confirms, use the default. - Add to
collectionarray in config:{ "name": "<name>", "salt": "<current salt>", "species": "<species>", "rarity": "<rarity>" } - Tell user "Saved!"
If list:
Show all collected pets as a numbered list:
1. Gold Dragon — dragon ★★★★★ legendary
2. Capy — capybara ★★★★★ legendary
If collection is empty, say "No pets collected yet."
If switch:
- List collected pets (numbered)
- Ask user to pick a number
- Set
saltin config to the chosen pet's salt - Tell user the statusline will update automatically
If remove:
- List collected pets (numbered)
- Ask user to pick a number
- Remove from collection array
- Tell user "Removed."