Roster (cli.py):
- Fully restructured cmd_roster with four clearly-labelled sections:
BUDDYMON (✓ levels via XP), LANGUAGE MASCOTS (✓ levels via XP),
LANGUAGE AFFINITIES (◑ passive), BUG TROPHY CASE (✗ trophies only)
- Evolution chain shown inline per-buddy (Debuglin → [Verifex] → Veritarch)
- Active buddy marked ← ACTIVE; next-evo target with levels-to-go
- Language affinities show element + 🦎 tag when a mascot is available
- Bug trophy grid: two-column, element tags, notable levels shown
- Writes roster_pending.txt to trigger Stop hook delivery (no truncation)
Stop hook (roster-stop.py + hooks.json):
- New Stop hook reads roster_pending.txt; runs cli.py roster; emits full
output as additionalContext; clears the flag — fires once per invocation
- Avoids Bash tool result truncation for long roster output
Bug fixes (post-tool-use.py):
- get_session_state(): fall through to active.json when buddymon_id is null
or missing (pgrp mismatch between CLI process and hook process)
- get_active_buddy_id(): guard against caught_bug_monster type slipping in
as the active buddy (ThrottleDemon state corruption fix)
- Language "new territory" message now uses affinity XP == 0 as the sole
signal — drops volatile session.json languages_seen check that caused
spurious "New language spotted" fires across sessions
- Already-owned encounter shortcut: instant dismiss with no wound cycle
Language mascots:
- 11 mascots across common/uncommon/rare/legendary tiers (Pythia, Asynclet,
Bashling, Goroutling, Typeling, Vueling, Querion, Ferrix, Perlius,
Cobolithon, Lispling)
- Full evolution chains for all mascots (16 evolutions total in catalog)
- Spawn via PostToolUse after language affinity milestones; probability
scales with affinity level; only fires with no active encounter
- Passive strength reduction: each Write/Edit in the mascot's language
ticks current_strength down (floor 5%, triggers re-announcement)
- Mascot-aware catch formula: base_rate + affinity_bonus (6% per level) +
weakness_bonus + soft element gating via existing player_elements
- Language-themed weakening menu and catch failure messages in CLI
- Caught mascots stored as type="caught_language_mascot"; assignable as buddy
- UserPromptSubmit uses distinct 🦎 announcement with language context
Roster display:
- New "Language Mascots" section between core buddymon and caught bug monsters
- Language affinity table marks languages with spawnable mascots (🦎)
- Discovery counter now tracks both bug monsters and mascots separately
Veritarch (third evolution):
- Debuglin → Verifex (Lv.100) → Veritarch (Lv.200)
- TYPE FORTRESS / INVARIANT PROOF / ZERO FLAKE challenges
- xp_multiplier 1.7, catch_rate 0.90
Script-first architecture:
- All game logic extracted to lib/cli.py (~850 lines); SKILL.md is now
a ~55-line relay — 88% token reduction per invocation
- CLI emits [INPUT_NEEDED] and [HAIKU_NEEDED] markers for interactive flows
- PostToolUse hook re-emits CLI stdout as additionalContext for inline display
Session XP fix:
- statusline.sh and session state now read from sessions/<pgrp>.json
(per-window) with fallback to active.json; fixes stale XP in statusline
Auto-attack rates were flat 50%/35% regardless of encounter rarity or buddy
level, and parallel sessions could each roll independently against the same
encounter — compounding to ~87.5% effective wound rate with 3 sessions open.
Wound rates by rarity (base, before level scaling):
very_common: 55% common: 40% uncommon: 22% rare: 10% legendary: 2%
Auto-resolve rates by rarity:
very_common: 45% common: 28% uncommon: 14% rare: 5% legendary: 1%
Level multiplier: 1.0 + (level / 100) * 0.25 — Lv.44 adds ~11% to each.
So Lv.44 vs common: wound=44%, resolve=31%. Lv.44 vs rare: wound=11%, resolve=6%.
Wound cooldown: encounters stamped with last_wounded_at. Any session that
would wound/resolve within 30s of the last wound is skipped — prevents
parallel sessions from pile-driving the same encounter.
Previously the catch roll script wrote catch_pending=False to disk before
the Bash process exited. The PostToolUse hook fired after exit, saw False,
and could auto-resolve the encounter on the same run as the catch attempt.
Fix: the hook now owns the flag lifecycle.
- Hook clears catch_pending after consuming it (protects exactly one run)
- Roll script never touches catch_pending (no premature clear)
- On failure, flag stays True through the roll, cleared by hook afterward
- Next /buddymon catch call re-sets it at the top as before
Net effect: a failed catch attempt always gets one full clean Bash run of
grace before auto-resolve can fire again.
Each Claude Code session now gets its own state file at:
~/.claude/buddymon/sessions/<pgrp>.json
Contains: buddymon_id, session_xp, challenge — all session-local.
Global active.json keeps the default buddymon_id for new sessions.
/buddymon assign writes to the session file only, so assigning in one
terminal window doesn't affect other open sessions. Each window can
have its own buddy assigned independently.
SessionStart creates the session file (inheriting global default).
SessionStop reads XP from it, writes to roster, then removes it.
Healthy → wounded: 50% per clean run (avg ~2 runs, was instant)
Wounded → fled: 35% per clean run (avg ~3 runs, was instant)
Combined expected clean runs before auto-resolve: ~5, giving the user
a realistic window to type /buddymon catch between tool calls.
catch_pending: set immediately when /buddymon catch is invoked, suppresses
auto-resolve while weakening Q&A is in progress. Cleared before catch roll
(success clears encounter, failure leaves it without the flag so auto-resolve
resumes naturally on the next clean Bash run).
wounded: first clean Bash run without catch_pending drops the encounter to 5%
strength and re-announces via UserPromptSubmit with a fleeing message. Second
clean run auto-resolves it (it fled). UserPromptSubmit now shows distinct
announcement text for wounded vs fresh encounters.
Adds LANGUAGE_TIERS with 6 tiers: discovering → familiar → comfortable
→ proficient → expert → master (thresholds: 0/50/150/350/700/1200 XP).
add_language_affinity() writes to roster.json['language_affinities'],
accumulating across sessions. Returns (leveled_up, old_tier, new_tier)
so the Edit/Write branch can fire a level-up message immediately (Edit
PostToolUse additionalContext surfaces fine).
Session-level languages_seen remains for the one-time Explorer bonus.
Roster skill view updated to show language affinity section.
CC sends Bash results as {stdout, stderr, interrupted, isImage, noOutputExpected}.
Previous code guessed output/content/text — all wrong, so encounter detection
never matched. Confirmed via active.json relay debug.
Bash PostToolUse additionalContext is silently dropped by CC — encounters
are written to state but never surfaced. Fix with a two-phase approach:
- PostToolUse (Bash): detects error, writes encounter with announced:false
- UserPromptSubmit: fires on next user message, checks for unannounced
encounter, surfaces it once, marks announced:true so dedup loop breaks
Removes debug scaffolding and the format_encounter_message call from the
Bash hook (announcement is now fully owned by user-prompt-submit.py).
- Fix session-stop.sh in 0.1.0 cache to use systemMessage instead of
hookSpecificOutput (Stop hook schema doesn't support hookSpecificOutput)
- Remove debug scaffolding from post-tool-use.py
- Installer: pre-create hook_debug.log so sandbox can write to it;
uninstall now removes marketplace plugin symlink
- README: clarify extension vs mod architecture, fix cache path in
install description
When an active encounter exists and the next Bash tool call produces
output with no matching error patterns, the monster is automatically
defeated and XP is awarded — no manual /buddymon fight needed.
/buddymon fight is kept as a manual fallback for fixes that happen
outside Bash (config edits, etc.).
Claude Code plugin — collectible creatures discovered through coding.
- Bug monsters spawn from error output (NullWraith, RacePhantom, ShadowBit, 11 total)
- 5 Buddymon with affinities, challenges, and evolution chains
- SessionStart hook injects active buddy + challenge into system context
- PostToolUse hook detects error patterns, new languages, and commit events
- Stop hook tallies XP and checks challenge completion
- Single /buddymon command with start/assign/fight/catch/roster subcommands
- Local state in ~/.claude/buddymon/ (roster, encounters, active, session)