codeflash/CLAUDE.md
misrasaurabh1 ad329cfe4c update
2026-03-15 21:41:26 -07:00

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
  1. Discovery (discovery/): Find optimizable functions across the codebase
  2. Ranking (benchmarking/function_ranker.py): Rank functions by addressable time using trace data
  3. Context (languages/<lang>/context/): Extract code dependencies (read-writable code + read-only imports)
  4. Optimization (optimization/, api/): Generate candidates via AI service, run in parallel with test generation
  5. Verification (verification/): Run candidates against tests, compare outputs via custom pytest plugin
  6. Benchmarking (benchmarking/): Measure performance, select best candidate by speedup
  7. 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