Performance Optimizer
Analyzes your code for performance bottlenecks and suggests concrete optimizations.
What it does
The Performance Optimizer prompt refuses to optimize blind. It forms hypotheses about the bottleneck, names the exact measurement to take, narrows to the real cause after you share numbers, and then proposes 2-3 ordered optimizations with expected improvements.
What it solves
Premature optimization wastes weeks. This prompt ensures every change has a measured reason and a measurable expected outcome — no more "rewrote everything to Rust" without knowing the baseline.
How to install
Which tool are you using?
Not sure? Claude.ai is the website. Claude Code is the command-line tool you install separately. Cursor is a code editor that reads .cursorrules.
- 01
Copy the prompt
Click the Copy button on the code block below to grab the full prompt text.
- 02
Paste into a new Claude chat
Open claude.ai or Claude Code and paste the prompt as the first message.
- 03
Fill in the bracketed placeholder
Replace [PASTE YOUR ... HERE] with your actual input before sending.
- 04
Iterate on the output
Claude's first response is usually 80% there. Ask for specific refinements — "make section 4 more concrete", "shorten section 7" — instead of regenerating from scratch.
The claude prompt file
Copy the full contents below, or download the file directly.
You are a performance engineer who measures before optimizing. When I paste code or describe a slow system: 1. Identify the likely hot path based on the code / description2. List 5 measurable hypotheses for the bottleneck3. For each hypothesis, name the exact measurement to take (tool + metric)4. After I share measurements, narrow to the real bottleneck5. Propose 2-3 concrete optimizations, ordered by effort vs impact Rules:- Never suggest an optimization without a hypothesis- Always state the expected improvement- Warn about optimizations that hurt readability or increase risk- Prefer algorithmic wins over micro-optimizations Code or system to analyze:[PASTE CODE OR DESCRIPTION HERE]Example output
What Claude does before and after you install this claude prompt.
Claude suggests memoizing everything and adding a cache. You implement it. Nothing gets faster because the real bottleneck was a database index.
Claude names 4 hypotheses. Measurement points to an N+1 query. Claude proposes an eager load, estimates 10x speedup, warns about memory impact. Fix ships, measurement confirms 12x.
Customization tips
Add a step 0 requiring Claude to ask for the current baseline metric if not provided — ensures comparisons are always meaningful. For frontend work, extend the measurement step to cover Web Vitals specifically. For backend, add p95 and p99 latency as default metrics.
Related resources
Bug Detective
Systematically debugs issues by asking the right questions and tracing root causes.
Senior Code Reviewer
Acts as a senior engineer reviewing your PR. Catches logic errors, security issues, and code smells.
Tech Stack Advisor
Recommends the right tech stack for your project based on team size, scale, and requirements.
Frequently asked questions
Will it just tell me to memoize?
No. Every suggestion requires a measured reason.
Does it work for frontend?
Yes — React, Flutter web, any UI stack.
Does it work for databases?
Yes, especially for query optimization.
Does it cover infrastructure?
Partially. For infra-level perf, pair with the Tech Stack Advisor.
Can it benchmark for me?
It tells you what to measure and how. You run the benchmarks.
Want more like this?
Browse the full RohanKit library — free resources for Claude and Cursor.