mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
1.6 KiB
1.6 KiB
CLAUDE.md
Project Overview
CodeFlash is an AI-powered code optimizer that automatically improves performance while maintaining correctness. It supports Python, JavaScript, TypeScript, Java with more languages planned. It uses LLMs to generate optimization candidates, verifies correctness through test execution, and benchmarks performance improvements.
Optimization Pipeline
Discovery → Ranking → Context Extraction → Test Gen + Optimization → Baseline → Candidate Evaluation → PR
- Discovery (
discovery/): Find optimizable functions across the codebase - Ranking (
benchmarking/function_ranker.py): Rank functions by addressable time using trace data - Context (
languages/<lang>/context/): Extract code dependencies (read-writable code + read-only imports) - Optimization (
optimization/,api/): Generate candidates via AI service, run in parallel with test generation - Verification (
verification/): Run candidates against tests, compare outputs via custom pytest plugin - Benchmarking (
benchmarking/): Measure performance, select best candidate by speedup - Result (
result/,github/): Create PR with winning optimization
Instructions
- When I report a bug, don't start by trying to fix it. Instead, start by writing a test that reproduces the bug. Then, have subagents try to fix the bug and prove it with a passing test.
- Everything that can be tested should have tests.
Agent Rules
@.tessl/RULES.md follow the instructions
@AGENTS.md