CLAUDE.md Starter Template
The annotated project-memory template we start every repository from: commands, structure, rules and the Never list, with notes on why each section earns its place.
CLAUDE.md is the file Claude Code reads at the start of every session. Done well, it replaces ten minutes of context-setting per session with zero. This is the template we start every project from, with notes on why each section exists.
The template
# CLAUDE.md
## Project
One paragraph: what this is, who uses it, what "working" means.
## Stack
- Framework and version
- Database
- Test runner
- Anything unusual (monorepo layout, codegen, submodules)
## Commands
npm run dev # local server on :3000
npm run test # run before claiming any task done
npm run lint # must pass before commit
npm run db:migrate # never against production
## Structure
- src/app routes and pages
- src/lib shared logic, no framework imports
- src/gen GENERATED, never edit by hand
## Rules
- Match the style of neighbouring code, not your defaults
- Every API boundary validates input
- Small commits, one concern each
## Never
- Do not add dependencies without asking
- Do not touch .env or secrets
- Do not push directly to main
Why these sections
- Commands with comments are the highest-value lines in the file. An agent that knows how to verify its own work stops shipping regressions.
- Structure notes prevent the classic failure of edits landing in generated or legacy directories.
- The Never list is your blast-radius control. Keep it short and absolute; nuance belongs in Rules.
Keeping it useful
Prune it monthly. A memory file that grows stale is worse than none, because the agent trusts it. When a rule stops being true, delete it in the same commit that changed the behaviour. For a guided start, the CLAUDE.md generator builds this structure from a form, and the getting-started guide shows the file in a live session.