PLUGIN brewtools / Skills
On this page
secrets-scan
sonnet 10 parallel agents user-invokedFinds leaked credentials in git-tracked files before they reach a remote. The skill splits the file list into 10 chunks, scans them in parallel, ranks findings by severity and writes a report. Secrets committed to git stay in history even after deletion, so the cheapest fix is to catch them before the push.
Quick reference
| Field | Value |
|---|---|
| Command | /brewtools:secrets-scan |
| Arguments | [prompt] [--fix] — no args = scan only, --fix = interactive remediation |
| Model | sonnet |
| Output | .claude/reports/{TIMESTAMP}_secrets-scan/report.md (mode 600) |
When to use
| Situation | Command |
|---|---|
| Pre-push or pre-PR audit | /brewtools:secrets-scan |
| Before open-sourcing a private repo | /brewtools:secrets-scan --fix |
| Inherited a legacy codebase | /brewtools:secrets-scan |
| Verify nothing else leaked after an incident | /brewtools:secrets-scan |
Example
/brewtools:secrets-scan check for secrets before I open-source this repo
## Secrets Scan Complete — FINDINGS
| Metric | Value |
|-----------|-------|
| Files | 342 |
| Unscanned | 0 |
| CRITICAL | 1 |
| HIGH | 3 |
| MEDIUM | 7 |
| LOW | 12 |
Report: .claude/reports/20260417-143022_secrets-scan/report.md (mode 600)
The verdict is CLEAN, FINDINGS or INCOMPLETE. It is never CLEAN while a chunk failed reconciliation.
The report never contains a secret value. Findings carry a length, a sha256[:12] fingerprint and a preview of at most 4 leading characters. Rotate any credential that was ever committed: removing it from the worktree leaves it in git history.
How it works
- Setup
Checks for a git repo, builds the file list from
git ls-filesminus binaries, vendor dirs and lock files, and creates a mode700report directory. - Scan
Splits the list into 10 chunks and runs 10 haiku agents in one parallel call.
- Reconcile
Each agent must account for every assigned file. A bad chunk is re-run once, then marked
UNSCANNEDand the verdict becomesINCOMPLETE. - Report
Merges, dedupes by path and line, sorts CRITICAL to LOW, writes the report and prints a summary table.
- Fix (optional)
With
--fix, or on your confirmation when CRITICAL or HIGH findings exist, walks each finding through one choice.
Technical details
Detection rules and severity #
| Category | Patterns |
|---|---|
| Passwords | password, passwd, secret, pwd followed by = or : and a value |
| API keys | api_key, access_key, apikey, api_secret |
| Tokens | token, bearer, auth_token, access_token |
| AWS credentials | AKIA[0-9A-Z]{16}, aws_secret, aws_access_key |
| Database URLs | JDBC, MongoDB, MySQL, PostgreSQL strings with embedded credentials |
| Private keys | -----BEGIN ... PRIVATE KEY-----, client_secret, encryption_key |
| Level | Criteria |
|---|---|
| CRITICAL | Real credentials, private keys, database connection strings with passwords |
| HIGH | Real API keys or tokens, AWS credentials |
| MEDIUM | Suspicious hardcoded values that may be secrets |
| LOW | Placeholders (changeme, YOUR_KEY, xxx, dummy) |
Skipped automatically: env references (process.env.*, ${VAR}, os.getenv()), placeholders in doc comments, binary files.
Fix mode options #
| Option | Action |
|---|---|
| Fix | Delete or replace the secret inline |
| Move to env var | Extract the value into an environment variable reference |
| Add to .gitignore | Append the path, then git rm --cached <path> (ignoring alone leaves a tracked file tracked) |
| Mark false positive | Acknowledge and skip, logged in the report |
| Skip | Leave as is, next finding |
Report contents and redaction #
The report directory is mode 700, the file mode 600. Setup appends .claude/reports/ to .gitignore when nothing ignores it, so a report that names where credentials live cannot be committed.
| Section | Content |
|---|---|
| Summary | Verdict, file counts, severity breakdown |
| Findings | Per severity: path, line, category, value length, fingerprint, masked preview |
| Agent Stats | Assigned, accounted, reconciled and finding counts per agent |
| Unscanned | Chunks that failed reconciliation twice |
| File Inventory | Scanned and skipped files with skip reasons |
Agents run the skill’s redaction script for every hit and copy back only the length, fingerprint and preview. The raw value never enters an agent response, the report or the chat.
Delegation #
Each chunk agent gets one chunk and the same six-field brief; a repo too big for 10 chunks gets more chunks, not bigger ones. Brief fields and sizing rule: Delegation.
Limits #
- Run it inside a git repository; outside one it stops with
Not git repo. - It detects patterns, not every secret. Combine it with
.gitignorerules and pre-commit hooks. - Expect false positives in fixtures, example configs and doc snippets; mark them in
--fix. - Check LOW findings too:
changemesometimes reaches production configs unchanged.
Related
Deploy skill
Ship changes via GitHub Actions and GHCR after a clean audit.
GitHub source
Source, detection patterns and agent prompt templates.
Brewtools overview
Commands, models and arguments for every brewtools skill.
Update: /brewtools:plugin-update, /reload-plugins, then /brewcode:setup-status upgrade - FAQ