Skills

Performance profiling skill: measure, find the hotspot, prove the fix

A Claude Code skill that profiles a slow function, endpoint, script or test with the right profiler for your stack (Node, Python, Go, JVM, browser), identifies the hotspot from real data, and reports before and after numbers from the same benchmark.

Skill in Engineering by AISkillHub Library

What it does

Performance work goes wrong when changes are made on intuition. This skill makes Claude Code follow a measure-change-measure loop and refuse to optimize without data.

**Workflow** 1. **Define the target**: what is slow, how it is triggered, and the current number (latency, throughput, memory, run time). It writes a small repeatable benchmark or reuses an existing one. 2. **Profile** with a tool that fits the stack, for example `node --cpu-prof`, `python -m cProfile`, `py-spy`, Go's `pprof` via `go test -cpuprofile`, or Java Flight Recorder. For browser work it explains how to record a DevTools Performance trace, since it cannot capture one itself. 3. **Read the profile**: lists the top functions by self and cumulative time and connects them to code. 4. **Hypothesize and change one thing**: N+1 queries, repeated parsing, unnecessary allocation, missing index, synchronous I/O, quadratic loops, oversized payloads. 5. **Re-measure** with the same benchmark and inputs, several runs, and report the median.

**Output** A short report: benchmark command, before and after numbers, the profile evidence, the change and why it helped. If the change did not help, it reverts it and says so.

**What it will not do** It does not make micro-optimizations without profile evidence, trade readability for gains within noise, or claim improvements from a single run. It will not run load tests against shared or production environments.

How to use it

1. Save the file below as `.claude/skills/perf-profile/SKILL.md`. 2. Run `/perf-profile <what is slow>`, for example `/perf-profile GET /api/reports takes 3s with 10k rows` or `/perf-profile scripts/import.py on fixtures/big.csv`. 3. Make sure the profiler for your stack is installed (for `py-spy`: `pip install py-spy`; Node, Go and Python's `cProfile` need nothing extra). 4. Profiles and benchmark output go in `.perf/`. Add it to `.gitignore`.

Files

Save each file at the path shown, relative to your project root.

  • .claude/skills/perf-profile/SKILL.md3.3 KB

More skills

See all

Get AISkillHub updates in your inbox.

New features as they ship, AI live chat improvements, and the best new listings in the catalog.

Product updates, new features, and guides. Unsubscribe any time.

Performance profiling skill: measure, find the hotspot, prove the fix - AI skill - AISkillHub.dev