performance-profiling

performance-profiling is a skill for Claude Code, Codex from orlando-japan/claude-code-setting. It costs 32 tokens per session (867 once invoked), scanned A, original, MIT.

A guide for finding the parts of a program that make it slow by measuring real performance data. It covers request timing, browser tools, code profilers, database query plans, and measures such as median and worst-case response times.

In plain words
What is it for?
Use it to define what “slow” means, record a baseline, locate the largest performance cost, and compare results after an optimization.
Why use it?
It prevents unnecessary optimization based on hunches and helps show whether a change actually improved the stated performance target.

Skill for Claude CodeCodex

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/orlando-japan/claude-code-setting/performance-profiling
Any agent
npx skills add orlando-japan/claude-code-setting --skill performance-profiling
Clone the repo
git clone --depth 1 https://github.com/orlando-japan/claude-code-setting

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 performance-profiling

README.md
[![agentmods](https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/performance-profiling.svg)](https://agentmods.dev/skills/orlando-japan/claude-code-setting/performance-profiling)
Your own site
<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/performance-profiling"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/performance-profiling.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 867 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.00032 $0.00867
Opus 5 $0.00016 $0.00434
Sonnet 5 $0.00006 $0.00173
Haiku 4.5 $0.00003 $0.00087

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

Security

Grade A, and why

performance-profiling 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Request latency:** `curl -w '%{time_total}\n' -o /dev/null -s URL`
templates/extra/skills/performance-profiling/SKILL.md · 96 lines

How it starts

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

Performance profiling

Optimization without measurement is just adding complexity. Measure first, always.

Step 0 — Define "slow"

What does the user experience? What's the actual number, and what's the target?

  • "Page takes 4 seconds to load" → specific.
  • "Feels slow" → useless. Get numbers.

Without a target, you won't know when to stop optimizing.

Step 1 — Measure the baseline

Use the simplest tool that gives real numbers:

  • Request latency: curl -w '%{time_total}\n' -o /dev/null -s URL
  • Frontend: browser DevTools Network + Performance panels
  • Backend: language-native profiler (cProfile, pprof, async_hooks, perf)
  • DB: EXPLAIN ANALYZE, slow query log

Measure:

  • Steady state, not first request (JIT, cache warm-up).
  • Multiple samples (p50, p95, p99). Average alone hides tail latency.
  • Realistic inputs, not empty fixtures.

Write the number down. You'll need it for the "did it help" check.

Step 2 — Find the biggest contributor

Profilers lie by default when used wrong. Sanity-check:

  • Flame graphs for CPU — look for the widest bar at the bottom.
  • Trace spans for distributed systems — the long spans are the real cost.
  • Allocation profile for memory / GC pressure.
  • Query log for DBs — most wall time is usually one or two queries.

80/20 rule. The slowest 20% of your code consumes 80% of the time. Find that 20% and ignore the rest.

Step 3 — Form a hypothesis

State out loud: "I think X is slow because Y." If you can't articulate why, you're guessing.

Common hypotheses:

  • N+1 queries. Loop that hits the DB per iteration.
  • Missing index. Full table scan.
  • Sync I/O in async code. Blocking the event loop.
  • Over-serialization. Converting a 10MB blob that gets thrown away.
  • Bad cache policy. Cache thrash, miss on hot keys, TTL too short.
  • Chatty protocols. Ten round trips where one would do.

Step 4 — Change one thing, measure again

  • Change one thing. Multiple changes simultaneously = can't attribute.
  • Re-measure with the exact same method. Different method, different numbers.
  • Compute the delta. p99 before vs p99 after. Not "it feels faster."
  • If no improvement, revert. Don't leave speculative optimizations in the code.

Read the full file on GitHub · 96 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. 3d ago First seen · 96 lines · 32 tokens per session scan A 6c4ea937e58c

Subscribe to this mod's changes

performance-profiling is a skill published in the GitHub repository orlando-japan/claude-code-setting (2 stars, last pushed 3mo ago), licensed MIT. It adds 32 tokens to every session and 867 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.