performance-audit

performance-audit is a command for coding agents from halflength-ampleness75/claude-code-recipes. It costs 17 tokens per session (1,282 once invoked), scanned A, original, MIT.

A command for examining an entire codebase for slow or wasteful behavior. It checks areas such as database queries, page rendering, downloaded code size, memory use, and startup time according to the project's technology.

In plain words
What is it for?
Use it to audit a web app, backend, command-line tool, or library for issues such as repeated database queries, missing indexes, inefficient rendering, large bundles, memory problems, or slow startup.
Why use it?
It helps locate performance bottlenecks instead of relying on guesswork. The review covers both user-facing and server-side causes where applicable.

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/halflength-ampleness75/claude-code-recipes/performance-audit
Clone the repo
git clone --depth 1 https://github.com/halflength-ampleness75/claude-code-recipes

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/halflength-ampleness75/claude-code-recipes/performance-audit.svg)](https://agentmods.dev/commands/halflength-ampleness75/claude-code-recipes/performance-audit)
Your own site
<a href="https://agentmods.dev/commands/halflength-ampleness75/claude-code-recipes/performance-audit"><img src="https://agentmods.dev/badge/commands/halflength-ampleness75/claude-code-recipes/performance-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 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,282 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.00017 $0.01282
Opus 5 $0.00009 $0.00641
Sonnet 5 $0.00003 $0.00256
Haiku 4.5 $0.00002 $0.00128

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

Security

Grade A, and why

performance-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 4d 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/performance-audit.md · 135 lines

How it starts

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

You are a performance engineer. Audit this codebase for performance bottlenecks and optimization opportunities.

Step 1 — Identify the Stack

Determine the project type and tech stack to focus on the most relevant checks:

  • Frontend: React, Vue, Svelte, Angular — check rendering, bundle size, lazy loading
  • Backend: Express, Fastify, Django, Flask, Rails — check queries, caching, async patterns
  • Full-stack: Check both sides plus the data transfer layer
  • CLI/Library: Check algorithmic complexity, memory usage, startup time

Read package.json, tsconfig.json, webpack.config.*, vite.config.*, build configs, and ORM configuration to understand the setup.

Step 2 — Database and Query Performance

Search for database queries and ORM usage:

N+1 Query Detection

  • Look for queries inside loops: a query in a for/forEach/map that runs once per item
  • In ORMs, look for lazy-loaded relationships accessed in loops without eager loading
  • Search for patterns like: loop -> await Model.findById(), loop -> .query(), loop -> SELECT
  • Check for missing .include(), .populate(), .prefetch_related(), .joins(), .eager_load()

Missing Indexes

  • Find WHERE, ORDER BY, GROUP BY clauses and check if the filtered columns are indexed
  • Look at schema/migration files for index definitions
  • Flag foreign key columns without indexes

Unbounded Queries

  • Search for queries without LIMIT or pagination
  • Look for SELECT * when only specific columns are needed
  • Check for missing cursor-based or offset pagination on list endpoints

Connection Management

  • Verify connection pooling is configured (not opening a new connection per request)
  • Check for missing connection cleanup or pool exhaustion risks

Step 3 — Frontend Performance (if applicable)

Rendering Efficiency

  • Search for components that re-render unnecessarily: missing React.memo, useMemo, useCallback on expensive computations or callbacks passed as props
  • Look for state updates that trigger re-renders of large subtrees
  • Check for inline object/array/function creation in JSX props (new reference every render)
  • Search for useEffect with missing or overly broad dependency arrays

Read the full file on GitHub · 135 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. 4d ago First seen · 135 lines · 17 tokens per session scan A 3874b426d318

Subscribe to this mod's changes

performance-audit is a command published in the GitHub repository halflength-ampleness75/claude-code-recipes (2 stars, last pushed 5d ago), licensed MIT. It adds 17 tokens to every session and 1,282 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-31.