ClaudeperformancePerformance

Performance Claude Rules

Claude rules for performance optimization: profiling workflow, caching patterns, database optimization, and frontend performance.

CLAUDE.md
- Always benchmark before and after optimization to confirm improvement
- Use flamegraphs to identify CPU hotspots; trace to identify I/O bottlenecks
- Cache at the nearest layer to the user: browser → CDN → app → database
- Use read replicas for read-heavy workloads; shard for write-heavy workloads
- Implement request coalescing to prevent cache stampede under load
- Use streaming for large responses; avoid loading full datasets into memory
- Set aggressive timeouts on all external calls; implement circuit breakers
- Load test with k6 or Locust before shipping major features

How to use with Claude

Create a `CLAUDE.md` file in your project root. Claude Code reads this on startup and follows your conventions throughout the session.

#performance#claude#caching#optimization#coding-rules

Related Rules