diff --git a/docs/configuration-reference.md b/docs/configuration-reference.md index c9253e0..1a107c9 100644 --- a/docs/configuration-reference.md +++ b/docs/configuration-reference.md @@ -142,7 +142,7 @@ Claude Code's hook wiring. This tells Claude Code WHICH scripts to run on WHICH "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/script-name.sh\"", + "command": "/path/to/.claude/hooks/script-name.sh", "timeout": 10 } ] diff --git a/docs/enterprise-security.md b/docs/enterprise-security.md index fa96b09..7d947b5 100644 --- a/docs/enterprise-security.md +++ b/docs/enterprise-security.md @@ -84,7 +84,7 @@ Developers can execute but not modify. "matcher": "Bash", "hooks": [{ "type": "command", - "command": "bash \"//server/jitneuro-policy/hooks/branch-protection.sh\"", + "command": "//server/jitneuro-policy/hooks/branch-protection.sh", "timeout": 5 }] }] diff --git a/docs/hooks-guide.md b/docs/hooks-guide.md index b396913..2605999 100644 --- a/docs/hooks-guide.md +++ b/docs/hooks-guide.md @@ -117,7 +117,9 @@ See [heartbeat.md](heartbeat.md) for the full heartbeat reference -- what it is, ### settings.local.json hooks block -Add the following to `.claude/settings.local.json` in your project or workspace root: +Add the following to `.claude/settings.local.json` in your project or workspace root. + +Each `command` is a **bare path to the hook script** -- nothing else. Claude Code runs every hook `command` through its own shell, so do NOT prefix it with `bash`, `bash.exe`, or any shell binary. A prefix makes the shell try to run bash as bash's own script argument and the hook fails at runtime with `bash.exe: bash.exe: cannot execute binary file`. ```json { @@ -128,7 +130,7 @@ Add the following to `.claude/settings.local.json` in your project or workspace "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/pre-compact-save.sh\"", + "command": "/path/to/.claude/hooks/pre-compact-save.sh", "timeout": 10 } ] @@ -140,7 +142,7 @@ Add the following to `.claude/settings.local.json` in your project or workspace "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/session-start-write-id.sh\"", + "command": "/path/to/.claude/hooks/session-start-write-id.sh", "timeout": 5 } ] @@ -150,7 +152,7 @@ Add the following to `.claude/settings.local.json` in your project or workspace "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/session-start-recovery.sh\"", + "command": "/path/to/.claude/hooks/session-start-recovery.sh", "timeout": 10 } ] @@ -162,7 +164,7 @@ Add the following to `.claude/settings.local.json` in your project or workspace "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/branch-protection.sh\"", + "command": "/path/to/.claude/hooks/branch-protection.sh", "timeout": 5 } ] @@ -174,7 +176,7 @@ Add the following to `.claude/settings.local.json` in your project or workspace "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/heartbeat.sh\"", + "command": "/path/to/.claude/hooks/heartbeat.sh", "timeout": 5 } ] @@ -186,7 +188,7 @@ Add the following to `.claude/settings.local.json` in your project or workspace "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/session-end-autosave.sh\"", + "command": "/path/to/.claude/hooks/session-end-autosave.sh", "timeout": 10 } ] @@ -276,7 +278,7 @@ exit 0 "hooks": [ { "type": "command", - "command": "bash \"/path/to/.claude/hooks/my-hook.sh\"", + "command": "/path/to/.claude/hooks/my-hook.sh", "timeout": 10 } ]