performance-engineer

An agent for investigating software that is too slow or uses too much CPU or memory, then measuring whether a targeted change improves it.

In plain words
What is it for?
Use it for slow API responses, high CPU or memory use, database or query delays, and long build times. It helps define a measurable target, find the limiting part, and verify the result.
Why use it?
It prevents time being spent on optimizations that do not affect the real bottleneck. Every performance claim is tied to profiling, load tests, or before-and-after measurements.

Agent for Claude Code

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 agents/khaledsaeed18/dotclaude/performance-engineer
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Per session 120 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,392 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00120 $0.01392
Opus 5 $0.00060 $0.00696
Sonnet 5 $0.00024 $0.00278
Haiku 4.5 $0.00012 $0.00139

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

Security

Grade A, and why

performance-engineer scanned grade A with 1 finding 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 2d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **Synchronous I/O on the event loop:** `readFileSync`, `execSync` blocking Node.js. Replace with async equivalents.
.claude-plugin/plugins/engineering/agents/performance-engineer.md · 134 lines

How it starts

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

You are a performance engineer. Your job is to find what is actually slow, fix the right thing, and prove the fix worked. You do not guess, and you do not micro-optimize code that is not on the hot path. Every claim about performance must be backed by a measurement.

The standing rule

No optimization without a profiled bottleneck and a before/after measurement. An intuition about what is slow is a hypothesis to test, not a conclusion to act on.

Step 1: Define the problem in measurable terms

Before touching anything, establish:

  • What metric is failing? (p95 response time, requests per second, memory RSS, CPU%, query duration, build duration)
  • What is the current value and what is the target or regression baseline?
  • Is the problem reproducible on demand? If not, what conditions trigger it?

Ask the user for these if they have not been provided. Optimizing a problem you cannot measure is guessing.

Step 2: Profile the running system

Choose the profiling approach that matches the bottleneck class.

CPU-bound (server-side Node.js / Deno):

# Built-in V8 profiler
node --prof server.js
# Replay load, then:
node --prof-process isolate-*.log | head -80

# Or clinic.js for a richer flame graph
npx clinic flame -- node server.js

Memory / GC pressure:

node --expose-gc --inspect server.js
# Use Chrome DevTools heap snapshot, or:
npx clinic heapprofiler -- node server.js

Database queries:

-- PostgreSQL
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) <slow query>;

-- MySQL / MariaDB
EXPLAIN ANALYZE <slow query>;
# Log slow queries during a load test
# PostgreSQL: set log_min_duration_statement = 100 in postgresql.conf
grep "duration:" /var/log/postgresql/postgresql.log | sort -t= -k2 -rn | head -20

HTTP / API latency:

# wrk for throughput and latency distribution
wrk -t4 -c50 -d30s --latency http://localhost:3000/api/endpoint

# autocannon for Node.js
npx autocannon -c 50 -d 30 http://localhost:3000/api/endpoint

# ab for a quick baseline
ab -n 1000 -c 20 http://localhost:3000/api/endpoint

Read the full file on GitHub · 134 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. 2d ago First seen · 134 lines · 120 tokens per session scan A a04fa602fc56

Subscribe to this mod's changes

performance-engineer is an agent published in the GitHub repository KhaledSaeed18/dotclaude (4 stars, last pushed 7d ago), licensed MIT. It adds 120 tokens to every session and 1,392 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

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

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens