The two standalone hook installers copy a file list that omits caveman-parse.js, which caveman-mode-tracker.js requires at module load. Anyone who installs hooks via install.sh / install.ps1 — rather than the plugin or cli/install.js — ends up with a UserPromptSubmit hook that exits 1 on every prompt.
Affected
src/hooks/install.ps1 L27:
$HookFiles = @("package.json", "caveman-config.js", "caveman-activate.js", "caveman-mode-tracker.js", "caveman-stats.js", "caveman-statusline.sh", "caveman-statusline.ps1", "cavecrew-model-overrides.js")
src/hooks/install.sh L40 has the same omission.
src/hooks/caveman-mode-tracker.js L10:
const { parseModeChange, INDEPENDENT_MODES } = require('./caveman-parse');
That is a top-level require, so it throws before the try/catch inside the stdin end handler. The "Hooks must always exit 0" guarantee in the L20-23 comment does not hold for this failure mode.
Reproduction
Copy exactly the 8 files install.ps1 lists into an empty directory, then:
echo '{"prompt":"hello","cwd":"C:/"}' | node caveman-mode-tracker.js
Error: Cannot find module './caveman-parse'
Require stack:
...
exit code 1.
Control: same directory with caveman-parse.js added, same command, exit code 0 and no output.
Environment: Windows 11, Node v24.15.0, repo at ec83e5b.
Not affected
cli/install.js L51 already lists caveman-parse.js, and the plugin path wires hooks from .claude-plugin/plugin.json against the repo tree. Both are fine — only the two shell installers are broken.
Secondary issue in the same files
install.ps1 L25 and install.sh L38 set the remote fallback base to .../main/hooks, but the hooks live under src/hooks/. There is no top-level hooks/ directory, so when either script runs outside a clone, every file in the copy loop 404s:
$ curl -sI https://raw.githubusercontent.com/JuliusBrussee/caveman/main/hooks/caveman-config.js
HTTP/2 404
Suggested fix
Add caveman-parse.js to both file lists, and point the fallback base at main/src/hooks.
The two standalone hook installers copy a file list that omits
caveman-parse.js, whichcaveman-mode-tracker.jsrequires at module load. Anyone who installs hooks viainstall.sh/install.ps1— rather than the plugin orcli/install.js— ends up with aUserPromptSubmithook that exits 1 on every prompt.Affected
src/hooks/install.ps1L27:src/hooks/install.shL40 has the same omission.src/hooks/caveman-mode-tracker.jsL10:That is a top-level require, so it throws before the
try/catchinside the stdinendhandler. The "Hooks must always exit 0" guarantee in the L20-23 comment does not hold for this failure mode.Reproduction
Copy exactly the 8 files
install.ps1lists into an empty directory, then:exit code 1.
Control: same directory with
caveman-parse.jsadded, same command, exit code 0 and no output.Environment: Windows 11, Node v24.15.0, repo at
ec83e5b.Not affected
cli/install.jsL51 already listscaveman-parse.js, and the plugin path wires hooks from.claude-plugin/plugin.jsonagainst the repo tree. Both are fine — only the two shell installers are broken.Secondary issue in the same files
install.ps1L25 andinstall.shL38 set the remote fallback base to.../main/hooks, but the hooks live undersrc/hooks/. There is no top-levelhooks/directory, so when either script runs outside a clone, every file in the copy loop 404s:Suggested fix
Add
caveman-parse.jsto both file lists, and point the fallback base atmain/src/hooks.