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.
git clone --depth 1 https://github.com/fatihkan/badiWrote 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.
[](https://agentmods.dev/commands/fatihkan/badi/perf-check)<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>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.
| Model | Per session | Once 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 |
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.
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 measurementbadi 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 insideforEach/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.jsondependency count - Measure the build output size if present
- Check the total
node_modulessize - ...
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
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.
- today First seen · 113 lines · 0 tokens per session scan A 7429e3a0b28c
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.
Other commands, from other repositories
check-cache-bugs
Audit Claude Code setup for cache bugs (CC#40524) — sentinel, --resume/--continue, attribution header + ArkNill B3/B4/B5.
investigate
Systematic root-cause debugging — find the cause before writing any fix.
optimize
Analyze and suggest performance improvements for code, queries, or systems.
diagnose
Interactive troubleshooting assistant for Claude Code issues.
audit-agents-skills
Audit quality of agents, skills, and commands in a Claude Code project.
land-and-deploy
Merge PR, wait for CI, verify deploy, run canary — the complete landing pipeline.