Skip to content

Commit 440949d

Browse files
committed
Claude updates
1 parent d273f1d commit 440949d

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

CLAUDE.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Overview
66

7-
This is a FastAPI-based service that provides AI-powered explanations of compiler assembly output for the Compiler Explorer website. The service uses Anthropic's Claude API to analyze source code and its compiled assembly, providing educational explanations of compiler transformations and optimizations.
7+
This is a FastAPI-based service that provides AI-powered explanations of compiler assembly output for the Compiler
8+
Explorer website. The service uses Anthropic's Claude API to analyze source code and its compiled assembly, providing
9+
educational explanations of compiler transformations and optimizations.
10+
11+
There's a prompt testing framework that allows for us to explore and improve the prompts used to generate explanations.
12+
This framework is designed to be extensible and allows for easy addition of new tests and prompt variations.
813

914
## Project Structure
1015

11-
This is a FastAPI-based service that can run locally for development or as an AWS Lambda function via Mangum adapter. See the source code for current project structure.
16+
This is a FastAPI-based service that can run locally for development or as an AWS Lambda function via Mangum adapter.
17+
See the source code for current project structure.
1218

1319
## Development Commands
1420

1521
### Setup
22+
1623
```bash
1724
# Set up environment with .env file containing:
1825
# ANTHROPIC_API_KEY=<your-key-here>
@@ -22,6 +29,7 @@ uv sync --group dev
2229
```
2330

2431
### Running Locally
32+
2533
```bash
2634
# Start development server
2735
uv run fastapi dev
@@ -33,6 +41,7 @@ uv run fastapi dev
3341
```
3442

3543
### Testing
44+
3645
```bash
3746
# Run tests
3847
uv run pytest
@@ -42,6 +51,7 @@ uv run pytest app/explain_test.py::test_process_request_success
4251
```
4352

4453
### Code Quality
54+
4555
```bash
4656
# Run pre-commit hooks (ruff linting/formatting, shellcheck)
4757
uv run pre-commit run --all-files
@@ -53,17 +63,20 @@ uv run ruff format
5363

5464
## Key Architecture Details
5565

56-
## Architecture Overview
57-
58-
The service processes compiler output through a pipeline: input validation → smart assembly filtering → Claude API call → response with metrics. See `claude_explain.md` for detailed architecture documentation.
66+
The service processes compiler output through a pipeline: input validation → smart assembly filtering → Claude API
67+
call → response with metrics. See `claude_explain.md` for detailed architecture documentation.
5968

6069
## Code Style Guidelines
6170

6271
- Prefer using modern Python 3.13+ type syntax. Good: `a: list[str] | None`. Bad: `a: Optional[List[str]]`
6372
- Use ruff for linting and formatting with line length of 120 characters
6473
- Prefer pathlib.Path over old-fashioned io like naked `open` and `glob` calls. Always supply an encoding
74+
- Always import at the top of the file, don't litter imports throughout the file
75+
- Strive for simplicity and clarity in code. Avoid unnecessary complexity.
76+
- Don't assume backwards compatibility is required unless explicitly stated. Ask if unsure.
6577

6678
## Development Workflow Notes
6779

68-
- The pre-commit hooks may modify the code and so: always run them before `git add`, and if a commit hook fails then it's probably you'll need to `git add` again if it indicated it fixed issues (e.g. `ruff`)
80+
- The pre-commit hooks may modify the code and so: always run them before `git add`, and if a commit hook fails then
81+
it's probably you'll need to `git add` again if it indicated it fixed issues (e.g. `ruff`)
6982
- Ruff is configured for Python 3.13+ with 120 character line length

0 commit comments

Comments
 (0)