I found that sometimes Claude Code reads whatever it wants. It'll open my .env, scan my .pem files, grep through my credentials.
Once a secret hits the context window, it's in the prompt being sent to Anthropic's servers and I am not a huge fant of that. I like control (that sounds crazy, but you know what I mean)
Load the plugin when starting Claude:
claude --plugin-dir /path/to/snoopy
Snoopy installs a PreToolUse hook that fires before every tool call. If Claude tries to read, edit, search, or glob a file that matches a secret pattern, the operation gets denied.
Files:
.env, .env.*, .env.local, .env.production*.pem, *.keysecrets.json, credentials.**.secret, *.keystoreBash commands:
cat .env, head credentials.json, tail secrets.key, etc.echo $SECRET_*, echo $API_KEY_*, printenv
Type /guard to open the interactive picker. It scans the project for sensitive files and lets you block, allow, or remove patterns you want!

You can also be boring and edit ~/.snoopy/config.json directly:
{
"blocked": [".env", ".env.*", "*.pem", "*.key", "secrets.json", "credentials.*", "*.secret", "*.keystore"],
"allowed": [".env.example", ".env.template", ".env.sample"]
}
Admin access level
Server config contains admin-level keywords
Executes bash commands
Hook triggers when Bash tool is used
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Modifies files
Hook triggers on file write and edit operations
Modifies files
Hook triggers on file write and edit operations
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimreal-time context window meter showing token usage, rate limits, and remaining capacity
npx claudepluginhub adikuma/snoopyBlocks secrets and PII before they reach the Anthropic API
Security hook that blocks Claude from reading, writing, or accessing secret and sensitive files
Protect secrets and credentials from Claude Code. Blocks writes to .env files, detects API keys in shell commands, prevents hardcoded tokens, and guards service account JSON files.
Scans for common credential formats across cloud, source control, payment, and collaboration providers
Pre-execution safety layer that blocks dangerous shell commands and credential file reads using pattern matching + LLM analysis. Fail-closed design.
Memory compression system for Claude Code - persist context across sessions