by Karan Bansal
A secrets firewall for Claude Code. A PreToolUse hook screens every Read, Edit, Write, Bash, and Grep call against tiered patterns (critical/high/strict): sensitive files like .env, SSH keys, AWS/kube/gcloud/docker credentials, and keystores, plus shell commands that expose or exfiltrate them (cat .env, printenv, echo $SECRET_KEY, curl/scp/rsync uploads) and delegation sinks that feed a secrets file or a secret env var to an external model CLI (gemini, codex, llm, sgpt, aichat, openai, mods, fabric) or a model API host; the opt-in strict level also flags any file contents sent that way. Matches are denied, or turned into a prompt via per-level ask mode, with the exact pattern id and reason; .env.example-style templates stay allowed. Safety level is tunable via HOOK_SAFETY_LEVEL, no file edits needed.
Claude Code