diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-22 15:17:11 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-22 15:17:11 -0500 |
| commit | b025f31c10eaa11860e9735dcff603d545cf83e6 (patch) | |
| tree | 8fdd1f2377f94310be31984a49c47ff17165f1e5 | |
| parent | 57eb6843e054c73c8241bbcf7ef082f5566db7da (diff) | |
| download | rulesets-b025f31c10eaa11860e9735dcff603d545cf83e6.tar.gz rulesets-b025f31c10eaa11860e9735dcff603d545cf83e6.zip | |
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).
| -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 |
