security-audit

security-audit is a command for Claude Code from KhaledSaeed18/dotclaude. It costs 86 tokens per session (1,131 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

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

Part of the security plugin — 3 skills, 1 command, 1 agent shipped together

Good fit 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.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/khaledsaeed18/dotclaude/security-audit
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.

Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install security, the plugin that ships this one along with the rest of its 3 skills, 1 command, 1 agent.

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/github.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/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 security-audit

Your own site · 80×15
<a href="https://agentmods.dev/commands/khaledsaeed18/dotclaude/security-audit"><img src="https://agentmods.dev/badge/commands/khaledsaeed18/dotclaude/security-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 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,131 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.00086 $0.01131
Opus 5.5 $0.00034 $0.00452
Sonnet 5.5 $0.00017 $0.00226
Haiku 4.5 $0.00009 $0.00113

Measured 28d ago against content hash 26ca84fa1bbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 28d 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. 28d ago Changed · -10 tokens per session 26ca84fa1bbb
  2. 1mo 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 6d ago), licensed MIT. It adds 86 tokens to every session and 1,131 once invoked, about $0.0003 per session on Opus 5.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.