audit-codebase

A codebase audit command that reviews software for security risks, performance problems, and common engineering practices, then reports findings with severity, file, line, and recommended action.

In plain words
What is it for?
Use it to look for exposed secrets, unsafe input handling, authentication or authorisation gaps, information leaks, slow code, memory problems, inefficient database queries, and caching issues.
Why use it?
It brings several kinds of code review into one report and helps identify issues that may be missed during ordinary feature work.

Command

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/sgaunet/claude-plugins/audit-codebase
Clone the repo
git clone --depth 1 https://github.com/sgaunet/claude-plugins
Per session 14 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,199 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.00014 $0.01199
Opus 5 $0.00007 $0.00600
Sonnet 5 $0.00003 $0.00240
Haiku 4.5 $0.00001 $0.00120

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

Security

Grade A, and why

audit-codebase 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 2d 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.

plugins/software-engineering/commands/audit-codebase.md · 107 lines

How it starts

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

Audit Codebase Command

Audit the code for potential security vulnerabilities, performance issues, and adherence to best practices. Provide a detailed report with recommendations for improvements.

Process

  1. Discover Codebase Structure: Use Glob and Bash to identify key directories and file types to audit.

  2. Launch 3 parallel Sonnet agents to independently audit different aspects of the codebase:

    Agent #1: Security Auditor

    • Check for exposed secrets or sensitive data
    • Validate input handling to prevent injection attacks
    • Ensure proper authentication and authorization mechanisms
    • Review error handling to avoid information leakage
    • Verify use of secure libraries and dependencies
    • Return findings in format: {severity: "CRITICAL"|"HIGH"|"MEDIUM"|"LOW", file: "path/to/file.ext", line: N, finding: "...", recommendation: "..."}

    Agent #2: Performance Analyzer

    • Identify and optimize slow or inefficient code paths
    • Analyze memory usage and detect potential leaks
    • Review database queries for performance issues
    • Evaluate caching strategies and their effectiveness
    • Return findings in format: {severity: "CRITICAL"|"HIGH"|"MEDIUM"|"LOW", file: "path/to/file.ext", line: N, finding: "...", recommendation: "..."}

    Agent #3: Best Practices Reviewer

    • Ensure adherence to coding standards and style guides
    • Review documentation for completeness and clarity
    • Evaluate test coverage and effectiveness
    • Identify opportunities for code simplification and refactoring
    • Return findings in format: {severity: "CRITICAL"|"HIGH"|"MEDIUM"|"LOW", file: "path/to/file.ext", line: N, finding: "...", recommendation: "..."}
  3. Aggregate Results: Collect findings from all 3 agents and merge into unified report.

  4. Prioritize Findings: Sort by severity (Critical → High → Medium → Low) within each category.

Agent Invocation Examples

Use the Task tool to launch agents in parallel:

Task(subagent_type: "security-auditor", model: "sonnet", prompt: "Audit codebase for security vulnerabilities. Focus on: exposed secrets, injection attacks, auth mechanisms, error handling, dependency security. Return findings with severity levels.")

Task(subagent_type: "general-purpose", model: "sonnet", prompt: "Analyze codebase for performance issues. Focus on: inefficient code paths, memory leaks, database queries, caching strategies. Return findings with severity levels.")

Task(subagent_type: "general-purpose", model: "sonnet", prompt: "Review codebase for best practices adherence. Focus on: coding standards, documentation, test coverage, refactoring opportunities. Return findings with severity levels.")

Read the full file on GitHub · 107 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. 2d ago First seen · 107 lines · 14 tokens per session scan A 0afa4d0c5ff5

Subscribe to this mod's changes

audit-codebase is a command published in the GitHub repository sgaunet/claude-plugins (16 stars, last pushed 7d ago), licensed MIT. It adds 14 tokens to every session and 1,199 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-30.