Skill in security
secret-scan
Scan code or a diff for hardcoded secrets (API keys, tokens, passwords, private keys, and other exposed credentials) before they get committed or shipped. Use before committing, during review, or when auditing a repository.
- Arguments
- (optional) a path, or 'diff' / 'staged' / 'history' to scope the scan
Install
As a plugin
Bundled in the security plugin. Add the marketplace once, then install the bundle; it updates with the marketplace.
/plugin marketplace add KhaledSaeed18/dotclaude/plugin install security@dotclaudeAs a single item
Run from the project root; the skill lands under .claude/. Copy it to ~/.claude/ to make it global.
npx shadcn@latest add KhaledSaeed18/dotclaude/secret-scanFiles installed
.claude/skills/secret-scan/SKILL.md
What it does
Find secrets that should never be in source control, then advise on remediation. Default scope: the staged diff if there is one, otherwise the working tree. Scan history or a specific path only when asked.
What to look for
- Known credential patterns: cloud keys (AWS
AKIA…, GCP, Azure), provider API tokens (Stripe, GitHubghp_…, Slack, OpenAI, etc.), OAuth client secrets, JWTs. - Private keys & certs:
-----BEGIN … PRIVATE KEY-----blocks,.pem/.p12/ keystore contents. - Credentials in URLs/config: connection strings and URLs with embedded passwords (
scheme://user:pass@host), basic-auth headers. - Generic secrets: assignments to names like
password,secret,token,api_key,access_key,client_secret, plus high-entropy strings that look like keys. - Risky files committed by mistake:
.env, credential JSON,*.key, and their presence in history.
Reduce false positives
Distinguish real secrets from example/placeholder values (xxxxx, your-key-here, changeme), test fixtures, public keys, and sample docs. When genuinely unsure, label a finding "review" rather than asserting a leak, but err toward reporting over silence.
Report and remediate
For each finding give: the file and line, the kind of secret, and a confidence (high / review). Then recommend remediation:
- Rotate the credential immediately. Assume anything committed (even briefly, even if later removed) is compromised. Deleting it from the latest commit is not enough; it remains in history.
- Move the value to an environment variable or a secrets manager and reference it instead of inlining.
- Add the offending file pattern to
.gitignore; consider a pre-commit hook or scanner to prevent recurrence.
This is a defensive check. Report findings so the owner can secure their own project; do not exfiltrate, store, or transmit any secret you find.
This is the skill as installed, rendered from its source on GitHub. Read it as Markdown.
More in security
- dependency-auditAudit a project's dependencies for outdated and vulnerable packages and surface breaking-change notes for upgrades. Works with any ecosystem, including...
- owasp-securityReview code being written or modified against the OWASP Top 10:2025 and ASVS secure-coding requirements, in any language or stack, catching vulnerability...
- security-auditorUse this agent when you need a comprehensive security audit of a codebase, module, API surface, or pull request. Covers OWASP Top 10:2025, auth logic...
- security-auditRun a full-codebase security audit covering OWASP Top 10:2025 vulnerability classes, auth logic, secret handling, input validation, dependency CVEs, and...
- command-guardA PreToolUse hook that blocks catastrophic Bash commands before they run (recursive force deletes of root or home, fork bombs, writing to raw disk...
- injection-guardA UserPromptSubmit hook that scans incoming prompts for prompt-injection and jailbreak patterns (instruction overrides, system-prompt extraction attempts...