2026-01-20 06:05:02 +00:00
# CLAUDE.md
## Project Overview
2026-03-16 04:41:26 +00:00
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.
2026-01-20 06:05:02 +00:00
2026-02-14 22:37:51 +00:00
## Optimization Pipeline
2026-01-20 06:05:02 +00:00
2026-02-14 22:37:51 +00:00
```
Discovery → Ranking → Context Extraction → Test Gen + Optimization → Baseline → Candidate Evaluation → PR
2026-01-20 06:05:02 +00:00
```
2026-02-14 22:37:51 +00:00
1. **Discovery** (`discovery/`): Find optimizable functions across the codebase
2. **Ranking** (`benchmarking/function_ranker.py`): Rank functions by addressable time using trace data
2026-02-23 13:16:43 +00:00
3. **Context** (`languages/< lang > /context/`): Extract code dependencies (read-writable code + read-only imports)
2026-02-14 22:37:51 +00:00
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
2026-02-11 03:05:10 +00:00
2026-03-16 04:41:26 +00:00
# Instructions
2026-03-17 02:45:32 +00:00
- **Bug fix workflow** — follow these steps in order, do not skip ahead:
1. Read the relevant code to understand the bug
2. Write a test that reproduces the bug (run it to confirm it fails)
3. Spawn subagents (using the Agent tool) to attempt the fix — each subagent should apply a fix and run the test to prove it passes
4. Review the subagent results, pick the best fix, and apply it
5. Never jump straight to writing a fix yourself — always go through steps 1-4
2026-03-16 04:41:26 +00:00
- Everything that can be tested should have tests.
2026-02-19 07:53:40 +00:00
2026-01-25 09:53:05 +00:00
<!-- Section below is auto-generated by `tessl install` - do not edit manually -->
2026-01-20 06:05:02 +00:00
# Agent Rules <!-- tessl-managed -->
@.tessl/RULES.md follow the [instructions ](.tessl/RULES.md )
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-15 01:55:06 +00:00
@AGENTS .md