From fbab93f4f3b8e468c7e9eb3a87cc5b584e922e31 Mon Sep 17 00:00:00 2001 From: Ambient Code Bot Date: Wed, 22 Apr 2026 15:04:29 -0400 Subject: [PATCH] fix: use absolute paths for all Claude Code hook commands All hook commands in .claude/settings.json used relative paths, which fail when the shell's working directory isn't the repo root. Prefix each with cd "$(git rev-parse --show-toplevel)" to resolve reliably regardless of cwd. Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/settings.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 5c0e45090..47a00cc3a 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "scripts/hooks/pr-review-gate.sh" + "command": "cd \"$(git rev-parse --show-toplevel)\" && bash scripts/hooks/pr-review-gate.sh" } ] }, @@ -15,7 +15,7 @@ "hooks": [ { "type": "command", - "command": "bash scripts/claude-hooks/convention-guard.sh" + "command": "cd \"$(git rev-parse --show-toplevel)\" && bash scripts/claude-hooks/convention-guard.sh" } ] } @@ -26,7 +26,7 @@ "hooks": [ { "type": "command", - "command": "bash scripts/claude-hooks/auto-format.sh" + "command": "cd \"$(git rev-parse --show-toplevel)\" && bash scripts/claude-hooks/auto-format.sh" } ] }, @@ -45,7 +45,7 @@ "hooks": [ { "type": "command", - "command": "bash scripts/claude-hooks/stop-review.sh" + "command": "cd \"$(git rev-parse --show-toplevel)\" && bash scripts/claude-hooks/stop-review.sh" } ] }