/secrets-scanner:secrets-scannerfrom Secrets Scanner
Install, uninstall, set up a pre-commit hook for, or run the secrets-scanner CLI (whit3rabbit/secrets-scanner) that detects leaked secrets, API keys, and credentials. Use when the user wants to install or remove secrets-scanner, add a git pre-commit secret-scan hook, block secrets before committing, or scan a repo/path for secrets on demand.
Ships in Secrets Scanner. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
CLI that scans code for leaked secrets using gitleaks-derived + custom rules.
Binary name: secrets-scanner. Crate: secrets_scanner. Repo: whit3rabbit/secrets-scanner.
Pick the workflow that matches the request. Prefer the bundled scripts over hand-writing hooks because they handle existing hooks, backups, and PATH detection.
Before running a bundled script, resolve SKILL_DIR to the directory containing
this SKILL.md, then run scripts from "$SKILL_DIR/scripts/". Do not assume the
current working directory is the skill directory.
Run the helper (tries Homebrew cask → cargo → prebuilt binary download):
bash "$SKILL_DIR/scripts/install.sh"
Or pick one directly:
brew install --cask whit3rabbit/tap/secrets-scannercargo install secrets_scanner (or cargo binstall secrets_scanner)curl -fsSL https://raw.githubusercontent.com/whit3rabbit/secrets-scanner/main/install.sh | bashinstall.ps1 from the repo.Verify: secrets-scanner --version. The prebuilt-download path installs to
~/.secrets-scanner/bin; if that's not on PATH, add it (the installer prints the line).
bash "$SKILL_DIR/scripts/uninstall.sh"
It detects the install method (brew / cargo / prebuilt dir) and removes the binary. Remove managed pre-commit hooks first so repos do not fail closed after the binary is gone.
Two paths — choose based on what the repo already uses:
Native git hook (no framework). Run inside the target repo:
bash "$SKILL_DIR/scripts/install-git-hook.sh"
Writes .git/hooks/pre-commit calling secrets-scanner scan . --staged --redact --no-context.
--staged scans the index blob content about to be committed (catches secrets
staged then scrubbed from the working tree). Findings, scan errors, or a missing scanner
binary block the commit.
Backs up any existing non-managed hook to pre-commit.bak. Remove with
bash "$SKILL_DIR/scripts/uninstall-git-hook.sh".
pre-commit framework (repo has .pre-commit-config.yaml). Add:
repos:
- repo: https://github.com/whit3rabbit/secrets-scanner
rev: v0.1.0 # pin a released tag
hooks:
- id: secrets-scanner
Then pre-commit install. The shipped hook runs scan . --staged --redact --no-context
with pass_filenames: false, so it scans index blobs rather than pre-commit's filename list.
secrets-scanner scan <path> --git-tracked # scan git-tracked files (safe default)
secrets-scanner scan <path> --staged # only staged index content
secrets-scanner scan <path> --git-history --all # secrets ever committed, even if later removed
secrets-scanner scan <path> --changed-files --base origin/main # only diff vs a base ref
Useful flags: --redact (mask matched values), --no-context (CI-safe, no surrounding lines),
--format text|json|jsonl|sarif, --output <file> (SARIF for GitHub code-scanning),
--baseline <file> / --generate-baseline <file> (suppress known findings),
--max-file-size, --binary-policy auto|skip|scan, --no-fail (always exit 0).
Exit codes: 0 clean, 1 findings, 2 runtime error, 3 invalid config/rules.
For untrusted in-memory content such as LLM prompts or tool payloads, use the
hardened library entry points documented in REFERENCE.md: Rust
Scanner::scan_proxy or Node scanProxyAsync. A skill can guide agents to call
those APIs, but it cannot transparently intercept every agent or gateway message
without a separate runtime integration.
For MCP-compatible agents, run the Node MCP wrapper from this repo/package:
npx -y @whit3rabbit/rsecrets-scanner-mcp --root /path/to/project
Example client config:
{
"mcpServers": {
"rsecrets": {
"command": "npx",
"args": ["-y", "@whit3rabbit/rsecrets-scanner-mcp", "--root", "/path/to/project"]
}
}
}
The MCP tools expose hardened text redaction plus root-bound file, workspace,
staged, changed-files, and opt-in history scans. They never return raw matched
values or context lines. Enable history only when explicitly requested:
npx -y @whit3rabbit/rsecrets-scanner-mcp --root /path/to/project --enable-history
scripts/install.sh, scripts/uninstall.sh, scripts/install-git-hook.sh, scripts/uninstall-git-hook.shWhat SKILL.md sets; muted values are Claude Code's defaults
haikuOther plugins' skills for the same job
npx claudepluginhub whit3rabbit/secrets-scanner --plugin secrets-scanner