8000 codeflash-cc-plugin/README.md at main · codeflash-ai/codeflash-cc-plugin · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
102 lines (71 loc) · 2.65 KB

File metadata and controls

102 lines (71 loc) · 2.65 KB

Codeflash Claude Code Plugin

A minimal Claude Code plugin that runs Codeflash as a background agent to optimize Python code for performance.

Prerequisites

  • Claude Code v2.1.38 or later
  • codeflash installed in your project
  • Project initialized with codeflash init (creates [tool.codeflash] in pyproject.toml)

Installation

From GitHub

Add the plugin marketplace and install:

/plugin marketplace add codeflash-ai/codeflash-cc-plugin
/plugin install codeflash

From a local clone

git clone https://github.com/codeflash-ai/codeflash-cc-plugin.git
/plugin marketplace add ./codeflash-cc-plugin
/plugin install codeflash

Installation scope

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

Verify installation

Run /plugin to open the plugin manager and confirm codeflash appears under the Installed tab.

Usage

Optimize a file

/optimize src/utils.py

Optimize a specific function

/optimize src/utils.py my_function

Optimize the entire project

/optimize --all

Additional flags

/optimize src/utils.py --no-pr          # Skip PR creation
/optimize src/utils.py --effort high    # Set optimization effort level

Auto-suggest after commits

When you make a git commit that includes Python file changes, the plugin suggests running /optimize on those files.

Plugin Structure

codeflash-cc-plugin/
├── .claude-plugin/
│   ├── marketplace.json         # Marketplace manifest
│   └── plugin.json              # Plugin manifest
├── agents/
│   └── optimizer.md             # Background optimization agent
├── hooks/
│   └── hooks.json               # PostToolUse hook for commit detection
├── scripts/
│   └── suggest-optimize.sh      # Detects Python commits, suggests /optimize
├── skills/
│   └── optimize/
│       └── SKILL.md             # /optimize slash command
└── README.md

How It Works

The plugin is a thin wrapper around the codeflash CLI:

  1. /optimize spawns a background optimizer agent
  2. Verifies codeflash is installed (via pip install codeflash) and configured
  3. Runs the codeflash CLI with the appropriate flags
  4. Reports results (optimizations found, PRs created)

Codeflash handles everything else: analysis, benchmarking, test generation, and PR creation.

0