doctor fails the PreToolUse check against a path that appears in no settings file, and the hook it should have tested works.
What happens
On a compiled-binary install (commitlore 0.2.1 at ~/.local/bin/commitlore), run from a repository root that has the hook configured:
$ commitlore doctor > out.txt 2>&1
$ echo "exit=$?"
exit=1
$ grep '^fail' out.txt
fail PreToolUse hook runtime — the PreToolUse hook exits 127: /bin/bash: /Users/isaac/.local/bin/scripts/commitlore-run.sh: No such file or directory
fix: commitlore inject install-claude-hook
Every other check in the same run is ok, including cli runtime, commit-msg hook, hook runtime and index health.
Why it is wrong
-
scripts/commitlore-run.sh does not exist anywhere under the install prefix:
$ find ~/.local -name 'commitlore-run.sh' # no output
$ ls -d ~/.local/bin/scripts
ls: /Users/isaac/.local/bin/scripts: No such file or directory
The reported path looks like dirname(argv[0]) + "/scripts/commitlore-run.sh", which only resolves in a source checkout, not for a binary installed into a bin directory.
-
That path is not what is configured. The project's .claude/settings.json holds:
{ "matcher": "Read|Edit|Write",
"hooks": [ { "type": "command",
"command": "commitlore inject --hook-input # commitlore-inject-hook" } ] }
commitlore-run appears in no settings file — not .claude/settings.json, not .claude/settings.local.json, not ~/.claude/settings.json, not ~/.claude.json.
-
The configured hook works. Feeding it a real PreToolUse payload:
$ echo '{"tool_name":"Read","tool_input":{"file_path":".../Package.swift"}}' \
| commitlore inject --hook-input > hookout.json 2>&1
$ echo "exit=$?"
exit=0
$ head -c 120 hookout.json
{"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"commitlore: active records for Package.swift
So doctor reports a working hook as broken, and the offered fix: would rewrite a hook that is already correct.
Impact
doctor exits 1, which makes it unusable as a CI or pre-flight gate for any binary install: the one failing check is a false negative that cannot be cleared by fixing anything real. It also mislabels the failure — "the PreToolUse hook exits 127" asserts something about the configured hook, when what exited 127 is a path doctor constructed itself.
Suggested direction
Test what is configured, not a synthesised path: read the PreToolUse entries out of the settings files doctor already locates, and execute the command string it finds there. If no entry is found, the existing warn ... not installed result is already the right answer — that is what the same version reports from a directory with no .claude/settings.json.
Separately, the check is cwd-sensitive in a way worth documenting: from a directory without .claude/settings.json the same binary reports warn PreToolUse hook runtime — not installed in <cwd>/.claude/settings.json and exits 0.
Environment
commitlore 0.2.1, compiled binary, macOS 15.3 (arm64), git 2.50.1 (Apple Git-155).
doctorfails the PreToolUse check against a path that appears in no settings file, and the hook it should have tested works.What happens
On a compiled-binary install (
commitlore 0.2.1at~/.local/bin/commitlore), run from a repository root that has the hook configured:Every other check in the same run is
ok, includingcli runtime,commit-msg hook,hook runtimeandindex health.Why it is wrong
scripts/commitlore-run.shdoes not exist anywhere under the install prefix:The reported path looks like
dirname(argv[0]) + "/scripts/commitlore-run.sh", which only resolves in a source checkout, not for a binary installed into abindirectory.That path is not what is configured. The project's
.claude/settings.jsonholds:{ "matcher": "Read|Edit|Write", "hooks": [ { "type": "command", "command": "commitlore inject --hook-input # commitlore-inject-hook" } ] }commitlore-runappears in no settings file — not.claude/settings.json, not.claude/settings.local.json, not~/.claude/settings.json, not~/.claude.json.The configured hook works. Feeding it a real PreToolUse payload:
So
doctorreports a working hook as broken, and the offeredfix:would rewrite a hook that is already correct.Impact
doctorexits 1, which makes it unusable as a CI or pre-flight gate for any binary install: the one failing check is a false negative that cannot be cleared by fixing anything real. It also mislabels the failure — "the PreToolUse hook exits 127" asserts something about the configured hook, when what exited 127 is a pathdoctorconstructed itself.Suggested direction
Test what is configured, not a synthesised path: read the
PreToolUseentries out of the settings filesdoctoralready locates, and execute thecommandstring it finds there. If no entry is found, the existingwarn ... not installedresult is already the right answer — that is what the same version reports from a directory with no.claude/settings.json.Separately, the check is cwd-sensitive in a way worth documenting: from a directory without
.claude/settings.jsonthe same binary reportswarn PreToolUse hook runtime — not installed in <cwd>/.claude/settings.jsonand exits 0.Environment
commitlore 0.2.1, compiled binary, macOS 15.3 (arm64),git 2.50.1 (Apple Git-155).