perf-check

perf-check is a command for Claude Code from fatihkan/badi. It costs 0 tokens per session (705 once invoked), scanned A, original, MIT.

A performance analysis command that finds slow or costly parts of a codebase and checks live web-page speed when a production URL is available.

In plain words
What is it for?
Use it to review frequently changed files, detect long or deeply nested functions, inspect page speed, and identify areas for optimization.
Why use it?
It helps locate likely bottlenecks without relying only on guesswork. It combines code inspection with real-world page measurements such as Core Web Vitals, which describe loading speed and visual stability.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Part of the badi plugin — 81 skills, 86 commands, 30 agents, 7 hooks shipped together

Good fit Use it to review frequently changed files, detect long or deeply nested functions, inspect page speed, and identify areas for optimization.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fatihkan/badi/perf-check
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.

Clone the repo
git clone --depth 1 https://github.com/fatihkan/badi

Made for: Claude Code.

Or install badi, the plugin that ships this one along with the rest of its 81 skills, 86 commands, 30 agents, 7 hooks.

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-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/fatihkan/badi/perf-check.svg)](https://agentmods.dev/commands/fatihkan/badi/perf-check)
Your own site
<a href="https://agentmods.dev/commands/fatihkan/badi/perf-check"><img src="https://agentmods.dev/badge/commands/fatihkan/badi/perf-check.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 705 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00705
Opus 5 $0.00000 $0.00352
Sonnet 5 $0.00000 $0.00141
Haiku 4.5 $0.00000 $0.00071

Measured today against content hash 7429e3a0b28c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

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

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/perf-check.md · 113 lines

How it starts

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

Performance profiling. Detects hot paths, bottlenecks, and optimization opportunities.

Badi CLI Commands (v1.6+)

If a production URL exists:

  • badi lighthouse [url] — Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index)
  • badi lighthouse [url] --desktop — Separate desktop measurement
  • badi seo speed [url] — Page speed + resource analysis (v1.4+)

These CLI tools give real-world metrics (PageSpeed Insights). The code-based analyses (steps below) complement them.

Required Tools

  • Bash (build commands, file size calculation)
  • Read (source code analysis)
  • Grep (pattern search)
  • ...

Agent Delegation

This command delegates the main analysis to the performance-profiler agent. If the agent is unavailable, apply the steps below directly.


Section 1: Hot Path Detection

Step 1: Frequently Changed Files

  • Find the most-changed files in the last 50 commits with git log --format=format: --name-only
  • List the 10 most frequently changed files
  • Add their complexity and size info
  • ...

Step 2: Complex Function Detection

  • Detect long functions (50+ lines)
  • Find deeply nested structures (4+ indent levels)
  • Flag functions with multiple loops
  • ...

Step 3: Import/Dependency Analysis

  • Detect files with too many imports
  • Look for circular dependencies
  • Find unused imports

Section 2: Database Query Analysis

Step 4: N+1 Query Pattern Detection

Search the code for these patterns:

  • Database calls inside loops
  • Missing eager loading on ORM relations
  • awaited database operations inside forEach/map
  • ...

Step 5: Query Optimization Suggestions

  • Index usage suggestions
  • Batch-conversion opportunities
  • Needless query repetition
  • ...

Section 3: Bundle and Build Sizes

Step 6: Build Size Analysis

  • Report the package.json dependency count
  • Measure the build output size if present
  • Check the total node_modules size
  • ...

Step 7: Dependency Weight Analysis

  • Rank the largest dependencies by size
  • Detect heavy libraries with lighter alternatives Example: moment.js -> date-fns, lodash -> lodash-es or native methods
  • Check dev dependencies leaking into the production build
  • Detect duplicate packages

Read the full file on GitHub · 113 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. today First seen · 113 lines · 0 tokens per session scan A 7429e3a0b28c

Subscribe to this mod's changes

perf-check is a command published in the GitHub repository fatihkan/badi (7 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 705 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-06.