Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By JamesPrialv1.0.1MITIn 1 marketplace
Security hooks to detect and block potential secrets in git commits
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A Claude Code plugin that detects and blocks potential secrets before git commits.
# Add the marketplace
/plugin marketplace add /path/to/claude-plugins
# Install the plugin
/plugin install security-hooks@plugins-by-james
That's it. The hook automatically scans all git commit operations for secrets.
Security hooks are PreToolUse hooks that run before git operations to scan staged files for secrets, API keys, credentials, and sensitive data. They act as a final security gate before code is committed.
Key Features:
Scans for 24 common secret patterns using pre-compiled regex.
.env file for environment variable values1. Receive Bash tool call with "git commit" command
2. Get CLAUDE_PROJECT_DIR (or cwd)
3. Parse .env file (if exists)
4. Get staged files: git diff --cached --name-only
5. For each staged file:
- Skip binary files (30+ extensions)
- Skip .env files
- Skip files >10MB
- Read content from git staging area
- Check against 24 secret patterns
- Check against hardcoded .env values
6. If secrets found: block commit with detailed report
7. On errors: block commit (fail-closed)
| Pattern | Example Format |
|---|---|
| AWS Access Key ID | AKIA[0-9A-Z]{16} |
| AWS Secret Access Key | aws_secret_access_key = ... |
| Google API Key | AIza[0-9A-Za-z-_]{35} |
| Pattern | Example Format |
|---|---|
| OpenAI API Key | sk-[a-zA-Z0-9]{20,} |
| OpenAI Project Key | sk-proj-[a-zA-Z0-9]{20,} |
| Anthropic API Key | sk-ant-[a-zA-Z0-9-]{20,} |
| Pattern | Example Format |
|---|---|
| GitHub PAT | ghp_[a-zA-Z0-9]{36} |
| GitHub OAuth Token | gho_[a-zA-Z0-9]{36} |
| GitHub User Token | ghu_[a-zA-Z0-9]{36} |
| GitHub Server Token | ghs_[a-zA-Z0-9]{36} |
| GitHub Refresh Token | ghr_[a-zA-Z0-9]{36} |
| npm Access Token | npm_[a-zA-Z0-9]{36} |
| PyPI API Token | pypi-[a-zA-Z0-9]{43,} |
| Pattern | Example Format |
|---|---|
| Slack Token | xox[baprs]-[a-zA-Z0-9-]{10,} |
| Discord Bot Token | [MN][A-Za-z\d]{23,}.[A-Za-z\d_-]{6}.[A-Za-z\d_-]{27} |
| Twilio API Key | SK[a-fA-F0-9]{32} |
| SendGrid API Key | SG.[a-zA-Z0-9_-]{20,}.[a-zA-Z0-9_-]{20,} |
| Mailgun API Key | key-[a-zA-Z0-9]{32} |
| Pattern | Example Format |
|---|---|
| Stripe Secret Key | sk_live_[a-zA-Z0-9]{24,} |
| Stripe Restricted Key | rk_live_[a-zA-Z0-9]{24,} |
| Pattern | Example Format |
|---|---|
| PostgreSQL | postgres(ql)?://user:pass@host |
| MySQL | `[REDACTED:DB Connection String] |
| MongoDB | mongodb(+srv)?://user:pass@host |
| Pattern | Description |
|---|---|
| Private Keys | -----BEGIN (RSA|DSA|EC|OPENSSH) PRIVATE KEY----- |
| Bearer Tokens | bearer [a-zA-Z0-9_-.]{20,} |
| Generic Secrets | (secret|token)\s*[:=]\s*[value]{20,} |
Images: .png, .jpg, .jpeg, .gif, .bmp, .ico, .webp, .svg
Documents: .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx
Archives: .zip, .tar, .gz, .rar, .7z
Executables: .exe, .dll, .so, .dylib, .bin
Compiled: .wasm, .pyc, .class, .o, .obj
Fonts: .woff, .woff2, .ttf, .otf, .eot
Media: .mp3, .mp4, .avi, .mov, .wav, .flac
Databases: .sqlite, .db
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub jamesprial/claude-plugins --plugin security-hooksPlugins from other owners that cover similar ground