diff options
| -rw-r--r-- | hooks/README.md | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hooks/README.md b/hooks/README.md index 09abe09..71b3613 100644 --- a/hooks/README.md +++ b/hooks/README.md @@ -32,6 +32,10 @@ mkdir -p ~/.claude/hooks ln -sf ~/code/rulesets/hooks/precompact-priorities.sh ~/.claude/hooks/precompact-priorities.sh ln -sf ~/code/rulesets/hooks/git-commit-confirm.py ~/.claude/hooks/git-commit-confirm.py ln -sf ~/code/rulesets/hooks/gh-pr-create-confirm.py ~/.claude/hooks/gh-pr-create-confirm.py + +# Opt-in: the destructive-command gate is not linked by default (it's the one +# hook excluded from `make install-hooks`). Link it only if you want it: +ln -sf ~/code/rulesets/hooks/destructive-bash-confirm.py ~/.claude/hooks/destructive-bash-confirm.py ``` Then merge into `~/.claude/settings.json`: @@ -60,6 +64,10 @@ Then merge into `~/.claude/settings.json`: { "type": "command", "command": "~/.claude/hooks/gh-pr-create-confirm.py" + }, + { + "type": "command", + "command": "~/.claude/hooks/destructive-bash-confirm.py" } ] } @@ -68,7 +76,7 @@ Then merge into `~/.claude/settings.json`: } ``` -Note: if `~/.claude/settings.json` already has `hooks` entries, merge arrays rather than replacing them. Both `git-commit-confirm.py` and `gh-pr-create-confirm.py` are safe to run on every `Bash` tool call — they no-op on anything that isn't their target command. +Note: if `~/.claude/settings.json` already has `hooks` entries, merge arrays rather than replacing them. All three `Bash` hooks are safe to run on every `Bash` tool call — they no-op on anything that isn't their target command. The destructive-command gate is opt-in: `make install-hooks` lists it under "opt-in hooks" and doesn't symlink it by default, so link it manually (above) before relying on the snippet's `destructive-bash-confirm.py` entry — or drop that entry if you don't want the gate. ## Verify |
