Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
Expand Down
2 changes: 1 addition & 1 deletion docs/enterprise-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}]
}]
Expand Down
18 changes: 10 additions & 8 deletions docs/hooks-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
}
]
Expand All @@ -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
}
]
Expand All @@ -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
}
]
Expand All @@ -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
}
]
Expand All @@ -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
}
]
Expand All @@ -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
}
]
Expand Down Expand Up @@ -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
}
]
Expand Down
Loading