Optimize Performance
Systematic approach to finding and fixing performance issues
CLAUDE.md
When optimizing performance:
- Measure first. Use profiling tools to identify the actual bottleneck — don’t guess.
- Set a target: “page load under 2s” or “API response under 200ms.”
- Fix the biggest bottleneck first. One large fix beats ten micro-optimizations.
- After each change, measure again to verify improvement and check for regressions.
- Common wins to check: N+1 queries, missing indexes, uncompressed assets, blocking scripts, unnecessary re-renders, oversized bundles.
- Stop when you hit the target. Don’t optimize past the point of diminishing returns.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.