Codeflash plugin for Claude Code — optimize code for performance (Python, Java, JavaScript, TypeScript)
npx claudepluginhub codeflash-ai/codeflash-cc-pluginRun codeflash as a background agent to optimize code for performance (Python, Java, JavaScript, TypeScript)
A minimal Claude Code plugin that runs Codeflash as a background agent to optimize Python, Java, JavaScript, and TypeScript code for performance.
[tool.codeflash] in pyproject.tomlpip install codeflash)npm install --save-dev codeflash), configured via a "codeflash" key in package.jsonAdd the plugin marketplace and install:
/plugin marketplace add codeflash-ai/codeflash-cc-plugin
/plugin install codeflash
By default, plugins are installed at the user level (available across all projects). You can change this:
/plugin install codeflash --scope project # shared with team via .claude/settings.json
/plugin install codeflash --scope local # this project only, gitignored
Run /plugin to open the plugin manager and confirm codeflash appears under the Installed tab.
/optimize src/utils.py
/optimize src/main/java/com/example/Fibonacci.java
/optimize src/utils.py my_function
/optimize src/main/java/com/example/Fibonacci.java fibonacci
make my_function run faster
When you make a git commit that includes Python, Java, JavaScript, or TypeScript file changes, the plugin suggests running /optimize on those files.
codeflash-cc-plugin/
├── .claude-plugin/
│ ├── marketplace.json # Marketplace manifest
│ └── plugin.json # Plugin manifest
├── hooks/
│ └── hooks.json # Stop hook for commit detection
├── scripts/
│ ├── find-venv.sh # Shared helper: find and activate a Python venv
│ └── suggest-optimize.sh # Detects Python/Java/JS/TS changes, suggests /optimize
├── skills/
│ ├── optimize/
│ │ └── SKILL.md # /optimize slash command
│ └── setup/
│ └── SKILL.md # /setup command for installation and configuration
└── README.md
The plugin is a thin wrapper around the codeflash CLI:
/optimize spawns a background optimizer agentpip install codeflash for Python/Java, npm install --save-dev codeflash for JS/TS) and configuredcodeflash CLI with the appropriate flagsCodeflash handles everything else: analysis, benchmarking, test generation, and PR creation.
| Language | Config File | Project Markers |
|---|---|---|
| Python | pyproject.toml | pyproject.toml, setup.py |
| Java | N/A | pom.xml, build.gradle |
| JavaScript | package.json | package.json |
| TypeScript | package.json | package.json, tsconfig.json |