From b025f31c10eaa11860e9735dcff603d545cf83e6 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 22 May 2026 15:17:11 -0500 Subject: docs(hooks): sync README install snippets with the opt-in destructive hook The README's manual-install and settings-JSON snippets omitted destructive-bash-confirm.py, while the canonical hooks/settings-snippet.json already wires all three. Brought the README in line: added the opt-in symlink step, added the settings entry, and reworded the note so all three read as no-op-safe with the destructive gate flagged as opt-in (make install-hooks excludes it by default). --- hooks/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3