Guardian
Secret guardian hook for Claude
5 stars1 forks40 viewsAdded 1mo ago
AI-Agent Assisted
Tier 2Claude Code
Signals: README-built-with-claude
README
Claude Secrets Guardian 🛡️
Prevent accidental exposure of secrets, API keys, and passwords in Claude Code sessions.
Quick Install
curl -sSL guardian.refcell.org/install | bash
What It Does
Guardian blocks Claude Code from:
- Writing secrets to files
- Running commands with exposed credentials
- Displaying sensitive data in responses
- Committing secrets to git
Protected Secrets
- API Keys: OpenAI, Stripe, AWS, GitHub tokens
- Credentials: Passwords, database URLs, JWT tokens
- Private Keys: SSH, RSA, PGP keys
- Webhooks: Slack, Discord URLs
Test It Works
# Quick test
curl -sSL guardian.refcell.org/test | bash
# Or ask Claude to write a secret (will be blocked):
# "Create test.txt with AWS_ACCESS_KEY_ID=AKIA[EXAMPLE]"
Uninstall
curl -sSL guardian.refcell.org/uninstall | bash
How It Works
Guardian uses Claude Code's hook system to scan operations before execution:
- PreToolUse: Blocks Write/Edit/Bash operations with secrets
- Stop: Prevents secrets in Claude's responses
- SessionStart: Shows security status on startup
Files installed in ~/.claude/hooks/:
guardian-hook.js- Main scannersecrets-guardian.json- Detection patternssession-start-hook.js- Startup notifications
Troubleshooting
Not working?
- Check installation:
grep guardian ~/.claude/settings.json - Test manually:
./tests/test.sh - Enable debug:
export GUARDIAN_DEBUG=true
False positives?
- Edit patterns:
~/.claude/hooks/secrets-guardian.json - Report issues: GitHub
Requirements
- Node.js 14+
- Claude Code (latest)
- macOS/Linux/WSL
Contributing
git clone https://github.com/refcell/guardian
cd guardian
./tests/test.sh
License
MIT - See LICENSE
Built for safer AI-assisted development with Claude Code.
Tags
built-with-claude-codejavascriptclaude
Similar Tools
Everything Claude Code
VerifiedComplete Claude Code configuration collection from Anthropic hackathon winner
Claude Code
dev toolsJavaScript
Claude Code System Prompts
VerifiedClaude Code system prompt collection
Claude Code
dev toolsJavaScript
Get Shit Done
VerifiedMeta-prompting and context engineering system
Claude Code
dev toolsJavaScript
Claudecodeui
VerifiedFree open source webui/GUI for Claude Code
Claude Code
web appsdev toolsJavaScript
My Claude Code Setup
VerifiedStarter template and CLAUDE.md memory bank
Claude Code
dev tools
Claudit
Claude Code management UI
Claude Code
dev toolsTypeScript