# Perf loop

> Perf loop is an open-source agent skill for developer tools. Loops a benchmark-driven fix cycle until every measured path meets its budget. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/ivy00johns/Skill-Madness/tree/main/skills/loops/perf-loop
- **Repository:** https://github.com/ivy00johns/skill-madness
- **GitHub stars:** 12
- **License:** MIT
- **Skill name:** perf-loop
- **Collection:** https://github.com/ivy00johns/Skill-Madness
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

Perf Loop drives an AI coding agent through repeated optimize-and-measure rounds until a performance metric such as latency, page load, bundle size, memory or test-suite time falls under its target on every measured path. Each round benchmarks the whole measured set under fixed conditions, picks the single biggest hotspot or regression, changes one thing, then re-benchmarks everything and re-runs the functional test suite. Changes that speed up one path while slowing another, or that break tests, are rejected.

The skill sets strict proof rules: warm-up runs are discarded, multiple runs are recorded with their variance, and the agent assumes a path is over budget until a repeatable measurement shows otherwise. Progress is kept in a per-path baseline file and a progress log, with a git checkpoint for each measured improvement. The loop stops when all paths pass, when an iteration cap is reached, after three rounds without progress beyond noise, or when a budget cap is hit.

The skill expects a project with a defined budget and a benchmark command, which can come from a profile file or be confirmed with the user. It is built for Claude Code, relies on a companion loop skill for guardrails, and is intended to be invoked manually rather than started automatically.

## When your agent uses it

> Optimize a metric under its budget: benchmark the whole set under fixed conditions, fix the biggest hotspot, re-benchmark, until every measured path is under target with no functional regression. Use for latency, throughput, page-load, bundle-size, memory or test-speed targets. Trigger on "optimize until under Nms", "get page load under budget", "shrink the bundle", "perf loop".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/loops/perf-loop)
- [Asks for: Read, Write, Edit, Bash, Grep, Glob](https://github.com/ivy00johns/Skill-Madness/blob/HEAD/skills/loops/perf-loop/SKILL.md)
- [License: MIT](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/loops/perf-loop)

## Features

- **Whole-set benchmarking:** Measures every target path under fixed conditions before and after each change.
- **Single-hotspot optimization:** Changes one highest-leverage hotspot per round so the effect on the metric stays clear.
- **Noise-aware measurement:** Discards warm-up runs, records multiple runs and tracks variance before trusting a result.
- **Functional regression gate:** Re-runs the test suite after every change and rejects speedups that break behavior.
- **Baseline and progress log:** Stores per-path numbers in a baseline file and logs each hotspot, change and delta.
- **Iteration and stall limits:** Stops on an iteration cap, three rounds without meaningful progress, or a budget cap.

## Good for

- Get a page load under a set millisecond budget
- Shrink a web app's JavaScript bundle below a size limit
- Bring API p95 latency under a target without breaking tests
- Reduce peak memory usage of a service to a set ceiling
- Speed up a slow test suite to a target wall-clock time

## Install

### Claude Code

This skill ships in the `skill-madness` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ivy00johns/Skill-Madness
/plugin install skill-madness@skill-madness
```

Or copy only this skill to `~/.claude/skills/perf-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/perf-loop &&
cp -R "$tmp/skills/loops/perf-loop" ~/.claude/skills/perf-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/perf-loop` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/perf-loop` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/perf-loop &&
cp -R "$tmp/skills/loops/perf-loop" ~/.agents/skills/perf-loop &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/perf-loop` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/perf-loop` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/perf-loop &&
cp -R "$tmp/skills/loops/perf-loop" ~/.cursor/skills/perf-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/perf-loop` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ivy00johns/Skill-Madness.git --path skills/loops/perf-loop
```

Or copy the folder to `~/.gemini/skills/perf-loop` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/perf-loop`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/perf-loop &&
cp -R "$tmp/skills/loops/perf-loop" ~/.copilot/skills/perf-loop &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/perf-loop` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git
```

Then copy `Skill-Madness/skills/loops/perf-loop` into your agent's skills folder as `perf-loop`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Perf loop trigger?

It is meant to be invoked explicitly, for example with /perf-loop, or when phrases such as optimize until under a given number of milliseconds, get page load under budget, shrink the bundle or perf loop are used. Automatic invocation is disabled.

### What does Perf loop need to run?

It requires Claude Code. A performance budget and a benchmark command are needed; these can be read from a project profile file or confirmed with the user before the loop starts.

### How does Perf loop avoid faking results?

It forbids weakening the benchmark, loosening targets without approval or reporting a single lucky run. Speedups must keep the functional test suite passing.

### Does Perf loop include scripts or extra files?

The folder has two files and no scripts. A reference document covers the benchmark checklist, per-stack tooling and the regression rule.

### How do I install Perf loop in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/perf-loop to use it in all your projects, or to .claude/skills/perf-loop in one project. Or install the skill-madness plugin, which includes it: /plugin marketplace add ivy00johns/Skill-Madness, then /plugin install skill-madness@skill-madness.

### Does Perf loop run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Perf loop?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Perf loop?

The closest alternatives to Perf loop are Benchmark optimization loop, Optimize loop, Benchmark checklist, Performance reasoning and Optimize.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Benchmark optimization loop](https://ai-powered.com/skills/benchmark-optimization-loop): Benchmark optimization loop is an open-source agent skill for developer tools.
- [Optimize loop](https://ai-powered.com/skills/optimize-loop): Optimize loop is an open-source agent skill for developer tools.
- [Benchmark checklist](https://ai-powered.com/skills/benchmark-checklist): Benchmark checklist is an open-source agent skill for developer tools.
- [Performance reasoning](https://ai-powered.com/skills/performance-reasoning): Performance reasoning is an open-source agent skill for developer tools.
- [Optimize](https://ai-powered.com/skills/optimize-jasgujral): Optimize is an open-source agent skill for developer tools.
- [Performance optimization](https://ai-powered.com/skills/performance-optimization): Performance optimization is an open-source agent skill for developer tools.
- [Coverage loop](https://ai-powered.com/skills/coverage-loop): Coverage loop is an open-source agent skill for developer tools.
- [Debug](https://ai-powered.com/skills/debug-evist0): Debug is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/perf-loop
