VS Code Extension
Bring Codeflash directly into your editor. See optimization suggestions inline, track progress in real-time, and apply performance improvements without leaving your code.Works with multiple editors — This extension is compatible with VS Code,
Cursor, Windsurf, and other VS Code-compatible editors.
Requirements
Before installing the extension, ensure you have:- VS Code 1.94.0+ (or Cursor, Windsurf, or other VS Code-compatible editor)
- Python 3.9+ installed and available in your PATH
- Git repository initialized for your project
- Microsoft Python extension installed (the Codeflash extension depends on it)
Installation
- VS Code Marketplace
- VSIX (Cursor/Offline)
The quickest way to install for VS Code users:
Open Extensions Panel
Press
Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS) to open the Extensions panel.Install
Click Install on the Codeflash extension.Install from VS Code Marketplace →
First-Time Setup
When you first open a Python file, the extension guides you through setup:Select Python Interpreter
This step is critical. The extension uses the Python interpreter selected in VS Code to run Codeflash. Make sure you select the interpreter from the environment where Codeflash is installed.
- Select via Command Palette
- Select via Status Bar
- Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS) - Type “Python: Select Interpreter”
- Choose the Python environment where you installed Codeflash (e.g., your project’s virtual environment)
Install Codeflash Package
If Codeflash is not installed in your selected Python environment, the extension prompts you to install it. Click the “Install codeflash Python package” button or run:
Authentication
Authenticate with Codeflash using one of two methods:
- Browser Login (Recommended)
- API Key
Click “Sign in with Browser” to authenticate via OAuth. This opens your browser where you can log in with your Codeflash account.
Project Initialization
The extension runs
codeflash init to configure your project if needed. This creates or updates your pyproject.toml with Codeflash settings.If you’ve already run
codeflash init via CLI, the extension detects your
existing configuration and skips to the ready state.Changing the Python Interpreter
If you need to switch to a different Python environment later:- Use VS Code’s interpreter selector:
Ctrl+Shift+P→ “Python: Select Interpreter” - The extension automatically reloads when you change interpreters
The extension uses the Python interpreter selected in VS Code. Make sure Codeflash is installed in the selected environment.
Quick Start
Once installed, here’s the basic workflow:- Open a Python file in your project
- See “optimize” hints appear above functions
- Click to optimize — the extension handles the rest
- Review and accept optimizations via inline comments
Using with CLI
The extension works alongside the Codeflash CLI. You can:- Use CLI for batch operations — Run
codeflash --allfor large-scale optimization - Use extension for interactive work — Optimize individual functions as you code
- Mix both — The extension picks up CLI results when you return to the editor
Next Steps
Features
Learn about all extension features
Configuration
Customize extension settings
Troubleshooting
Fix common issues
Need Help?
- Discord — Join our community
- GitHub Issues — Report bugs or request features
- Documentation — Full docs at docs.codeflash.ai