Skip to main content
skill CX Codex

perf · pwguler — Claude Code skill: what it does, how to install

A Claude Code and Cursor skill that measures code performance and diagnoses slow processes using empirical data rather than guesses.

MIT 899 installs ★ 10 updated 2026-10-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pwguler/skills --skill perf -a claude-code
Open on GitHub

What perf does

The skill enforces a strict measurement-driven workflow for performance tuning, establishing a baseline before any code changes are made. The agent builds repeatable tests, isolates limiting resources with profilers, and applies single modifications while alternating test runs. No code modification for speed is permitted without prior metrics.

Invoke this skill when users report high latency, memory usage, or sluggish execution, or when comparing two implementations. The procedure relies on task lists, target metrics, and profiler traces. Payloads exceeding roughly 2,000 lines are delegated to a subagent to preserve context limits.

Rules prohibit treating crashes or deadlocks as slowness and tuning code without profiler proof. The agent halts after three non-improving changes and reports back. Failed measurements are recorded as failures rather than hidden.

What it helps with

  • measure function performance before and after changes
  • identify bottlenecks in slow code using profiler data
  • compare execution speed of two alternative implementations
  • diagnose a slow or stuck process using trace files

Example prompts for the agent

  • Measure the performance of this function
  • Find the latency bottleneck in this module
  • Compare the speed of these two approaches

How to install perf

1Skills CLI (Vercel)

npx skills add pwguler/skills --skill perf -a claude-code

2Manually: put the files in place

~/.claude/skills/perf/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/perf/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about perf

How to install perf in Claude Code?

Run npx skills add pwguler/skills --skill perf -a claude-code followed by ~/.claude/skills/perf/SKILL.md.

What does perf do?

It guides the AI agent through a rigorous measurement protocol to optimize code speed based on empirical data rather than guesswork.

What is required to run perf?

Standard profiling tools, trace utilities, or counters are needed to detect the limiting resource.

Source text

SKILL.md · MIT
---
name: perf
description: Make code faster or find why it is slow, from measurements and not from guesses. Read this skill before you change code to make it faster or use less memory. Use it when the user reports slow code, high latency, or high memory use. Use it also to check a speed claim, or to compare the speed of two options. Use it to diagnose a slow or stuck process, a profile, or a trace file.
---

Measure before you change code for speed. A claim about speed without a measurement is only a guess. A change that rests on a guess can make the code slower.

Fast path: when the user only asks whether a measured number holds, change no code. Read the `verify` skill, and check the number with [measurement.md](references/measurement.md). When the user asks only why code is slow, or gives a profile or trace file, also change no code. Go to step 4, and report as its reference says.

1. Before you measure anything, create a task list with these steps as its items. If a task list already exists, add the steps to it. When you skip a step, mark it done and add `skip: <reason>` to its text. To go back to an earlier step, add that step and each step after it again as new items.
2. State the target in one sentence: the operation, the input, and the number that counts as success. Take the target from the user or the spec. When nobody gave one, the target is a gain larger than the spread on a realistic input. Say so.
3. Build a measurement that you can run again: a script or a command, and a realistic input. Run each side five times or more. Check the measurement with [measurement.md](references/measurement.md) before you trust it. Step 4 answers its first check. Record the baseline: the number, its unit, the run count, and the spread.
4. Find the limiter, the one resource that stops the number from getting better, by observation. Do not guess it from the source. Use a profiler, a trace, or counters. A profiler slows the work, so never report a number from a profiled run. For a running process, follow [live-process.md](references/live-process.md). For a profile, trace, dump, or log file that already exists, follow [capture-file.md](references/capture-file.md).
5. Change one thing at the limiter, and try the cheapest kind of change first. First remove work whose result nothing uses. Then do the work once, and keep the result. Then do less work. Then do the work later. Then do it at a time when nobody waits. Then run it in parallel. Make the work itself cheaper only as the last option. A change that keeps results, delays work, or runs work in parallel can change behavior. Give it a failing test first, as implement says.
6. Measure again with the same setup, and run the old and new versions in alternating order. Run the tests that exercise the changed path. Keep the change only when they pass and the gain is larger than the spread. Otherwise revert it. When a kept change meets the target, go to step 7. Otherwise go back to step 4.
7. Before you report the gain, read the `verify` skill, and follow it for the tests, the build, and the linter. The measurement script is a demo of the gain, as verify defines a demo. Report the gain as a measured number, not as a verified criterion.
8. Report the result: the number before and after, each with its unit, run count, spread, and limiter. Name the change and the input that you measured.

