/optimizeMakes code faster without breaking it. Names the bottleneck before suggesting fixes.
Category: Coding & Technical
Before / After
Make this faster.
/optimize [paste slow function + perf data if you have it]
What changes in Claude's response
First Claude tells you *why* it's slow (algorithm, I/O, memory allocation, cache miss), then it suggests fixes ranked by impact. The output starts with 'the bottleneck is X' — not 'you could try caching'. If you give it benchmark output, it uses the actual numbers; if you don't, it estimates.
When NOT to use /optimize
Avoid /optimize as a first instinct. Most slow code isn't slow enough to optimize, and optimizing the wrong thing is a tax on future maintainability. Profile first, optimize second.
Codes that stack with /optimize
/optimize is one of 120 tested prompt prefixes. The full cheat sheet has before/after examples, warnings, combos, and 10 workflow playbooks.
See the full cheat sheet — from $5More Coding & Technical codes
/debugFinds the bug and tells you exactly where it is, not what bugs look like in general.
REFACTORCleans up messy code without changing what it does. Tells you what changed and why.
/shipitAdds the production-readiness layer Claude usually skips: error handling, edge cases, types, logging.
ARCHITECTDesigns system structure before any code is written. Forces decisions, doesn't just list options.
/convertRewrites code in another language idiomatically — not transliterated.