A personal collection of Claude Code configuration: hooks, settings, and the tests that cover them. Drop the contents into a project's .claude/ directory (or your user-level ~/.claude/) to use it.
Copy .claude/settings.json and .claude/hooks/ into the target project, then mark the hooks executable:
chmod +x .claude/hooks/*settings.json wires up the hooks below. Claude Code picks them up the next time it starts.
A PreToolUse hook that fires on every tool call and denies (exit 2) anything that could leak secret material back into the conversation.
Covered out of the box: dotenv, direnv, Ansible Vault, Composer (auth.json), Magento (app/etc/env.php), PostgreSQL / MySQL / MariaDB / AWS credentials, and generic *_TOKEN / *_PASSWORD / *_KEY / *_SECRET / *_JWT env vars.
What it blocks:
Read/Edit/Write/NotebookEdittargeting sensitive paths:.env,.env.local,.env.production,env.secret,.envrc, files undersecrets/, ansible-vault files, etc.Bashcommands referencing those same paths.Bashecho/printenv/env/set/export -pon variables whose names look like secrets (*_TOKEN,*_PASSWORD,*_KEY,AWS_ACCESS_KEY_ID,PGPASSWORD, ...)Bashansible-vault view|decrypt|edit|rekey|decrypt_string
Configure it by editing the arrays at the top of the script: secret_suffixes, secret_exact_vars, and secret_path_re. Anything that does not touch those targets passes through untouched.
A Stop hook that fires a desktop notification each time Claude finishes a turn. Handy when you let it run a long task in the background.
The script auto-detects your OS via uname -sr and dispatches to the right notifier.
Requirements per OS:
- macOS -
osascript(preinstalled, nothing to do). - WSL - install
wsl-notify-sendand putwsl-notify-send.exeon yourPATH. Notifications show up in the Windows Action Center. - Native Linux -
notify-sendfromlibnotify, plus a running notification daemon (most desktop environments ship one; headless servers do not).- Debian/Ubuntu:
apt install libnotify-bin - Fedora/RHEL:
dnf install libnotify - Arch:
pacman -S libnotify
- Debian/Ubuntu:
Hook behavior is covered by a bats suite under tests/.
npm ci # install bats locally
npm test # run tests/