perf

perf is a skill for Claude Code, Codex from Kevin-Liu-01/Agent-Machines. It costs 59 tokens per session (1,634 once invoked), scanned D, original, MIT.

A disciplined method for finding why code is slow by measuring a baseline, tracing the work, and testing possible bottlenecks step by step.

In plain words
What is it for?
Use it to investigate slow operations, compare concurrency levels, inspect system calls, and decide which optimisation is justified by measurements.
Why use it?
It prevents developers from optimising the wrong part of a system without evidence.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to investigate slow operations, compare concurrency levels, inspect system calls, and decide which optimisation is justified by measurements.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevin-liu-01/agent-machines/perf
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.

Any agent
npx skills add Kevin-Liu-01/Agent-Machines --skill perf
Clone the repo
git clone --depth 1 https://github.com/Kevin-Liu-01/Agent-Machines

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/perf/github.svg)](https://agentmods.dev/skills/kevin-liu-01/agent-machines/perf)
Your own site
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/perf"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/perf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for perf

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/perf"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/perf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00059 $0.01634
Opus 5 $0.00030 $0.00817
Sonnet 5 $0.00012 $0.00327
Haiku 4.5 $0.00006 $0.00163

Measured 9d ago against content hash 4ff25dc343d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade D, and why

perf scanned grade D with 2 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 9d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo strace -f -c -p $PID -o /tmp/strace.out &

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$DIR/par$par" && mkdir "$DIR/par$par"
knowledge/skills/perf/SKILL.md · 166 lines

How it starts

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

/perf

Ramp up. Every investigation starts with the cheapest experiment that can falsify your current theory and moves to more invasive ones only when the cheap ones are exhausted or inconclusive. The bottleneck is almost never where you first guess. Numbers gate every decision.

Ladder (cheapest → most invasive)

  1. Baseline. Measure the current wall time. Three runs, report the median. Without a baseline, every later number is meaningless.

  2. Read the code path. Trace one op end-to-end. List every syscall, lock, DB statement, RPC. Do not theorise; read.

  3. Study the fast ops in the same codebase. If op X is fast and op Y is slow, what technique does X use? Same database, same runtime, same I/O path — the gap between them is a technique you can borrow.

  4. Concurrency sweep. Run at par=1, 4, 16, 64. The delta between par=1 and par=4 is per-op serial overhead. The plateau past par=N is the parallel floor. Together they decompose the wall time into two buckets and tell you which one to attack.

  5. Strace the process. strace -f -c -p $PID for ~10 s during the workload. Gives a syscall histogram. Confirms whether the op is syscall-bound and which call dominates.

  6. Isolated probe. Before touching production, write a minimal standalone program that reproduces the hypothesis using the same libraries and config. Under 150 LOC, under a minute to build and run. If the probe confirms the theory, the production refactor is worth writing. If it doesn't, your theory is wrong.

  7. perf / bpftrace. Only if the lighter tools don't give signal. perf record -g for CPU attribution; bpftrace histograms for syscall latency tails.

Rules

  • Falsifiable experiments only. "I'll run the fix and see" is not a test. "The fix is wrong if wall time does not drop below 100 ms" is a test. State the failure criteria before running.

  • One change per rebench. Every change → rebuild → rebench. Never stack two hypotheses between measurements.

Read the full file on GitHub · 166 lines

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. 9d ago First seen · 166 lines · 59 tokens per session scan D 4ff25dc343d2

Subscribe to this mod's changes

perf is a skill published in the GitHub repository Kevin-Liu-01/Agent-Machines (29 stars, last pushed today), licensed MIT. It adds 59 tokens to every session and 1,634 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it D with 2 findings (asks for root, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

opik-explain

Root-cause a specific Opik trace, or a pattern across traces, and return a grounded explanation. Uses the hosted Opik MCP when it is connected, and falls back to SDK scripting otherwise. Returns the root cause, the evidence spans as clickable Opik UI links, and one suggested next step. Use for "why did this trace…

comet-ml/opik-mcp · 113 tokens

hermes-plugin-development

Use when: creating, debugging, or integrating Hermes Agent plugins, including Python backend plugins (tools, hooks, routers, middleware) and JavaScript Hermes Desktop runtime plugins.

AtlasOmnia/donna-starter · 31 tokens

problem-management

Manage ServiceNow problems — create from linked incidents, proactive pattern detection, RCA with 5-Whys, knownerror workarounds (KEDB), KEDB search by CI/category/keywords, and permanent-fix linkage to changes.

serac-labs/serac · 53 tokens

node-inspect-debugger

Debug Node.js with node inspect, inspector attach, breakpoints, Chrome DevTools Protocol, heap snapshots, and CPU profiles.

EKKOLearnAI/hermes-studio · 31 tokens

holix-cron

Schedule recurring agent tasks via Holix built-in gateway cron (not crontab or custom scripts).

javded-itres/Holix · 25 tokens

blazemeter-troubleshooting

Comprehensive troubleshooting guide for BlazeMeter, covering API Monitoring, Performance Testing, general issues, integrations, and security. Use when troubleshooting for (1) API Monitoring issues (Radar Agent auth, SSL certificates, debug tests), (2) Performance Testing issues (high response time, 500 errors, partial…

Blazemeter/bzm-mcp · 131 tokens