CLSkills
💻/optimize

Makes code faster without breaking it. Names the bottleneck before suggesting fixes.

Category: Coding & Technical

Before / After

Without /optimize

Make this faster.

With /optimize

/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 $5

More Coding & Technical codes