secrets-scan

secrets-scan is a skill for Claude Code from chipi/agentic-ai-homelab. It costs 88 tokens per session (772 once invoked), scanned B, original, MIT.

A read-only check for exposed secrets such as API keys, tokens, passwords, private keys, and real environment files. It scans staged changes, selected differences, or the whole repository and hides matched secret values in its report.

In plain words
What is it for?
Use it before committing or pushing, especially after changing configuration. It helps inspect staged files or history and report suspicious matches by file and line.
Why use it?
It catches credentials before they enter version control or get pushed. This reduces the risk of exposing access to services and accounts.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths.

Good fit Use it before committing or pushing, especially after changing configuration. It helps inspect staged files or history and report suspicious matches by file and line.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chipi/agentic-ai-homelab/secrets-scan
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chipi/agentic-ai-homelab --skill secrets-scan
Clone the repo
git clone --depth 1 https://github.com/chipi/agentic-ai-homelab

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 secrets-scan

README.md
[![agentmods](https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/secrets-scan/github.svg)](https://agentmods.dev/skills/chipi/agentic-ai-homelab/secrets-scan)
Your own site
<a href="https://agentmods.dev/skills/chipi/agentic-ai-homelab/secrets-scan"><img src="https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/secrets-scan/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 secrets-scan

Your own site · 80×15
<a href="https://agentmods.dev/skills/chipi/agentic-ai-homelab/secrets-scan"><img src="https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/secrets-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 772 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00088 $0.00772
Opus 5.5 $0.00035 $0.00309
Sonnet 5.5 $0.00018 $0.00154
Haiku 4.5 $0.00009 $0.00077

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

Security

Grade B, and why

secrets-scan scanned grade B with 1 finding 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 17d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/scan.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

wired in `~/.claude/settings.json` since 2026-07-30) blocks a `git commit`/`git push` from
workstation/claude/skills/secrets-scan/SKILL.md · 58 lines

How it starts

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

secrets-scan

Catch secrets before they land in git. Enforces the non-negotiable: .env, credentials, tokens, API keys — never in git, never in fixtures, never in a commit message. Read-only — it never writes; it blocks by reporting.

Run

~/.claude/skills/secrets-scan/scripts/scan.sh            # staged changes (what `git commit` would add)
~/.claude/skills/secrets-scan/scripts/scan.sh --push     # commits not yet on the upstream (what `git push` sends)
~/.claude/skills/secrets-scan/scripts/scan.sh --range origin/main..HEAD
~/.claude/skills/secrets-scan/scripts/scan.sh --tree [PATH]   # the working tree, no history

Run it from inside the repo.

  • With gitleaks: gitleaks is used when installed, with ~200 provider rules. Findings are listed file:line — rule (commit …), with values redacted.
  • Without it: the script falls back to the same high-signal regexes as the hook below, and says so.
  • .env: a real .env (not .env.example) in the change is a finding by itself.

It ends with SECRETS SCAN: PASS/FAIL, exit 1 on FAIL.

The automatic net: the secrets-guard.sh PreToolUse hook (workstation/claude/hooks/, wired in ~/.claude/settings.json since 2026-07-30) blocks a git commit/git push from Claude whose change matches. Since 2026-10-17 it also runs gitleaks when installed. This script is the on-demand report with file:line; ship runs it as its secrets gate.

Verified 2026-10-17:

  • clean staged passes;
  • a staged Stripe key, a bad commit range and a staged .env each FAIL with file:line or the file name;
  • without gitleaks, the regex fallback FAILs on an AWS key;
  • --tree workstation/claude/skills passes.

Report

  • End with SECRETS SCAN: PASS or SECRETS SCAN: FAIL.
  • On FAIL, list each hit as file:line — <rule> with the value redacted (never echo the secret). Tell the operator to remove it AND rotate — a secret committed to git is compromised even if later deleted.
  • Don't cry wolf on obvious placeholders: buddy-is-the-king, hf_xxx…, <your-…>, ${VAR}, changeme, example, empty values. Note them as skipped.

Read the full file on GitHub · 58 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 17d ago Changed · +13 lines scan A → B 9f390278001d
  2. 2mo ago First seen · 45 lines · 88 tokens per session scan A 3eafa11f7113

Subscribe to this mod's changes

secrets-scan is a skill published in the GitHub repository chipi/agentic-ai-homelab (3 stars, last pushed today), licensed MIT. It adds 88 tokens to every session and 772 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.