Skip to main content
skill CX Codex

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.

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

What 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-code

2Manually: put the files in place

~/.claude/skills/performance-analysis/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/performance-analysis/

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.

From the same set14

workflow-discovery This skill scores proposed workflows against observed repositories, skills and recurring requests, then returns a ranked JSON object. CX Codex +1 ★ 211repo stars systematic-debugging Stops AI agents from guessing fixes when tests fail. Forces root-cause discovery, hypothesis verification, and regression tests before any code patch. CX Codex +1 ★ 211repo stars root-cause-analysis Investigate outages, regressions, and recurring failures with a skill that traces evidence to underlying design flaws. Use it to draft a postmortem with a timeline and prevention tasks. CX Codex +1 ★ 211repo stars pull-request-review A skill that reviews a pull request or branch diff: checks the change against the issue, hunts correctness and security defects, and returns prioritized comments. CX Codex +1 ★ 211repo stars goal-writer Turns a rough request into a verifiable objective for /goal mode. Use it when an agent needs to work with less supervision and a clear condition for stopping. CX Codex +1 ★ 211repo stars git-analysis Answers questions about git history: what changed, who wrote a line, where a regression crept in. Useful for review, bisect-style narrowing and changelogs. CX Codex +1 ★ 211repo stars extension-builder Builds, ports, and tests Autohand Code extensions from natural language prompts or Pi packages. Essential for writing custom tools, agents, and CLI hooks. CX Codex +1 ★ 211repo stars deep-research This skill investigates a topic across multiple sources and saves a cited report. Use it when claims need checking, comparison, and a documented trail. CX Codex +1 ★ 211repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor