audit

audit is a command for coding agents from juanmhidalgo/claude-plugins. It costs 38 tokens per session (736 once invoked), scanned A, original, MIT.

A command for auditing a codebase for performance bottlenecks and inefficient patterns after a performance problem has been measured. It can examine frontend, backend, and database-related code.

In plain words
What is it for?
Use it to audit a specific area or an entire application, identify performance anti-patterns, and recommend changes based on the detected technology stack.
Why use it?
It turns profiling evidence into a broader review of likely causes, such as repeated database queries, unbounded data fetches, or oversized frontend bundles.

Command

Part of the performance plugin — 1 skill, 2 commands shipped together

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/juanmhidalgo/claude-plugins/audit
Clone the repo
git clone --depth 1 https://github.com/juanmhidalgo/claude-plugins

Or install performance, the plugin that ships this one along with the rest of its 1 skill, 2 commands.

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 audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/audit.svg)](https://agentmods.dev/commands/juanmhidalgo/claude-plugins/audit)
Your own site
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/audit"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 736 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.00038 $0.00736
Opus 5 $0.00019 $0.00368
Sonnet 5 $0.00008 $0.00147
Haiku 4.5 $0.00004 $0.00074

Measured yesterday against content hash 6420d934a06f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 yesterday.

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.

performance/commands/audit.md · 96 lines

What it actually says

Context

  • Branch: !git branch --show-current
  • Recent commits: !git log --oneline -5

<best_practices> @performance/skills/performance-optimization/SKILL.md </best_practices>

Performance Audit Workflow

Audit scope: $ARGUMENTS (if empty, audit the full codebase for anti-patterns).

Rule: NEVER optimize without measurement. Measure → Identify → Fix → Verify → Guard.

Phase 1: Scope & Stack Detection

  1. Determine audit scope from argument (specific path, endpoint, or full app)
  2. Detect the stack: frontend (React, Vue, etc.), backend (Node, Python, etc.), or both
  3. Identify build tools, test frameworks, and available profiling commands

Phase 2: Anti-Pattern Scan

Search the codebase for common performance anti-patterns:

Backend:

  • N+1 queries: nested loops with database calls, missing include/select_related
  • Unbounded fetches: findMany() / SELECT * without LIMIT or pagination
  • Blocking operations in async contexts
  • Missing database indexes for frequently queried columns

Frontend:

  • Large bundle: importing entire libraries instead of specific functions
  • Missing code splitting: no lazy() / dynamic import()
  • Unnecessary re-renders: inline object/function creation in JSX
  • Images without dimensions, lazy loading, or responsive sources
  • Render-blocking CSS/JS in the head

Phase 3: Measurement

Run appropriate profiling tools:

  • Frontend: Bundle size analysis, Lighthouse (if available)
  • Backend: Query logging, endpoint response times
  • Both: Build time, test suite duration

Phase 4: Report

For each finding:

  1. What: The specific anti-pattern or bottleneck
  2. Where: File path and line number
  3. Impact: Estimated performance effect (high/medium/low)
  4. Fix: Concrete code change with before/after
  5. Verify: How to measure the improvement

Organize findings by impact (highest first).

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. yesterday First seen · 96 lines · 38 tokens per session scan A 6420d934a06f

Subscribe to this mod's changes

audit is a command published in the GitHub repository juanmhidalgo/claude-plugins (8 stars, last pushed 10d ago), licensed MIT. It adds 38 tokens to every session and 736 once invoked, about $0.0002 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-09-03.