perf-loop

perf-loop is a skill for Claude Code, Codex from ivy00johns/Skill-Madness. It costs 197 tokens per session (2,695 once invoked), scanned A, original, MIT.

An automated performance-tuning workflow that repeatedly measures software under fixed conditions, changes one likely bottleneck, and measures the complete benchmark set again.

In plain words
What is it for?
Use it to reduce slow code paths, fix performance regressions, or bring a bundle or other metric under a defined budget.
Why use it?
It avoids optimizing based on a noisy or partial measurement. Each change is checked against the whole measured set until the chosen performance target is met.

Skill for Claude CodeCodex

Part of the skill-madness plugin — 56 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ivy00johns/skill-madness/perf-loop
Any agent
npx skills add ivy00johns/Skill-Madness --skill perf-loop
Clone the repo
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness

Made for: Claude Code, Codex.

Or install skill-madness, the plugin that ships this one along with the rest of its 56 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for perf-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ivy00johns/skill-madness/perf-loop.svg)](https://agentmods.dev/skills/ivy00johns/skill-madness/perf-loop)
Your own site
<a href="https://agentmods.dev/skills/ivy00johns/skill-madness/perf-loop"><img src="https://agentmods.dev/badge/skills/ivy00johns/skill-madness/perf-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 197 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,695 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00197 $0.02695
Opus 5 $0.00098 $0.01347
Sonnet 5 $0.00039 $0.00539
Haiku 4.5 $0.00020 $0.00269

Measured 5d ago against content hash 3d77f0884d39, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

perf-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/loops/perf-loop/SKILL.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

perf-loop

A configuration of [loop-controller]. That skill supplies the loop machinery — primitive selection, the full guardrail stack, state externalization. This skill supplies the two things specific to "make it hit the budget": a measured proof under repeatable conditions (a named benchmark artifact, default-FAIL) and the measurement discipline that keeps a noisy benchmark from lying to the loop. Read loop-controller for the guardrails; they're inherited, not repeated here.

Why disable-model-invocation: this loop edits and commits code on its own and spends real time re-running benchmarks until a metric is under target. You want to type /perf-loop (or have the orchestrator dispatch it) — not have Claude start an autonomous optimize loop because a number looked slow.

The 5-part contract

Part This loop
trigger a metric is over its budget (a slow path, a perf regression, a too-big bundle), or an explicit /perf-loop (optionally scoped to one path/benchmark)
action ONE iteration: benchmark the whole measured set under fixed conditions → identify the single highest-leverage hotspot/regression → optimize one thingre-benchmark the WHOLE set → re-run the functional suite
proof the metric is under target on EVERY measured path in the benchmark output AND the functional suite still exits 0 — default-FAIL: assume over-budget until the benchmark, run under repeatable conditions, proves otherwise
memory perf_baseline.json (the per-path measured numbers + variance, the durable baseline), PROGRESS.md (hotspot → change → delta log), a git checkpoint per measured improvement
stop metric under target on every path AND suite green OR iteration cap OR no-progress for 3 rounds OR budget cap

The proof: a measured number under repeatable conditions, default-FAIL

"Fast enough" is not "the profiler looked better" or "the one path I touched sped up." It is every measured path under its target in the benchmark output, re-measured across the whole set, with the functional suite still green — and the benchmark must be reproducible, or the number is noise, not proof. Assume over-budget until you have that artifact. A loop that declares victory off a single fast run on a warm cache ships a regression the next cold start exposes.

Read the full file on GitHub · 196 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 196 lines · 197 tokens per session scan A 3d77f0884d39

Subscribe to this mod's changes

perf-loop is a skill published in the GitHub repository ivy00johns/Skill-Madness (11 stars, last pushed 25d ago), licensed MIT. It adds 197 tokens to every session and 2,695 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens