performance-profiling

performance-profiling is a skill for Claude Code, Codex from camilooscargbaptista/cto-toolkit. It costs 166 tokens per session (1,233 once invoked), scanned A, original, MIT.

A guide to finding and fixing slow software by measuring CPU use, memory, database queries, response time, and capacity under load.

In plain words
What is it for?
It supports performance investigations in Node.js, Java, Flutter, and web applications, including profiling, flame-graph analysis, load testing, caching, and targeted optimization.
Why use it?
It replaces guesswork with measurements that show where a real performance problem starts. It helps distinguish issues such as memory leaks, heavy computation, slow data access, and resource contention.

Skill for Claude CodeCodex

Part of the cto-toolkit plugin — 54 skills, 6 agents, 3 hooks 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/camilooscargbaptista/cto-toolkit/performance-profiling
Any agent
npx skills add camilooscargbaptista/cto-toolkit --skill performance-profiling
Clone the repo
git clone --depth 1 https://github.com/camilooscargbaptista/cto-toolkit

Made for: Claude Code, Codex.

Or install cto-toolkit, the plugin that ships this one along with the rest of its 54 skills, 6 agents, 3 hooks.

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/camilooscargbaptista/cto-toolkit/performance-profiling.svg)](https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/performance-profiling)
Your own site
<a href="https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/performance-profiling"><img src="https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/performance-profiling.svg" alt="Measured on agentmods" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,233 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.00166 $0.01233
Opus 5 $0.00083 $0.00616
Sonnet 5 $0.00033 $0.00247
Haiku 4.5 $0.00017 $0.00123

Measured 5d ago against content hash 5220c736c880, 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 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.

performance-profiling/SKILL.md · 102 lines

How it starts

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

Performance Profiling & Optimization

You are a senior performance engineer helping diagnose and fix performance issues. The golden rule: measure first, optimize second. Never optimize based on intuition — profiling data tells you where the actual bottleneck is, and it's almost never where you think.

Performance Investigation Workflow

1. DEFINE    → What metric is bad? (latency, throughput, memory, CPU)
2. MEASURE   → Establish baseline with numbers
3. PROFILE   → Find the bottleneck with tools
4. HYPOTHESIZE → Form theory about root cause
5. FIX       → Make targeted change
6. VERIFY    → Measure again, confirm improvement

Identifying the Bottleneck Type

Symptom Likely Bottleneck Where to Look
High CPU, fast responses CPU-bound computation Flame graphs, hot functions
Low CPU, slow responses I/O-bound (DB, network, disk) Trace spans, await times
Growing memory, eventual OOM Memory leak Heap snapshots, allocation tracking
Slow under load, fast alone Contention (locks, pool, connections) Connection pools, thread contention
Spiky latency (p99 >> p50) GC pauses or resource contention GC logs, lock contention
Degrading over time Resource leak or unbounded growth Memory trend, connection count trend

Node.js Profiling

Start with npx clinic doctor -- node app.js for quick diagnostic. Deep dive: see references/nodejs-profiling.md for CPU profiling tools (V8 --prof, Chrome DevTools --inspect, Clinic.js), event loop monitoring with thresholds and blockers, heap snapshot workflows, common memory leak patterns, and async bottleneck detection with tracing.

Java / JVM Profiling

Use JFR (Java Flight Recorder) for production diagnostics. See references/jvm-profiling.md for thread analysis, GC logging metrics (pause time, frequency, promotion rate), heap dump analysis with Eclipse MAT, and GC algorithm selection (G1GC, ZGC, Shenandoah).

Web Frontend Performance

Read the full file on GitHub · 102 lines

Files

What ships with it

3 files 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 · 102 lines · 166 tokens per session scan A 5220c736c880

Subscribe to this mod's changes

performance-profiling is a skill published in the GitHub repository camilooscargbaptista/cto-toolkit (7 stars, last pushed 5mo ago), licensed MIT. It adds 166 tokens to every session and 1,233 once invoked, about $0.0008 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-31.