audit-performance

audit-performance is a command for Claude Code from dykyi-roman/awesome-claude-code. It costs 32 tokens per session (2,136 once invoked), scanned A, original, MIT.

A performance review command for source code and its data access. It examines database queries, memory use, caching, loops, batching, connection pools, and serialization.

In plain words
What is it for?
Use it to investigate issues such as N+1 queries, inefficient algorithms, memory pressure, missing caches, and costly data conversion.
Why use it?
It helps locate slow or wasteful operations before they become user-facing performance problems.

Command for Claude Code

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is /acc:audit-performance ./src/Repository -- focus on N+1 and query efficiency.

Part of the acc plugin — 101 skills, 26 commands, 68 agents, 1 hook shipped together

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code
agentmods
npx agentmods add commands/dykyi-roman/awesome-claude-code/audit-performance

Made for: Claude Code.

Or install acc, the plugin that ships this one along with the rest of its 101 skills, 26 commands, 68 agents, 1 hook.

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-performance

README.md
[![agentmods](https://agentmods.dev/badge/commands/dykyi-roman/awesome-claude-code/audit-performance.svg)](https://agentmods.dev/commands/dykyi-roman/awesome-claude-code/audit-performance)
Your own site
<a href="https://agentmods.dev/commands/dykyi-roman/awesome-claude-code/audit-performance"><img src="https://agentmods.dev/badge/commands/dykyi-roman/awesome-claude-code/audit-performance.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,136 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.1 $0.00032 $0.02136
Opus 5 $0.00016 $0.01068
Sonnet 5 $0.00006 $0.00427
Haiku 4.5 $0.00003 $0.00214

Measured 2d ago against content hash f8896ea53e7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

audit-performance 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.

commands/audit-performance.md · 271 lines

How it starts

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

Performance Audit

Perform a comprehensive performance audit focusing on database queries, memory usage, caching, and algorithm efficiency.

Input Parsing

Parse $ARGUMENTS to extract path, level, and optional meta-instructions:

Format: <path> [level] [-- <meta-instructions>]

Arguments:
- path: Target directory or file (required, default: current directory)
- level: Audit depth - quick|standard|deep (optional, default: standard)
- -- meta-instructions: Additional focus areas or filters (optional)

Examples:
- /acc:audit-performance ./src
- /acc:audit-performance ./src deep
- /acc:audit-performance ./src quick
- /acc:audit-performance ./src -- focus on memory and caching
- /acc:audit-performance ./src deep -- focus on N+1 queries
- /acc:audit-performance ./src -- level:deep (backward compatible)

Parsing rules:

  1. Split $ARGUMENTS by -- (space-dash-dash-space)
  2. First part = positional arguments, Second part = meta-instructions
  3. In positional arguments, check if last word is a valid level (quick|standard|deep)
  4. If level found → extract it; remaining = path
  5. Also accept level:quick|standard|deep in meta-instructions (backward compatibility)
  6. Priority: positional > meta-instruction > default (standard)
  7. Default path: current directory (if empty)

Target

  • Path: First part of $ARGUMENTS (before --)
  • Meta-instructions: Second part (after --) — customize audit focus

If meta-instructions provided, adjust audit to:

  • Focus on specific performance categories
  • Skip categories if requested
  • Apply additional depth to specific areas
  • Modify output verbosity

Pre-flight Check

  1. Verify the path exists:

    • If $ARGUMENTS is empty, ask user for the project path
    • If path doesn't exist, report error and stop
  2. Verify it's a PHP project:

    • Check for composer.json or *.php files
    • If not a PHP project, report and stop

Instructions

Use three specialized reviewers in parallel:

Task tool with subagent_type="acc:performance-reviewer"
prompt: "Perform performance audit on [PATH]. Audit level: [LEVEL]. [META-INSTRUCTIONS if provided]

Analyze for:
1. N+1 Query Problems — queries inside loops, missing eager loading
2. Query Efficiency — SELECT *, missing indexes, full table scans
3. Caching Strategy — missing cache opportunities, repeated expensive operations
4. Unnecessary Loops — nested loop inefficiency, redundant iterations
5. Lazy Loading Problems — premature loading, missing pagination
6. Batch Processing — single-item vs bulk operations, transaction overhead
7. Algorithm Complexity — O(n²) patterns, exponential growth
8. Database Index Usage — missing indexes, incorrect composite order

Provide severity classification, impact estimates, current vs optimal complexity, code examples."

Task tool with subagent_type="acc:resource-reviewer"
prompt: "Perform resource usage audit on [PATH]. Audit level: [LEVEL]. [META-INSTRUCTIONS if provided]

Analyze for:
1. Memory Issues — large arrays, missing generators, unbounded loading
2. Connection Pool Issues — leaks, connections in loops, missing cleanup
3. Serialization Overhead — large objects, N+1 during serialization
4. Async Patterns — blocking operations in request cycle
5. File I/O Patterns — full file reads, missing streaming

Provide severity classification, impact estimates, code examples."

Task tool with subagent_type="acc:scalability-reviewer"
prompt: "Perform scalability audit on [PATH]. Audit level: [LEVEL]. [META-INSTRUCTIONS if provided]

Analyze for:
1. Scalability Readiness — stateless design, session handling, hardcoded config
2. Database Scaling — read/write separation, connection pooling, replica usage

Provide severity classification, scaling impact, code examples."

Read the full file on GitHub · 271 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 · 271 lines · 32 tokens per session scan A f8896ea53e7b

Subscribe to this mod's changes

audit-performance is a command published in the GitHub repository dykyi-roman/awesome-claude-code (96 stars, last pushed 21d ago), licensed MIT. It adds 32 tokens to every session and 2,136 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.