Menu

1 / 2

Stop telling Claude not to read your secrets. Block it instead.

DEV Community·Ironex·6 months ago
#yMflTiuV
#ai#claude#webdev#software#hook
Reading 0:00
15s threshold

Claude Code has a hook system most people never touch. Here are two hooks I use daily - one for secrets, one for notifications.

Secret Guard 🛡️

A Claude Code hook that programmatically stops Claude from accessing your local secrets. Much more reliable than just telling Claude not to touch them.

Use it by copying the secret-guard hook from .claude/hooks/ and the matching PreToolUse entry from .claude/settings.json in the repo into your project, then chmod +x .claude/hooks/secret-guard . Claude picks it up on next start.

What's guarded by default: mainstream SQL databases, JavaScript and PHP framework env files, AWS credentials, Ansible Vault, and any env var that looks like a token, password, key, secret, or JWT.

Fully configurable - see the README for details.

Stop Notification 🔔

A Claude Code hook that fires a desktop notification every time Claude finishes a turn.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.