perf

perf is a command for Claude Code from Insight-Services-APAC/ingenious. It costs 0 tokens per session (697 once invoked), scanned A, original, MIT.

A command that examines a codebase for performance bottlenecks, which are parts that make software slower or use more resources than necessary.

In plain words
What is it for?
Use it to inspect query patterns, indexes, caching, API calls, payloads, timeouts, request handling, and browser-side rendering work.
Why use it?
It helps find costly database queries, network calls, and frontend work before they become user-visible slowdowns.

Command for Claude Code

Written for Claude Code: installed under .claude/.

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/insight-services-apac/ingenious/perf
Clone the repo
git clone --depth 1 https://github.com/Insight-Services-APAC/ingenious

Made for: Claude Code.

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 perf

README.md
[![agentmods](https://agentmods.dev/badge/commands/insight-services-apac/ingenious/perf.svg)](https://agentmods.dev/commands/insight-services-apac/ingenious/perf)
Your own site
<a href="https://agentmods.dev/commands/insight-services-apac/ingenious/perf"><img src="https://agentmods.dev/badge/commands/insight-services-apac/ingenious/perf.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 697 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.00000 $0.00697
Opus 5 $0.00000 $0.00349
Sonnet 5 $0.00000 $0.00139
Haiku 4.5 $0.00000 $0.00070

Measured yesterday against content hash 328e7841133a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

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

.claude/commands/analysis/perf.md · 109 lines

How it starts

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

Performance Bottleneck Analysis

Perform deep analysis to identify performance bottlenecks across the codebase.

1. Database and Query Performance

Search for:

  • N+1 query patterns (loops containing database queries)
  • Missing indexes on frequently queried columns
  • SELECT * queries instead of specific columns
  • Lack of query result caching
  • Missing pagination on large result sets
  • Synchronous database calls in loops
  • Missing connection pooling configuration

Check: ORM models, database queries, migration files

2. API and Network Performance

Search for:

  • Sequential API calls that could be parallelized
  • Missing request/response caching
  • Large payloads without compression
  • Synchronous external API calls blocking request handlers
  • Missing timeout configurations
  • Repeated API calls for same data
  • No rate limiting or circuit breakers

Check: API routes, HTTP clients, service layers

3. Frontend Performance

Search for:

  • Large inline scripts/data in HTML templates
  • Missing lazy loading for images/components
  • Excessive DOM manipulation in loops
  • No debouncing/throttling on frequent events
  • Large reactive data objects causing overhead
  • Missing code splitting or bundling
  • Synchronous operations blocking UI rendering
  • Unnecessary re-renders or watchers

Check: Templates, JavaScript files, event handlers

4. Backend Processing Performance

Search for:

  • Synchronous processing of large datasets
  • Missing async/await patterns
  • Blocking I/O operations
  • Inefficient loops (nested loops, repeated operations)
  • Large file operations without streaming
  • Missing worker queues for background tasks
  • Heavy computation in request handlers
  • No caching of expensive operations

Check: Service classes, background jobs, data processing logic

5. Memory and Resource Management

Search for:

  • Memory leaks (unclosed connections, unreleased resources)
  • Large objects kept in memory unnecessarily
  • Missing context managers for file/connection handling
  • Unbounded collections or caches
  • Circular references preventing garbage collection
  • Missing resource pooling
  • Large log statements in hot paths

Read the full file on GitHub · 109 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. yesterday First seen · 109 lines · 0 tokens per session scan A 328e7841133a

Subscribe to this mod's changes

perf is a command published in the GitHub repository Insight-Services-APAC/ingenious (24 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 697 tokens. 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-04.