scan

scan is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 9 tokens per session (4,573 once invoked), scanned B, original, MIT.

A command that scans completed software for security weaknesses, unsafe dependencies, leaked secrets, and incorrect security settings before deployment.

In plain words
What is it for?
Use it after implementation and tests are complete to run the available security checks and combine their findings into a summary.
Why use it?
Security problems can remain even when the software’s tests pass. Scanning adds a pre-release check for vulnerabilities and configuration mistakes.

Command for Claude Code

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.

agentmods
npx agentmods add commands/dinhnguyenngoc/spec-driven-claude-code/scan
Clone the repo
git clone --depth 1 https://github.com/dinhnguyenngoc/spec-driven-claude-code

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 scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/scan.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/scan)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/scan"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/scan.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,573 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00009 $0.04573
Opus 5 $0.00005 $0.02286
Sonnet 5 $0.00002 $0.00915
Haiku 4.5 $0.00001 $0.00457

Measured 4d ago against content hash 88bff93186f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

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 4d 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.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

| **SSRF** | Code path fetches user-supplied URL (URL preview, webhook, image proxy, RSS, OAuth callback) | Integration test DI-resolve REAL fetcher, attempt: `127.0.0.1`, RFC1918 (`10.x`, `192.168.x`, `172.16.x`), `169.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/commands/scan.md · 334 lines

How it starts

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

/scan — Security Scan

"Trust but verify."

Purpose

Comprehensive security scan of completed code before deployment. Detect vulnerabilities, insecure dependencies, and security misconfigurations.

Workspace Mode: if the session root declares Mode: workspace → resolve the target repo per CLAUDE.md §Workspace Mode before anything else; every path, probe, and gate below is relative to the target repo, and the workspace disk-check applies at the gate.

Prerequisites

Required:

  • Code implementation complete (/build done)
  • Tests passing (/test done)

Optional (if available):

  • Code review approved (reports/CODE_REVIEW.md from /review)

Quick reference: references/security-checklist.md — pre-deploy security verification checklist (cross-check before composing SCAN_REPORT).

Automation script (already prepared — the agent does NOT run each tool manually):


Workflow

Time-optimization principle: The entire tooling execution (gitleaks, semgrep, dotnet vuln, npm audit, trivy, hadolint, ESLint, XSS grep, secrets grep, Roslyn analyzers) is already scripted. The agent runs just 1 command and reads 1 summary file instead of typing ~25 commands sequentially.

The part that NEEDS the agent's brain (not automated): STRIDE re-evaluation matrix + Finding triage + Approval narrative. These are Phase 2–4 below.

Phase 0: Run Automation Script (a single command)

bash .claude/scripts/scan-all.sh

Script architecture: Phase 1 inventory + auto-detect stack → Phase 2 universal (secrets) → Phase 3 dispatch per-stack via auto-discovered plugins in scripts/scanners/*.sh (currently dotnet, nodejs, python, php, docker — extend by adding scanners/<stack>.sh with a scan_<stack>() function) → Phase 4 summarize. The list below is the union of scans that may run; any step that does not match the detected stack is skipped automatically.

Read the full file on GitHub · 334 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. 4d ago First seen · 334 lines · 9 tokens per session scan B 88bff93186f9

Subscribe to this mod's changes

scan is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (20 stars, last pushed 5d ago), licensed MIT. It adds 9 tokens to every session and 4,573 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.