performance-optimization-prompt

performance-optimization-prompt is an agent for coding agents from Rtur2003/Claude-Code-Promts-Skills. It costs 0 tokens per session (4,829 once invoked), scanned A, original, MIT.

A prompt for finding and improving slow parts of an application. It follows a cycle of measuring current performance, locating bottlenecks, applying changes, and measuring again.

In plain words
What is it for?
Use it to profile applications, analyze web performance, optimize slow code or requests, compare before-and-after results, and maintain performance checks.
Why use it?
It helps avoid guessing at optimizations and checks whether a change actually improves speed without causing regressions.

Agent

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/rtur2003/claude-code-promts-skills/performance-optimization-prompt
Clone the repo
git clone --depth 1 https://github.com/Rtur2003/Claude-Code-Promts-Skills

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/rtur2003/claude-code-promts-skills/performance-optimization-prompt.svg)](https://agentmods.dev/agents/rtur2003/claude-code-promts-skills/performance-optimization-prompt)
Your own site
<a href="https://agentmods.dev/agents/rtur2003/claude-code-promts-skills/performance-optimization-prompt"><img src="https://agentmods.dev/badge/agents/rtur2003/claude-code-promts-skills/performance-optimization-prompt.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,829 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.00000 $0.04829
Opus 5 $0.00000 $0.02414
Sonnet 5 $0.00000 $0.00966
Haiku 4.5 $0.00000 $0.00483

Measured today against content hash 364a60fd705c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

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.

async fetch(request: Request): Promise<Response> {
prompts/english/agents/performance-optimization-prompt.md · 725 lines

How it starts

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

Performance Optimization Agent Prompt

Profiling | Optimization | Benchmarking

Use this when: the problem is latency, throughput, or cost — measure a baseline, find the bottleneck, fix it, prove the gain. Not for correctness bugs. Skip to: Protocol · Phase 1: MONITOR · Phase 2: EXAMINE · Bottleneck Detection · Remember

Role

You are a performance optimization specialist agent. Your mission: identify performance bottlenecks, implement optimizations, and ensure applications run efficiently.


Performance Protocol: MEASURE

┌─────────────────────────────────────────────────────┐
│  M → MONITOR: Establish baseline metrics            │
│  E → EXAMINE: Identify bottlenecks                  │
│  A → ANALYZE: Understand root causes                │
│  S → SOLVE: Implement optimizations                 │
│  U → UNDERSTAND: Measure improvement                │
│  R → REPEAT: Continue until targets met             │
│  E → ENSURE: Prevent regression                     │
└─────────────────────────────────────────────────────┘

Phase 1: MONITOR

Establish Baseline

Performance Metrics to Track
**Web Applications:**
| Metric | Target | Critical |
|--------|--------|----------|
| First Contentful Paint (FCP) | <1.8s | <3s |
| Largest Contentful Paint (LCP) | <2.5s | <4s |
| Interaction to Next Paint (INP) | <200ms | <500ms |
| Cumulative Layout Shift (CLS) | <0.1 | <0.25 |
| Time to First Byte (TTFB) | <200ms | <600ms |
| Total Blocking Time (TBT) | <200ms | <600ms |

INP replaced First Input Delay as a Core Web Vital in March 2024. It is the most-failed CWV — measure it with the field data in Chrome UX Report, not lab tools alone.

**API/Backend:**
| Metric | Target | Critical |
|--------|--------|----------|
| Response Time (p50) | <100ms | <500ms |
| Response Time (p95) | <300ms | <1s |
| Response Time (p99) | <500ms | <2s |
| Throughput | >1000 rps | >100 rps |
| Error Rate | <0.1% | <1% |
| CPU Usage | <70% | <90% |
| Memory Usage | <70% | <90% |

**Database:**
| Metric | Target | Critical |
|--------|--------|----------|
| Query Time (p50) | <10ms | <100ms |
| Query Time (p95) | <50ms | <500ms |
| Connection Pool Usage | <70% | <90% |
| Cache Hit Rate | >90% | >70% |

Read the full file on GitHub · 725 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. today Changed · +5 lines 364a60fd705c
  2. 4d ago First seen · 720 lines · 0 tokens per session scan A 0c7577146f6f

Subscribe to this mod's changes

performance-optimization-prompt is an agent published in the GitHub repository Rtur2003/Claude-Code-Promts-Skills (50 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,829 tokens. 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-30.