/skills:security-scrubfrom skills
Scans code and diffs for secrets and sensitive data. Detects credentials, tokens, and PII to prevent leaks before sharing. Use when the user asks to check for secrets or review a diff for leaks.
Ships in skills. 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.
Scan content for secrets and sensitive data. Produces a structured SCRUB RESULT block that callers must check before proceeding.
Six mandatory steps — none can be skipped. The caller (human or skill) provides the content to scan either as inline text or a file path.
Read the references/scrub-rules.md file adjacent to this SKILL.md to get the current pattern table, file-path block list, and masking format.
Run Grep against the content for HIGH, MEDIUM, and LOW patterns from the table. Also check any file paths referenced in the content against the file-path block list.
Key regex groups to scan:
sk-[A-Za-z0-9]{20,}
ghp_[A-Za-z0-9]{36}
ghs_[A-Za-z0-9]{36}
AKIA[A-Z0-9]{16}
xoxb-[0-9]{11}-[0-9]{11}-[A-Za-z0-9]{24}
xoxp-[A-Za-z0-9-]{72,}
eyJ[A-Za-z0-9_-]{20,}\.eyJ
[A-Z_]{3,}=[[:alnum:]_-]{32,}
password\s*[=:]\s*\S{4,}
secret\s*[=:]\s*\S{4,}
token\s*[=:]\s*\S{8,}
api_key\s*[=:]\s*\S{8,}
For the private-key pattern (-----BEGIN ...), pass via -e to avoid the leading dash being parsed as a grep option:
grep -E -e '-----BEGIN (RSA|EC|OPENSSH|PGP) PRIVATE KEY'
File path patterns to block: .env, credentials, id_rsa, .pem, ~/.ssh/, ~/.aws/credentials
Classify each match as HIGH / MEDIUM / LOW per the pattern table in references/scrub-rules.md.
BLOCKEDWARNPASS; list findings as informational notesPASSFor any matched value: show first 4 chars + *** + last 4 chars.
Example: sk-abcdefgh1234wxyz → sk-a***wxyz
Never output unmasked secret values.
Output exactly this block (fill in the brackets):
SCRUB RESULT: [PASS | BLOCKED | WARN]
---
Findings:
- [HIGH|MEDIUM|LOW] <pattern-name>: <masked-value> (line N)
ALLOWLIST verdict: [PASS | BLOCKED]
Reason: <one sentence>
If no findings, output:
Findings: none
ALLOWLIST verdict: BLOCKED when the content originates from a blocked file path (see file-path block list). This overrides SCRUB RESULT: PASS.
Callers must treat SCRUB RESULT: BLOCKED or ALLOWLIST verdict: BLOCKED as a hard stop — do not proceed with sharing.
After emitting the SCRUB RESULT block, apply the appropriate gate based on the result. Emit a GATE RESULT line at the end so callers have a machine-readable signal.
BLOCKED (SCRUB RESULT: BLOCKED or ALLOWLIST verdict: BLOCKED):
AskUserQuestion.GATE RESULT: BLOCKED — hard stop. Sharing is not permitted.WARN (MEDIUM findings, no HIGH):
AskUserQuestion with one question:
Security warningThe security scan found potential issues (see MEDIUM findings above). Are you sure you want to continue?Continue anyway (description: "Proceed despite warnings — review findings first") / Cancel — stop here (description: "Abort sharing; no content will be sent")GATE RESULT: CANCELLED — user declined to proceed. and return.GATE RESULT: APPROVED. and return.PASS with LOW findings only:
AskUserQuestion with one question:
Scrub passedSecurity scan passed with informational notes (see LOW findings above). Continue?Continue (description: "Proceed with sharing") / Cancel (description: "Abort sharing")GATE RESULT: CANCELLED — user declined to proceed. and return.GATE RESULT: APPROVED. and return.PASS with no findings:
AskUserQuestion.GATE RESULT: APPROVED (clean — auto-proceeding).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub shawn-sandy/skills --plugin skills13 skills in this plugin
/agentic-memory-managementAudits and optimizes CLAUDE.md project memory files. Checks adherence to Claude Code best practices and produces actionable fixes. Use when the user asks to audit, optimize, or diagnose a CLAUDE.md./code-review-agentReviews code for bugs, security issues, and breaking changes. Produces prioritized findings on quality, vulnerabilities, and regressions. Use when asked to review code or check a PR diff./code-testing-agentSuggests purpose-driven tests tied to actual behavior. Writes test files covering untested paths and behavior gaps in the codebase. Use when the user asks to suggest tests or find untested behavior.