codeflash/CLAUDE.md
Kevin Turcios 6718e66582 feat: add private tessl tiles for codeflash rules, docs, and skills
Three private tiles in the codeflash workspace:
- codeflash-rules: 6 steering rules (code-style, architecture, optimization-patterns, git-conventions, testing-rules, language-rules)
- codeflash-docs: 7 doc pages (domain-types, optimization-pipeline, context-extraction, verification, ai-service, configuration)
- codeflash-skills: 2 skills (debug-optimization-failure, add-codeflash-feature)
2026-02-14 20:55:06 -05:00

2 KiB

CLAUDE.md

Project Overview

CodeFlash is an AI-powered Python code optimizer that automatically improves code performance while maintaining correctness. 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 (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

Domain Glossary

  • Optimization candidate: A generated code variant that might be faster (OptimizedCandidate)
  • Function context: All code needed for optimization — split into read-writable (modifiable) and read-only (reference)
  • Addressable time: Time a function spends that could be optimized (own time + callee time / call count)
  • Candidate forest: DAG of candidates where refinements/repairs build on previous candidates
  • Replay test: Test generated from recorded benchmark data to reproduce real workloads
  • Tracer: Profiling system that records function call trees and timings (tracing/, tracer.py)
  • Worktree mode: Git worktree-based parallel optimization (--worktree flag)

Agent Rules

@.tessl/RULES.md follow the instructions

@AGENTS.md