CLAUDE.md template for Python FastAPI projects with async patterns and clean architecture.
CLAUDE.md is a project-level configuration file that provides Claude with context about your codebase. It defines coding standards, project structure, preferred patterns, and important conventions. Place it in your project root and Claude automatically reads it at session start.
Copy to your FastAPI project root.
# FastAPI Project
## Tech Stack
- Python 3.11+
- FastAPI
- SQLAlchemy 2.0 (async)
- Pydantic v2
- Poetry for dependency management
## Project Structure
```
src/
api/
routes/ # API route handlers
dependencies/ # Dependency injection
core/
config.py # Settings
security.py # Auth utilities
models/ # SQLAlchemy models
schemas/ # Pydantic schemas
services/ # Business logic
```
## Code Style
- Use type hints everywhere
- Follow PEP 8 conventions
- Use async/await for IO operations
- Write docstrings for all functions
## Best Practices
- Use dependency injection
- Implement proper error handling
- Add request validation with Pydantic
- Use repository pattern for data accessClaude will follow Python and FastAPI best practices.