Rules:

- Change no code for speed before the baseline exists.
- Make one change between two measurements, so that each gain has one cause.
- A request for a diagnosis gets a diagnosis, not a fix. Cite the evidence for each finding.
- A deadlock, a crash, or a wrong result is a defect, not slowness. Its fix goes to `debug`.
- Do not tune code that the measurement does not show as the limiter.
- Stop after three changes in a row that give no gain larger than the spread. Report the measurements and the limiter, and let the user decide.
- When the work continues after the session, keep the measurement script in the diff, as implement's build-the-lever principle says.
- Never invent a number. Report a measurement that failed as failed.
- A raw payload that you must read, and that is longer than about 2,000 lines, goes to a subagent. Keep only the reduced finding in the session, as research's guard-the-context-window principle says.

© pwguler · MIT · pwguler/skills

Similar skills

All skills for Agent setup: memory, context, orchestration →

perf by other authors comes first.

perf alexj11324 perf is a Claude Code skill that guides performance troubleshooting across database bottlenecks, CPU spikes, memory leaks, and high latency. Runs during profiling or benchmark analysis. CX Codex +1 ★ 88repo stars w-perf blockmatic-icebox The w-perf Claude Code skill measures project performance and locates bottlenecks. It runs on requests to investigate slow code or improve performance. CX Codex +1 647installs perf-analyzer Community perf-analyzer — a Claude Code subagent that turns profiling results and benchmark experiments into evidence-backed recommendations structured by a strict template. CX Codex ★ 2,003repo stars perf-profile Donchitos perf-profile — a skill to identify performance bottlenecks, measure metrics against budgets, and generate ranked optimization recommendations. Runs on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. CX Codex +1 692installs performance-analysis autohandai performance-analysis guides coding agents to measure latency or memory usage before editing code. Pinpoints performance bottlenecks with reproducible numbers. CX Codex +1 ★ 219repo stars perf-orchestrator Community perf-orchestrator coordinates performance investigations from baseline measurements through profiling and validation. Keeps each phase sequential and logged. CX Codex ★ 2,003repo stars performance-benchmarker Michael Galpert performance-benchmarker — a subagent that profiles application speed, locates bottlenecks and suggests concrete optimization steps. ★ 1,013repo stars

From the same set15

The whole set →
land land is a Claude Code skill that finishes a development branch through merge, PR, keep, or discard. It runs after implementation is complete. CX Codex +1 1,000installs drill A skill for Claude Code interviews the user about a plan or design until its decisions are settled. It runs for new features, unresolved designs, or a request to “drill this.” CX Codex +1 1,000installs implement implement — a skill for Claude Code and Codex that executes settled plans in thin test-driven slices. Runs when prompted to build code from a spec or slice plan. CX Codex +1 1,000installs rubric rubric — a skill for Claude Code finds defects in changes and judges design, interface, or writing quality. It sets evaluation criteria before asking an independent subagent to inspect the work. CX Codex +1 980installs prototype This Claude Code skill builds visual UI prototypes before implementation begins. It activates for mockup requests and helps settle a look or flow that text cannot resolve. CX Codex +1 978installs tldr tldr — a skill for Claude Code and Codex that reports completed tasks as concise outcomes instead of tool transcripts. Triggers after builds, verification runs, file changes, or catch-up queries. CX Codex +1 977installs recall recall — a Claude Code skill that rebuilds recent project context from agent sessions, the live repository, and project history. Run it before starting or resuming work, with a topic or without one. CX Codex +1 922installs reflect reflect — a skill that extracts lessons from a coding agent session and places them into project checks, skills, or instruction files. Runs at the end of a session with corrections, errors, or surprises. CX Codex +1 904installs

Project sponsors

Companies that keep this analytics open