With more AI generated code now, the focus is on implementing features and fixing bugs. Coding agents are great for these tasks, but we asked the question - what is the performance of the code that is generated? Our results were shocking. In a pull request with 47,000 lines of code changes, we profiled with Codeflash and found ~120 optimizations. This reveals the extent of the slow code that we are all shipping. So we asked the question: is there a way to prevent this while still shipping code quickly? To solve this problem, we created the CodeFlash Claude Code plugin.
Our Claude Code plugin monitors the new code you’re writing in the background as an expert performance engineer, and when your new code is ready to commit, it tries to apply rigorous optimization approaches by searching for the best way to speed up your code, while still thoroughly verifying for correctness. All this happens within 3 minutes.
The result - All your new code is always optimal. Codeflash can convert those pesky $O(n^2)$ loops into $O(n)$ lookups, or change the dataflow to simplify the problem, or cache when appropriate. This way, your application runs super efficiently at scale, with low latencies and low compute costs.
In your Claude Code Session, add the Codeflash marketplace
/plugin marketplace add codeflash-ai/codeflash-cc-pluginInstall the Codeflash Plugin
/plugin install codeflashSetup Codeflash for your project
/codeflash:setupIt's a one-time command which discovers your project layout and config and sets up your authentication for Codeflash.
Our philosophy is “Continuous Optimization”. We want all your code to be optimal, without slowing you down. That's why we run Codeflash in the background while you continue your work with Claude Code. Codeflash starts optimizations whenever a new commit is created during a claude session, and gives the control back to the user. It doesn’t matter if commit was created by the user manually or by Claude code itself.
You can also explicitly ask Claude to "make this run faster" or use the "/optimize" command provided by our plugin like "/optimize --file myfile.py" or "/optimize --file myfile.py --function myfunc".
Codeflash spawns a new subagent that runs in a background shell, trying to find the optimization for your code. If it finds a real optimization it can prove then it asks claude to review it and presents the optimization to you - with the concise speedup numbers and correctness proof.
Claude code triggers the Codeflash plugin as a stop hook that fires whenever new code is committed since the session's start. Actual flow:
No setup per function. No benchmark files to maintain. No profiler sessions to schedule. The plugin discovers your project structure, finds your tests, and handles the rest. No side-effects in your repository as it operates in a separate git worktree which gets deleted once it completes.
It is eye-opening when we realize the amount of slow code that is being shipped daily. Once you witness Codeflash in action, and notice all the slow code being written - it’s hard to go back to the old way. There are several optimizations patterns Codeflash has found that are merged in production and reduced latency and cost on cloud.
We hope you find as much value out of Codeflash as we and our early users are getting.
Codeflash is closer to what would happen if you had a performance engineer on your team who reviewed every commit, profiled every changed function, benchmarked every alternative, and only spoke up when they had a verified improvement with numbers to back it up. You can check out the plugin here!
Join our newsletter and stay updated with the latest in performance optimization automation.


Join our newsletter and stay updated with fresh insights and exclusive content.
