performance-analysis · autohandai — Claude Code skill: what it does, how to install
Guides coding agents to measure latency or memory usage before editing code. Pinpoints performance bottlenecks with reproducible numbers.
npx skills add autohandai/code-cli --skill performance-analysis -a claude-codeWhat performance-analysis does
This skill enforces a measurement-first workflow for performance issues. Instead of guessing, the agent defines the exact scenario and takes three baseline measurements using tools already in the project, such as hyperfine or language profilers. It also checks background system load, because a busy CPU invalidates benchmark comparisons.
Next, the agent splits total runtime into phases to separate blocking I/O from pure CPU work. It inspects the codebase with tools like run_command, git_diff, and grep to spot N+1 queries, un-cached repetitive work, or sequential await calls.
Only one change is applied at a time, chosen by the highest expected payoff relative to risk. The agent re-measures the metric, reports before-and-after numbers with line references, and suggests a timing assertion or budget guard to prevent regressions.
What it helps with
- trace latency spikes and startup regressions with profiler data
- isolate blocking I/O from CPU-bound computation
- detect sequential awaits and repeated un-cached operations
- establish timing assertions and performance budgets in tests
Example prompts for the agent
- Profile the CLI startup time and show me the baseline numbers before touching the code.
- Find why this API endpoint takes over two seconds under load and identify the dominant bottleneck.
- Measure memory consumption during large file processing and propose the smallest fix.
How to install performance-analysis
1Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a claude-code2Manually: put the files in place
~/.claude/skills/performance-analysis/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/performance-analysis/
1Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a codex2Manually: put the files in place
.agents/skills/performance-analysis/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a cursor2Manually: put the files in place
.cursor/skills/performance-analysis/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install autohandai/code-cli performance-analysis2Manually: put the files in place
.github/skills/performance-analysis/SKILL.md1Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a gemini-cli2Platform CLI
gemini skills install https://github.com/autohandai/code-cli --path src/skills/builtin/performance-analysisManually: put the files in place
.devin/skills/performance-analysis/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add autohandai/code-cli --skill performance-analysis -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about performance-analysis
How to install performance-analysis in Claude Code?
Run npx skills add autohandai/code-cli --skill performance-analysis -a claude-code. The skill definition will be saved to ~/.claude/skills/performance-analysis/SKILL.md.
What does performance-analysis do?
It instructs your agent to profile code before attempting optimizations. The agent collects baseline metrics, identifies bottlenecks with evidence, modifies one element at a time, and verifies the outcome with follow-up runs.
What tools does the agent use to measure performance?
The agent relies on utilities already configured in the project or OS environment. These include hyperfine, time, heap snapshots, bundle analyzers, and built-in language profiling flags like --cpu-prof.
Source text
SKILL.md · Apache-2.0
--- name: performance-analysis description: Measure before optimizing. Profile startup time, latency, throughput, memory, or bundle size, find the dominant cost with evidence, and propose the smallest change that moves the number. Use for "slow", "takes N seconds", "high CPU or memory", and performance regressions. allowed-tools: read_file find_grep fff_find list_tree run_command git_log git_diff file_stats --- # Analyze performance with numbers Optimizing without a measurement changes the code without changing the outcome. Every step below produces a number you can show. ## Establish the baseline 1. Define the metric and the scenario exactly: what is slow, from which event to which, on what input size, on what machine. Ask if unclear. 2. Measure it three times with the tools the project already has (timers, `--profile` flags, `time`, `hyperfine`, language profilers, `--cpu-prof`, heap snapshots, bundle analyzers). Record median and spread. 3. Record the environment: load average, CPU count, disk free, network, concurrent processes. A loaded machine invalidates comparisons. ## Find the dominant cost - Break the total into phases with timestamps or a profiler; sort by time. - Distinguish blocking waits (network, disk, subprocess, locks, timeouts) from CPU work; the fix differs. - Look for the usual shapes: sequential awaits that could be parallel, work repeated per item that could be cached, unbounded scans that need a budget, startup work that could be lazy or deferred, N+1 calls, large payloads, synchronous I/O on the main thread, retries with long timeouts. - Check what scales with input size using two sizes and compare. ## Change one thing, then measure again - Pick the change with the best ratio of expected gain to risk. State the expected gain before making it. - Re-measure the same way. Report before and after with the spread. - Add a guard so it stays fixed: a timing assertion with a generous bound, a budget constant, or a test that the work is deferred or cached. ## Report Metric, scenario, baseline, cause with file:line, change, result, and what was not addressed. If the measurement showed the suspected cause was wrong, say so.
© autohandai · Apache-2.0 · autohandai/code-cli
Similar skills
All skills for Code review and refactoring →performance-analysis by other authors comes first.