performance-optimization

performance-optimization is a skill for Claude Code, Codex from vignesh2027/AI-AGENT-SKILLS. It costs 14 tokens per session (649 once invoked), scanned A, original, MIT.

A measurement-led method for making software faster by finding and fixing the operation that actually causes the slowdown.

In plain words
What is it for?
Use it when performance misses a target, a feature is slow, or a latency-sensitive change is being reviewed. It covers measuring response times and throughput, profiling CPU, memory, disk or network work, and checking the result.
Why use it?
It prevents developers from optimizing based on guesses or improving code that is not the bottleneck. Measuring before and after also shows whether the change helped.

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/vignesh2027/ai-agent-skills/performance-optimization
Any agent
npx skills add vignesh2027/AI-AGENT-SKILLS --skill performance-optimization
Clone the repo
git clone --depth 1 https://github.com/vignesh2027/AI-AGENT-SKILLS

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/vignesh2027/ai-agent-skills/performance-optimization.svg)](https://agentmods.dev/skills/vignesh2027/ai-agent-skills/performance-optimization)
Your own site
<a href="https://agentmods.dev/skills/vignesh2027/ai-agent-skills/performance-optimization"><img src="https://agentmods.dev/badge/skills/vignesh2027/ai-agent-skills/performance-optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 649 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.1 $0.00014 $0.00649
Opus 5 $0.00007 $0.00324
Sonnet 5 $0.00003 $0.00130
Haiku 4.5 $0.00001 $0.00065

Measured 5d ago against content hash 090ae5d1cf89, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

performance-optimization 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.

skills/performance-optimization/SKILL.md · 71 lines

How it starts

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

Overview

Performance optimization without profiling is guessing. This skill enforces: measure first, optimize the bottleneck, measure again. It prevents wasted effort on non-bottlenecks and ensures optimizations don't regress correctness.

When to Use

  • When performance doesn't meet SLO
  • Before any "performance improvement" PR
  • When a feature is slow and the cause is unknown
  • As part of the /review workflow for latency-sensitive paths

Process

Step 1: Measure the baseline

Before touching any code, record: current p50/p95/p99 latency, throughput, error rate under representative load. Without a baseline, you can't prove improvement.

Step 2: Profile to find the bottleneck

Run a profiler, not your intuition:

  • CPU-bound: CPU profiler (flamegraph)
  • Memory-bound: heap profiler, allocation profiler
  • I/O-bound: database query analyzer, network profiler
  • Web frontend: Chrome DevTools Performance tab, Lighthouse

The bottleneck is almost never where you think it is.

Step 3: Identify the worst offender

The single slowest operation in the critical path. Fix that first. Do not optimize non-bottlenecks.

Step 4: Write a benchmark before optimizing

Create a benchmark that isolates the bottleneck and can be run repeatedly. This is your before/after comparison.

Step 5: Optimize

Common patterns:

  • Database: add missing indexes, eliminate N+1 queries, batch reads, use projections (don't SELECT *)
  • Memory: streaming vs loading, lazy evaluation, object pooling
  • CPU: algorithmic improvement, caching, memoization
  • Network: batching, compression, HTTP/2, CDN, edge caching
  • Frontend: code splitting, lazy loading, virtual scrolling, image optimization

Step 6: Measure the improvement

Run the benchmark before and after. Calculate: % improvement in p99, % reduction in resource usage. If the improvement is not measurable, the optimization was not worth the complexity.

Step 7: Verify correctness

Run the full test suite. Performance optimizations frequently introduce bugs.

Read the full file on GitHub · 71 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. 5d ago First seen · 71 lines · 14 tokens per session scan A 090ae5d1cf89

Subscribe to this mod's changes

performance-optimization is a skill published in the GitHub repository vignesh2027/AI-AGENT-SKILLS (2 stars, last pushed 7d ago), licensed MIT. It adds 14 tokens to every session and 649 once invoked, about $0.0001 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.