fix(commands): register /caveman-stats so Claude Code doesn't reject it (#470)#505
Open
ousamabenyounes wants to merge 1 commit into
Open
fix(commands): register /caveman-stats so Claude Code doesn't reject it (#470)#505ousamabenyounes wants to merge 1 commit into
ousamabenyounes wants to merge 1 commit into
Conversation
…an-stats Without commands/caveman-stats.toml on disk Claude Code rejects /caveman-stats as 'Unknown command' before the UserPromptSubmit hook in src/hooks/caveman-mode-tracker.js can intercept it. README and INSTALL.md both advertise the command; this brings the slash command registry in line with the docs. Fixes JuliusBrussee#470 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #470
commands/ships only 4.tomlfiles (caveman.toml,caveman-commit.toml,caveman-init.toml,caveman-review.toml).caveman-stats.tomlis missing,so Claude Code rejects
/caveman-statsasUnknown commandbefore theUserPromptSubmithook insrc/hooks/caveman-mode-tracker.jsever sees theprompt — even though both README.md and INSTALL.md advertise the command and
the hook contains a
statsMatchregex that intercepts and injects the statsoutput as the hook reason.
This PR adds the missing
commands/caveman-stats.tomlso the slash commandis registered. The
promptfield is/caveman-stats {{args}}so the resolvedprompt (after args substitution) matches the live hook regex and reaches the
existing stats handler.
Test verification (RED → GREEN)
Three regression tests live in
tests/installer/slash-commands.test.mjs. Theymirror the live hook regex from
src/hooks/caveman-mode-tracker.jsso theystay representative if the hook shifts.
RED (with
commands/caveman-stats.tomlstashed):GREEN (with the new toml applied):
Full suite baseline preserved:
npm test→ 47 pass / 4 fail (4 pre-existing opencode-installer failures, unrelated)npm test→ 50 pass / 4 fail (same 4, plus the 3 new tests above)No green test flipped to red.
Files changed
commands/caveman-stats.toml/caveman-statswith description +prompt = "/caveman-stats {{args}}"so the resolved prompt matches the existing hook regex.tests/installer/slash-commands.test.mjsdescription, and prompt-matches-hook-regex for #470.