MCPcopy Index your code
hub / github.com/codeflash-ai/codeflash

github.com/codeflash-ai/codeflash @1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.1 ↗ · + Follow
1,103 symbols 4,815 edges 215 files 114 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Codeflash

Codeflash is an AI optimization tool that automatically improves the performance of your Python code while maintaining its correctness.

img.png

Features

  • Automatically optimizes your code using AI
  • Maintains code correctness through extensive testing
  • Opens a pull request for each optimization
  • Continuously optimizes your codebase through CI
  • Dynamically optimizes your real workflows through tracing

Installation

To install Codeflash, run:

pip install codeflash

Quick Start

  1. Configure Codeflash for your project: codeflash init

  2. Optimize a function: codeflash --file path/to/your/file.py --function function_name

  3. Optimize your entire codebase: codeflash --all

Getting the Best Results

To get the most out of Codeflash:

  1. Install the Github App and actions workflow
  2. Find optimizations on your whole codebase with codeflash --all
  3. Find and optimize bottlenecks with the Codeflash Tracer
  4. Review the PRs Codeflash opens

Learn More

License

Codeflash is licensed under the BSL-1.1 License. See the LICENSE file for details.

Core symbols most depended-on inside this repo

comparator
called by 232
codeflash/verification/comparator.py
get_run_tmp_file
called by 72
codeflash/code_utils/code_utils.py
pig_latin
called by 48
code_to_optimize/final_test_set/pig_latin.py
add
called by 43
codeflash/models/models.py
run_and_parse_tests
called by 40
codeflash/optimization/optimizer.py
ph
called by 31
codeflash/telemetry/posthog_cf.py
humanize_runtime
called by 29
codeflash/code_utils/time_utils.py
addEdge
called by 24
code_to_optimize/final_test_set/topological_sort.py

Shape

Function 694
Method 263
Class 129
Route 17

Languages

Python100%
TypeScript1%

Modules by API surface

tests/test_function_dependencies.py45 symbols
tests/test_comparator.py45 symbols
tests/test_code_utils.py40 symbols
codeflash/models/models.py39 symbols
codeflash/discovery/functions_to_optimize.py32 symbols
code_to_optimize/crosshair_tests.py29 symbols
tests/test_code_replacement.py28 symbols
tests/test_code_context_extractor.py27 symbols
codeflash/verification/test_results.py27 symbols
codeflash/tracer.py24 symbols
tests/test_shell_utils.py23 symbols
codeflash/code_utils/code_replacer.py23 symbols

For agents

$ claude mcp add codeflash \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact