performance-optimizer

performance-optimizer is a skill for Claude Code, Codex from chandrudp29/skillhub. It costs 26 tokens per session (1,214 once invoked), scanned A, original, MIT.

A performance-improvement guide for Python programs and web backends. It requires measuring with profiling or benchmarks before changing code, then measuring again after each fix.

In plain words
What is it for?
Use it to investigate slow requests, high costs, or load failures, identify the main hot path, apply a targeted fix, and verify the result.
Why use it?
It avoids guesswork by focusing work on the measured bottleneck and checking that an optimization actually improves speed without causing regressions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it to investigate slow requests, high costs, or load failures, identify the main hot path, apply a targeted fix, and verify the result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chandrudp29/skillhub/performance-optimizer
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 chandrudp29/skillhub --skill performance-optimizer
Clone the repo
git clone --depth 1 https://github.com/chandrudp29/skillhub

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-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/chandrudp29/skillhub/performance-optimizer/github.svg)](https://agentmods.dev/skills/chandrudp29/skillhub/performance-optimizer)
Your own site
<a href="https://agentmods.dev/skills/chandrudp29/skillhub/performance-optimizer"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/performance-optimizer/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 performance-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/chandrudp29/skillhub/performance-optimizer"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/performance-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,214 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00026 $0.01214
Opus 5.5 $0.00010 $0.00486
Sonnet 5.5 $0.00005 $0.00243
Haiku 4.5 $0.00003 $0.00121

Measured 1mo ago against content hash c09d8220f25e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

performance-optimizer 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 1mo 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/performance-optimizer/SKILL.md · 149 lines

How it starts

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

When to Use

Apply when a system is slow, costs too much, or fails under load. Always measure before optimizing — guessing wastes time.

Core Rules

  • Measure first, always. Never optimize without a profiler or benchmark showing the bottleneck
  • Fix the biggest bottleneck first — fixing #2 before #1 gives partial gains at best
  • Define a target before optimizing: "p99 < 200ms" not "faster"
  • After every optimization, re-measure — sometimes fixes have side effects

The Loop

1. Measure    → profiler, APM, benchmark (establish baseline)
2. Identify   → find the hot path (usually 1-3 functions cause 80%+ of time)
3. Hypothesize → why is this slow? (N+1 query, GIL contention, memory copy, etc.)
4. Fix        → smallest change that addresses root cause
5. Verify     → re-run benchmark — is it faster? Regressions elsewhere?
6. Repeat     → next bottleneck

Python Profiling

# cProfile — CPU profiling
import cProfile, pstats, io
pr = cProfile.Profile()
pr.enable()
# ... code to profile ...
pr.disable()
s = io.StringIO()
ps = pstats.Stats(pr, stream=s).sort_stats('cumulative')
ps.print_stats(20)
print(s.getvalue())

# line_profiler — line-by-line (use @profile decorator)
# pip install line_profiler
# kernprof -l -v script.py

# memory_profiler — memory usage line-by-line
# pip install memory_profiler
# @profile decorator, then: python -m memory_profiler script.py

# py-spy — sampling profiler, zero-code-change, attach to running process
# pip install py-spy
# py-spy top --pid 12345
# py-spy record -o profile.svg --pid 12345

Common Python Bottlenecks

# ❌ String concatenation in loop — O(n²) allocations
result = ""
for item in items:
    result += str(item)  # new string object each time

# ✓ join — one allocation
result = "".join(str(item) for item in items)

# ❌ Repeated dict/set lookup in hot loop
for item in items:
    if item in some_list:  # O(n) each time if it's a list
        ...

# ✓ Convert to set once
lookup = set(some_list)  # O(1) lookup
for item in items:
    if item in lookup:
        ...

# ❌ Unnecessary object creation in loop
for i in range(1_000_000):
    temp = MyClass(i)  # constructor overhead × 1M

# ✓ Reuse or use slots
class MyClass:
    __slots__ = ['value']  # ~40% less memory, faster attribute access

# ❌ GIL-bound CPU work in threads
from threading import Thread  # threads share GIL — no real parallelism for CPU

# ✓ Use ProcessPoolExecutor for CPU-bound work
from concurrent.futures import ProcessPoolExecutor
with ProcessPoolExecutor() as pool:
    results = list(pool.map(cpu_intensive_fn, items))

Read the full file on GitHub · 149 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. 1mo ago First seen · 149 lines · 26 tokens per session scan A c09d8220f25e

Subscribe to this mod's changes

performance-optimizer is a skill published in the GitHub repository chandrudp29/skillhub (14 stars, last pushed 3mo ago), licensed MIT. It adds 26 tokens to every session and 1,214 once invoked, about $0.0001 per session on Opus 5.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

performance-optimizer

Profile, diagnose, and fix performance bottlenecks in applications. Use when optimizing slow queries, reducing load times, improving runtime performance, or reducing memory usage.

asgarovf/locusai · 36 tokens

performance-analysis

Performance analysis, bottleneck detection, and optimization recommendations. Use when profiling slow code or systems, hunting a performance regression, or producing an optimization plan with measurable targets.

frankxai/claude-skills-library · 36 tokens

performance-engineer

!cat skills/shared/protocols/ux-protocol.md 2>/dev/null || true !cat .production-grade.yaml 2>/dev/null || echo "No config — using defaults".

buiphucminhtam/forgewright · 50 tokens

profiling

A set of Linux instructions for finding which parts of a running program or system use CPU time, memory, or other resources.

chaterm/terminal-skills · 5 tokens

performance-profiling

Performance Profiling & Optimization: Helps diagnose and fix performance issues including memory leaks, CPU bottlenecks, slow queries, high latency, and throughput problems. Covers profiling tools, flame graphs, load testing, caching strategies, and optimization techniques for Node.js, Java, Flutter, and web…

camilooscargbaptista/cto-toolkit · 166 tokens

performance-expert

Expert-level performance optimization, profiling, benchmarking, and tuning. Use when the user mentions optimization, profiling, benchmarking, or scalability, or when the task involves Performance Fundamentals, Optimization Areas, Profiling Tools, or General.

personamanagmentlayer/pcl · 48 tokens