Prerequisites
- Claude Code v2.1.38 or later
- Python projects: codeflash installed in a virtual environment
- JS/TS projects: codeflash installed as a dev dependency
Installation
Add the marketplace and install
Choose installation scope
By default, plugins install at the user level (available across all projects). You can change this:| Scope | Flag | Effect |
|---|---|---|
| User (default) | (none) | Available in all your projects locally via ~/.claude/settings.json |
| Project | --scope project | Shared with team with version control via .claude/settings.json |
| Local | --scope local | This project only for local use, gitignored |
Verify installation
Run/plugin to open the plugin manager. Confirm codeflash appears under the Installed tab.
User-invokable optimization
Run the/optimize skill with a target file:
/optimize skill with a target file and a target function:
/optimize skill with a natural language instruction:
- The skill forks a background optimizer agent
- It parses the instruction to figure out the file and function to optimize
- The agent walks upward from CWD to the git root, looking for
pyproject.toml(Python) orpackage.json(JS/TS) - It verifies codeflash is installed and configured
- If configuration is missing, it auto-discovers your module root and tests directory and writes the config for you
- It runs
codeflash --subagentin the background with a 10-minute timeout along with the file and function argument. - Results are reported when optimization completes
Continuous Optimization triggered on commit
Whenever any new code is commited to the repository after the claude session starts, a new background codeflash optimizer agent will spawn automatically to optimize the new code.Set up auto-permissions
Run/codeflash:setup to allow codeflash to execute automatically without permission prompts:
Bash(*codeflash*) to the permissions.allow array in .claude/settings.json. After this, the post-commit hook can trigger optimizations without asking each time.
Next steps
Usage Guide
All commands, flags, and workflows
Configuration
Config reference for Python and JS/TS projects
Troubleshooting
Common problems and fixes
Architecture
How the plugin works internally