Bug
In .claude/settings.json, all 9 master-hook.sh hook entries use a
bare relative path:
"command": ".claude/hooks/master-hook.sh PreToolUse"
while every other hook in the same file uses an absolute
$CLAUDE_PROJECT_DIR/.claude/hooks/... path. When a tool runs with the
working directory inside a subdirectory (e.g. repos/private/<repo>/
during normal in-repo coding), the shell resolves the relative path
against the current directory:
/bin/sh: .claude/hooks/master-hook.sh: No such file or directory
Impact (more than cosmetic)
The visible symptom is a non-blocking PreToolUse:Read /
PostToolUse:Read hook error. The real problem: master-hook.sh is the
dispatcher for PreToolUse, PostToolUse, PreCompact, Stop,
SessionStart, UserPromptSubmit, Notification, SubagentStop,
SessionEnd. Whenever cwd ≠ HQ root (i.e. most repo work), the entire
master-hook chain silently does not run — auto-checkpoint, policy
injection, etc. fail open with only a non-blocking log line.
Affects every event (lines ~191/322/358/394/… on main). Not a
v14.1.0-beta.1 regression — the pre-beta backup has it too; long-standing.
Fix (mechanical, 9 lines)
-"command": ".claude/hooks/master-hook.sh <Event>"
+"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/master-hook.sh <Event>"
i.e. make these 9 entries match the absolute-path convention the other
36 hook entries in the same file already use. JSON validated after the
change.
Ready-to-merge branch (external PR creation is restricted on this repo,
same as #21):
spencerrwise:fix/master-hook-claude-project-dir — commit ecf50b7
(https://github.com/spencerrwise/hq-core/tree/fix/master-hook-claude-project-dir).
A maintainer can open the PR from that branch or cherry-pick.
Related: same portability family as #21 (HQ_ROOT propagation in
run-project.sh) — both are "core script invocation breaks when cwd
isn't the HQ root."
🤖 Reported via Claude Code
Bug
In
.claude/settings.json, all 9master-hook.shhook entries use abare relative path:
while every other hook in the same file uses an absolute
$CLAUDE_PROJECT_DIR/.claude/hooks/...path. When a tool runs with theworking directory inside a subdirectory (e.g.
repos/private/<repo>/during normal in-repo coding), the shell resolves the relative path
against the current directory:
Impact (more than cosmetic)
The visible symptom is a non-blocking
PreToolUse:Read/PostToolUse:Readhook error. The real problem:master-hook.shis thedispatcher for
PreToolUse,PostToolUse,PreCompact,Stop,SessionStart,UserPromptSubmit,Notification,SubagentStop,SessionEnd. Whenever cwd ≠ HQ root (i.e. most repo work), the entiremaster-hook chain silently does not run — auto-checkpoint, policy
injection, etc. fail open with only a non-blocking log line.
Affects every event (lines ~191/322/358/394/… on
main). Not av14.1.0-beta.1 regression — the pre-beta backup has it too; long-standing.
Fix (mechanical, 9 lines)
i.e. make these 9 entries match the absolute-path convention the other
36 hook entries in the same file already use. JSON validated after the
change.
Ready-to-merge branch (external PR creation is restricted on this repo,
same as #21):
spencerrwise:fix/master-hook-claude-project-dir— commitecf50b7(https://github.com/spencerrwise/hq-core/tree/fix/master-hook-claude-project-dir).
A maintainer can open the PR from that branch or cherry-pick.
Related: same portability family as #21 (
HQ_ROOTpropagation inrun-project.sh) — both are "core script invocation breaks when cwdisn't the HQ root."
🤖 Reported via Claude Code