performance-check

A code review focused on speed, memory use and resource-heavy patterns. It checks file sizes, loops, synchronous operations, imports, dependencies and asynchronous code.

In plain words
What is it for?
Use it to inspect large files, heavy package imports, nested operations, unnecessary memory use, blocking calls and possible promise or await problems.
Why use it?
It helps identify likely bottlenecks and inefficient code before they cause slow applications or expensive resource use.

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/cassler/awesome-claude-code-setup/performance-check
Clone the repo
git clone --depth 1 https://github.com/cassler/awesome-claude-code-setup
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 562 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00000 $0.00562
Opus 5 $0.00000 $0.00281
Sonnet 5 $0.00000 $0.00112
Haiku 4.5 $0.00000 $0.00056

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

Security

Grade A, and why

performance-check scanned grade A with 1 finding 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

chs find-code "readFileSync\|execSync\|statSync"
commands/performance-check.md · 85 lines

How it starts

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

Performance Check

Please analyze this codebase for performance issues and optimization opportunities:

1. File Size Analysis

Check for files that might be too large:

# Find large files
chs large-files 500  # Files over 500 lines

# Check overall codebase size
ch ts size  # For Node projects
find . -name "*.js" -o -name "*.ts" | xargs wc -l | sort -n

2. Common Performance Anti-Patterns

Search for potential bottlenecks:

# Nested loops
chs find-code "for.*for\|while.*while"
chs find-code "\.forEach.*\.forEach\|\.map.*\.map"

# Synchronous operations
chs find-code "readFileSync\|execSync\|statSync"

# Inefficient array operations
chs find-code "\.shift()\|\.unshift()"

# Large data in memory
chs find-code "JSON\.parse.*readFile\|\.split.*readFile"

3. Bundle & Import Analysis

Check for heavy dependencies:

# Find large imports
chs search-imports "moment\|lodash"

# Check for whole package imports
chs find-code "import .* from ['\"]\w+['\"]"  # vs specific imports

# Find dynamic imports
chs find-code "import(\|require("

4. Async/Promise Issues

Look for async problems:

# Missing await
chs find-code "async.*{" | xargs grep -L "await"

# Promise chains that could be async/await
chs find-code "\.then.*\.then\|\.catch.*\.then"

# Potential race conditions
chs find-code "Promise\.all\|Promise\.race"

5. Memory Leak Risks

Identify potential memory issues:

# Event listeners without cleanup
chs find-code "addEventListener" | xargs grep -L "removeEventListener"

# Timers without cleanup
chs find-code "setInterval\|setTimeout" | xargs grep -L "clear"

# Global variables
chs find-code "^(var\|let\|const).*window\.\|global\."

6. Generate Optimization Report

Create a prioritized list of:

  • Critical: Issues causing immediate performance problems
  • High: Significant optimization opportunities
  • Medium: Good practices that would help
  • Low: Nice-to-have improvements

For each issue, provide:

  • The problem and its impact
  • Specific code locations
  • Recommended solution
  • Estimated effort

Read the full file on GitHub · 85 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 · 85 lines · 0 tokens per session scan A 7f58ed06eceb

Subscribe to this mod's changes

performance-check is a command published in the GitHub repository cassler/awesome-claude-code-setup (267 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 562 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.