secret-scanner
Skill2 starsChanged 8 months agoMITView on GitHub
Scan staged files to detect credentials, API keys, tokens and secrets before any git commit.
- Reads credentials
- Commits and pushes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- Sagargupta16/agent-recipestheir own version, first seen Nov 1, 2026
- BryceYuuu/open-workflow-skillstheir own version, first seen Sep 5, 2026
- bestdeejay-design/agent-skillstheir own version, first seen Aug 9, 2026
- srikanth-manivannan/claude-agent-factorytheir own version, first seen Jun 26, 2026
- NovaCode37/claude-security-skillstheir own version, first seen Jun 7, 2026
- Cat-tj/secret-scannertheir own version, first seen Apr 6, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- NovaCode37/claude-security-skills★ 13same name
- bestdeejay-design/agent-skills★ 6same name
- Sagargupta16/agent-recipes★ 4same name
- BryceYuuu/open-workflow-skills★ 1same name
- srikanth-manivannan/claude-agent-factory★ 1same name
- Cat-tj/secret-scanner★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- global/CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- accessibility-reviewSkill
- api-designSkill
- audit-runnerSkill
- auto-fixSkill
- brainstormSkill
- compliance-checkSkill
- continuous-testing-guardianSkill
- contract-lookupSkill
- explainSkill
- idea-validatorSkill
- load-test-auditSkill
- monthly-reviewSkill
- new-featureSkill
- nextjs-reviewSkill
- perfection-auditSkill
- performance-deep-auditSkill
- post-code-security-auditSkill
- pre-code-security-checkSkill
- pre-deploymentSkill
- project-setupSkill
- pro-samuelSkill
- quick-auditSkill
- risk-scoreSkill
- roadmap-builderSkill
- seo-auditSkill
- supabase-reviewSkill
- token-economySkill
- typescript-reviewSkill
- ux-cognitive-load-checkSkill
- ux-heuristic-auditSkill
- ux-progressive-disclosureSkill
- welcomeSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 79
Does NOT remove secrets from Git history
- Distinctive: line 80
Does not scan binary files
- Distinctive: line 86
Remove the secret from the code: use environment variables
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secret Scanner - Protection against credential leaks
Description
This skill provides automatic protection against leaking secrets (passwords, API keys, tokens) in Git commits. It automatically analyzes every git commit and git push before execution.
How it works
The PreToolUse hook intercepts Bash commands containing:
git commitgit pushgit commit --amend
It then runs the scan-secrets.sh script, which:
- Retrieves the staged changes (
git diff --cached) - Analyzes the content with 30+ regex patterns
- Blocks the operation if secrets are detected
Detected patterns
Passwords
password = "..."pwd = "..."passwd = "..."
API Keys
- AWS:
AKIA...(16 chars) - Stripe:
sk_live_...,sk_test_...,whsec_... - Google:
AIza...(35 chars) - GitHub:
ghp_...,gho_... - Supabase JWT tokens
- SendGrid:
SG.... - Slack:
xox[baprs]-...
Generic tokens
api_key = "..."secret_key = "..."auth_token = "..."access_token = "..."bearer ...
Private keys
-----BEGIN PRIVATE KEY----------BEGIN RSA PRIVATE KEY----------BEGIN PGP PRIVATE KEY BLOCK-----
Connection strings
- MongoDB:
mongodb://user:pass@... - PostgreSQL:
postgres://user:pass@... - MySQL:
mysql://user:pass@... - Redis:
redis://user:pass@...
Files
- Hook script:
.claude/hooks/scan-secrets.sh - Configuration:
.claude/settings.json(PreToolUse hook)
Customization
To add new patterns, edit the PATTERNS array in scan-secrets.sh:
PATTERNS=(
# Add your pattern here
"my_custom_pattern"
...
)Limitations
- Does NOT remove secrets from Git history
- Does not scan binary files
- May produce false positives on some generic patterns
What to do if a secret is detected?
- Do not commit: the hook blocks automatically
- Remove the secret from the code: use environment variables
- If already committed: rotate the exposed secret immediately
- Optional: clean the history with
git filter-branchor BFG
Examples of good practice
// ❌ BAD - Hardcoded secret
const apiKey = "sk_live_abc123xyz";
// ✅ GOOD - Environment variable
const apiKey = process.env.STRIPE_SECRET_KEY;# ❌ BAD
password = "SuperSecret123"
# ✅ GOOD
import os
password = os.environ.get("DB_PASSWORD")Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

