Audits a codebase for performance bottlenecks across database queries, frontend rendering, bundle size, and memory usage. Identifies the tech stack first, then runs targeted checks for N+1 queries, missing indexes, unbounded queries, re-render issues, and code-splitting opportunities.
Ships in recipe-commands. Installing the plugin adds it to Claude Code.
You are a performance engineer. Audit this codebase for performance bottlenecks and optimization opportunities.
Determine the project type and tech stack to focus on the most relevant checks:
Read package.json, tsconfig.json, webpack.config.*, vite.config.*, build configs, and ORM configuration to understand the setup.
Search for database queries and ORM usage:
for/forEach/map that runs once per itemawait Model.findById(), loop -> .query(), loop -> SELECT.include(), .populate(), .prefetch_related(), .joins(), .eager_load()WHERE, ORDER BY, GROUP BY clauses and check if the filtered columns are indexedLIMIT or paginationSELECT * when only specific columns are neededReact.memo, useMemo, useCallback on expensive computations or callbacks passed as propsuseEffect with missing or overly broad dependency arrayslodash instead of lodash/get)dynamic import() or React.lazy() is used for route-level splittingwidth/height, no loading="lazy", uncompressed formats)<head>sleep, CPU-heavy computation on the event loopPromise.all() where independent async operations run sequentiallyCache-Control, ETag, Last-Modified)Search for hot paths and check algorithmic complexity:
.includes() or .indexOf() inside loops (use a Set)## Performance Audit Report
**Project:** (name)
**Stack:** (technologies)
**Files analyzed:** (count)
**Issues found:** (count)
### Critical (major performance impact, fix now)
- **[Category]** [File:Line] Description
- **Impact:** Why this is slow (e.g., "causes N+1 queries on every page load, ~200ms per additional item")
- **Fix:** Specific code change or approach
### Warning (noticeable performance impact)
- **[Category]** [File:Line] Description
- **Impact:** Estimated effect
- **Fix:** Recommended change
### Optimization Opportunity (nice-to-have improvement)
- **[Category]** [File:Line] Description
- **Impact:** Expected improvement
- **Fix:** Suggested approach
### Metrics to Monitor
- Key performance indicators to track after fixes are applied
- Suggested tools for ongoing monitoring (Lighthouse, profiler, APM)
### Quick Wins (highest impact-to-effort ratio)
1. (change) -- estimated impact -- effort: minutes/hours
2. ...
Prioritize findings by impact. Every recommendation must include a concrete code-level fix, not just a general suggestion.
What the command file sets; muted values are Claude Code's defaults
sonnet7-day visitors to each command page
15 commands in this plugin
/api-genStep 1 -- Understand the RequirementsGenerate REST API endpoints with routes, validation, error handling, and tests/audit-reposStep 1 -- List the ReposAudit all your GitHub repos for CI health, hygiene, security alerts, and staleness/check-all-prsStep 1 -- Find the PRsCheck all your open PRs across GitHub repos for CI, reviews, and merge readiness/recipe-commands:performance-auditfrom recipe-commands
npx claudepluginhub sagargupta16/claude-code-recipes --plugin recipe-commandsOther plugins' commands for the same job