security-audit

security-audit is a command for Claude Code from KhaledSaeed18/dotclaude. It costs 96 tokens per session (1,141 once invoked), scanned A, original, MIT.

A command for reviewing an entire codebase for common security vulnerabilities and risky dependencies.

In plain words
What is it for?
Use it on a repository or a specified path. It examines the application structure, dependencies, and likely secret locations, then reports findings by severity with remediation steps.
Why use it?
It provides a broader security check than a review of only recently changed code, helping uncover problems across entry points, authentication, inputs, secrets, and packages.

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/khaledsaeed18/dotclaude/security-audit
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

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 security-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/khaledsaeed18/dotclaude/security-audit.svg)](https://agentmods.dev/commands/khaledsaeed18/dotclaude/security-audit)
Your own site
<a href="https://agentmods.dev/commands/khaledsaeed18/dotclaude/security-audit"><img src="https://agentmods.dev/badge/commands/khaledsaeed18/dotclaude/security-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 96 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,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00096 $0.01141
Opus 5 $0.00048 $0.00571
Sonnet 5 $0.00019 $0.00228
Haiku 4.5 $0.00010 $0.00114

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

Security

Grade A, and why

security-audit 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 3d 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-plugin/plugins/security/commands/security-audit.md · 112 lines

How it starts

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

Context

Scope: $ARGUMENTS (defaults to the entire repository if blank)

Dependency manifest:

!cat package.json 2>/dev/null | head -60

Recent changes:

!git log --oneline -10 2>/dev/null

Task

Conduct a structured security audit of the codebase (or the path given in $ARGUMENTS). Report findings ranked by severity with concrete evidence and specific remediation steps.

Step 1: Establish scope and entry points

# Identify entry points: routes, controllers, handlers
find ${ARGUMENTS:-.} -name "*.ts" -o -name "*.js" -o -name "*.py" \
  | grep -v node_modules | grep -iE "route|controller|handler|api|server|app" | head -20

Read the top-level entry files first. Then trace inward through authentication middleware, input validation layers, and data access code.

Step 2: Check dependencies

npm audit --json 2>/dev/null | head -200

Flag CVEs in direct dependencies, stale packages with no recent releases, and overly permissive version ranges (*, >=0).

Step 3: Scan for hardcoded secrets

grep -rn --include="*.ts" --include="*.js" --include="*.json" --include="*.yaml" --include="*.env*" \
  -E "(api_key|apikey|secret|password|passwd|token|private_key|access_key)\s*[:=]\s*['\"][^'\"]{8,}" \
  ${ARGUMENTS:-.} | grep -v node_modules | grep -v ".env.example" | head -40

Step 4: Audit by vulnerability class

Work through each class. Skip classes that clearly do not apply.

Injection (OWASP A03)

  • Parameterized queries used everywhere, or string concatenation into SQL/NoSQL queries?
  • exec / spawn with user-controlled input?
  • path.join / file reads on user-supplied paths without canonicalization?

Broken Access Control (OWASP A01)

  • Ownership and permission checks on every resource endpoint?
  • Horizontal escalation: can user A reach user B's data by changing an ID?
  • Vertical escalation: can a regular user reach admin functionality?
  • Any access control enforced only client-side?

Broken Authentication (OWASP A07)

  • Password hashing with bcrypt, argon2, or scrypt? Never MD5/SHA1/SHA256 for passwords.
  • JWT alg field pinned? alg: none accepted?
  • Session tokens cryptographically random, HttpOnly, Secure, SameSite?
  • Rate limiting on login, password reset, and OTP endpoints?

Read the full file on GitHub · 112 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. 3d ago First seen · 112 lines · 96 tokens per session scan A 19e38c497d1a

Subscribe to this mod's changes

security-audit is a command published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 2d ago), licensed MIT. It adds 96 tokens to every session and 1,141 once invoked, about $0.0005 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.