Day 7
What is CLAUDE.md?
Understand how CLAUDE.md files shape Claude's behavior and set up your first one.
0 / 7 tasks
Project-aware instructions
CLAUDE.md is a Markdown file that Claude automatically reads at the start of every session in your project. Think of it as a briefing document — you tell Claude about your project, your preferences, and your rules once, and it follows them every time without you having to repeat yourself.
File loading hierarchy
Claude loads CLAUDE.md files in order of specificity:
1. **~/.claude/CLAUDE.md** — Global preferences (applies to every project)
2. **./CLAUDE.md** — Project root instructions
3. **./src/CLAUDE.md** — Module-level instructions (loaded when Claude works in that directory)
Later files don't override earlier ones — they're all combined.
1. **~/.claude/CLAUDE.md** — Global preferences (applies to every project)
2. **./CLAUDE.md** — Project root instructions
3. **./src/CLAUDE.md** — Module-level instructions (loaded when Claude works in that directory)
Later files don't override earlier ones — they're all combined.
Minimal first CLAUDE.md
markdown
# Project: MyApp
## Stack
- Python 3.12, FastAPI, SQLAlchemy 2.0, PostgreSQL
- Frontend: HTMX + Alpine.js
- Tests: pytest with async fixtures
## Code Style
- Use type hints everywhere
- Prefer f-strings over .format()
- Max line length: 100 characters
- Use Pydantic v2 models for validation
## Rules
- Never use `print()` — use `logging` instead
- All database operations must use async sessions
- Every public function needs a docstring
Start minimal. Add rules only when you notice Claude doing something you don't want. CLAUDE.md that grows organically is more useful than one written upfront.