sanitize

sanitize is a command for Claude Code from Enovatr-Labs/SpecRoute. It costs 23 tokens per session (1,512 once invoked), scanned A, original, Apache-2.0.

A repository check that scans project files and publication history for private identifiers, paths, secrets, and overlap with private source code.

In plain words
What is it for?
It helps review tracked and newly added files, check required ignore rules, and detect sensitive content in working, staged, or historical files.
Why use it?
It helps catch confidential material before it is committed or published in a public repository.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 tools/provenance-audit.py \.

Good fit It helps review tracked and newly added files, check required ignore rules, and detect sensitive content in working, staged, or historical files.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Enovatr-Labs/SpecRoute
agentmods
npx agentmods add commands/enovatr-labs/specroute/sanitize

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sanitize

README.md
[![agentmods](https://agentmods.dev/badge/commands/enovatr-labs/specroute/sanitize/github.svg)](https://agentmods.dev/commands/enovatr-labs/specroute/sanitize)
Your own site
<a href="https://agentmods.dev/commands/enovatr-labs/specroute/sanitize"><img src="https://agentmods.dev/badge/commands/enovatr-labs/specroute/sanitize/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sanitize

Your own site · 80×15
<a href="https://agentmods.dev/commands/enovatr-labs/specroute/sanitize"><img src="https://agentmods.dev/badge/commands/enovatr-labs/specroute/sanitize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,512 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01512
Opus 5 $0.00012 $0.00756
Sonnet 5 $0.00005 $0.00302
Haiku 4.5 $0.00002 $0.00151

Measured 9d ago against content hash ba7e4982c81f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sanitize scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/sanitize.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run a sanitization sweep over the SpecRoute repository. SpecRoute is a public open-source repo; private upstream codebases must never leak into tracked files.

Execute these checks in order, over tracked and newly-added files (gitignored files like initial.md and .claude/settings.local.json stay excluded):

# 1. Confirm gitignore is in place
echo "── gitignore status ──"
grep -E "settings\.local|initial\.md" .gitignore || echo "WARN: expected gitignore entries missing"

# 1b. Build the scan set: tracked files PLUS untracked-but-not-ignored files.
#     `git grep` reads ONLY tracked content, so a commit that ADDS a leaking file
#     is invisible to it - and new content is the most likely to leak. Ignored
#     files stay excluded (--exclude-standard); the wordlist itself lives in one.
#     NUL-delimited so paths with spaces survive.
SCAN="$(mktemp)"; trap 'rm -f "$SCAN"' EXIT
{ git ls-files -z; git ls-files -z --others --exclude-standard; } > "$SCAN"
echo "Scanning $(tr -cd '\0' < "$SCAN" | wc -c | tr -d ' ') files (tracked + newly added)."

# 2. Forbidden upstream-project strings (case-insensitive; working tree,
#    untracked additions, and the staged index).
#    Wordlist lives in .claude/.forbidden-strings.txt (gitignored, per-installation).
echo
echo "── forbidden strings ──"
WORDLIST=".claude/.forbidden-strings.txt"
if [ ! -f "$WORDLIST" ]; then
  echo "WARN  $WORDLIST missing - no terms to scan. Populate it with any private upstream names."
else
  while IFS= read -r line || [ -n "$line" ]; do
    case "$line" in '#'*|'') continue ;; esac
    s="$(printf '%s' "$line" | tr -d '[:space:]')"
    [ -z "$s" ] && continue
    # `|| true`: xargs returns 123 when any grep batch finds nothing, even if
    # another batch matched. Test the captured output, not the exit status.
    hits=$(xargs -0 grep -l -i -I -e "$s" < "$SCAN" 2>/dev/null || true)
    if [ -n "$hits" ]; then
      echo "FAIL  '$s' found in:"
      echo "$hits" | sed 's/^/    /'
    fi
    staged=$(git grep --cached -l -i -- "$s" 2>/dev/null || true)
    if [ -n "$staged" ]; then
      echo "FAIL  '$s' found in staged index:"
      echo "$staged" | sed 's/^/    /'
    fi
  done < "$WORDLIST"
fi

# 3. Absolute filesystem paths and their flattened equivalents.
#    Three shapes, because a leak can hide in any of them:
#      a) /Users/<name>/LocalDev/   - path into a local dev checkout
#      b) /Users/<name>/            - any bare home-directory absolute path
#                                     (superset of (a), so one pattern covers both)
#      c) -Users-<name>-            - the FLATTENED form Claude uses for project
#                                     dirs, e.g. ~/.claude/projects/-Users-<name>-<repo>/
#    Known-benign lines are dropped by the IGNORE_RE alternation below - the
#    documented `<user>` / `<private>` placeholders, and regex-source lines
#    (which contain a `[^` character-class fragment, so they are patterns, not
#    paths). Extend IGNORE_RE rather than deleting a check.
#    `U` is interpolated so this command's own source does not self-match.
echo
echo "── absolute / flattened path leaks ──"
U="Users"
IGNORE_RE='<user>|<private>|<name>|<repo>|<flattened-project-path>|yourname|youruser|\[\^'
xargs -0 grep -nHE -I -e "/$U/[^/[:space:]]+/" -e "-$U-[A-Za-z0-9]+-" < "$SCAN" 2>/dev/null \
  | grep -Ev "$IGNORE_RE" \
  || echo "OK    no absolute or flattened path leaks"
git grep --cached -nE "/$U/[^/[:space:]]+/|-$U-[A-Za-z0-9]+-" \
  -- '*.md' '*.json' '*.toml' '*.yaml' '*.yml' '*.sh' '*.py' 2>/dev/null \
  | grep -Ev "$IGNORE_RE" || true

# 4. Likely secrets in tracked files
echo
echo "── likely secrets ──"
xargs -0 grep -nHE -I -e "(api[_-]?key|secret|token|password)[[:space:]]*[:=][[:space:]]*['\"][A-Za-z0-9_-]{16,}" < "$SCAN" 2>/dev/null \
  || echo "OK    no obvious secrets"
git grep --cached -nE "(api[_-]?key|secret|token|password)[[:space:]]*[:=][[:space:]]*['\"][A-Za-z0-9_-]{16,}" \
  -- '*.md' '*.json' '*.toml' '*.yaml' '*.yml' '*.sh' 2>/dev/null || true

# 4b. Private-source provenance (release gate, local inputs stay gitignored).
if [ -f .claude/.provenance-sources.txt ]; then
  python3 tools/provenance-audit.py \
    --source-list .claude/.provenance-sources.txt \
    --terms-file .claude/.forbidden-strings.txt \
    --allowlist .claude/.provenance-allowlist.txt \
    --history
else
  echo "WARN  provenance audit skipped - .claude/.provenance-sources.txt is not configured"
fi

# 5. What would actually be committed
echo
echo "── tracked file inventory ──"
git ls-files | wc -l | xargs echo "Tracked files:"
echo
echo "── current diff status ──"
git status --short

Read the full file on GitHub · 109 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 109 lines · 23 tokens per session scan A ba7e4982c81f

Subscribe to this mod's changes

sanitize is a command published in the GitHub repository Enovatr-Labs/SpecRoute (3 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 23 tokens to every session and 1,512 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.