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.
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-codenpx agentmods add commands/dykyi-roman/awesome-claude-code/audit-performanceWrote 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.
[](https://agentmods.dev/commands/dykyi-roman/awesome-claude-code/audit-performance)<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>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.
| Model | Per session | Once 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 |
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.
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:
- Split
$ARGUMENTSby--(space-dash-dash-space) - First part = positional arguments, Second part = meta-instructions
- In positional arguments, check if last word is a valid level (
quick|standard|deep) - If level found → extract it; remaining = path
- Also accept
level:quick|standard|deepin meta-instructions (backward compatibility) - Priority: positional > meta-instruction > default (
standard) - 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
-
Verify the path exists:
- If
$ARGUMENTSis empty, ask user for the project path - If path doesn't exist, report error and stop
- If
-
Verify it's a PHP project:
- Check for
composer.jsonor*.phpfiles - If not a PHP project, report and stop
- Check for
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."
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.
- 2d ago First seen · 271 lines · 32 tokens per session scan A f8896ea53e7b
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.
Other commands, from other repositories
codesage-reset
Drop a project's CodeSage index and rebuild from scratch (use after settings changes, device switches, or corruption).
cleanup
Detect and remove orphaned code, unused components, dead routes, and stale database artifacts.
sqlscript-validate
Validates SQLScript code for syntax, patterns, and best practices with auto-fix capability.
pg-health
Read-only PostgreSQL health check with pgbot, then a prioritized diagnosis.
data-flow-analysis
Trace how data flows through the system from input to output.
n1-scan
Scan ORM/data-access code for N+1 query patterns and emit idiomatic eager-loading fixes.