A CLAUDE.md that Claude actually follows
Claude Code reads a file called CLAUDE.md at the start of every session. A good one saves you from repeating the same instructions every day. Here is what we put in ours.
Keep it short and specific
The file is read every time, so every line costs attention. Write rules Claude can act on, not wishes. "Run npm test before saying a change is done" works. "Write good code" does nothing.
The five parts we always include
- Commands. How to install, run, test and build. Exact lines, ready to copy.
- Layout. Where things live: which folder holds the app, the tests, the scripts.
- House rules. Branch before you change anything. Never commit secrets. Ask before anything that deletes, spends money or goes public.
- Definition of done. Tests pass, the change was tried for real, and anything not checked is said out loud.
- Where to write notes. A worklog file, so the next session knows what happened in this one.
Put facts in, keep history out
CLAUDE.md is the current state: what is true now. The story of how you got there belongs in a worklog or in git history. When a rule changes, edit the line; don't add a second, contradicting one.
Say what Claude must never do
A short list of hard limits is the most useful part of the file: no secrets in commits, no running database migrations without asking, no posting anything public. Put the reason next to each one, so Claude can apply it to cases you didn't list.
Start from a sample
Our free sample has these parts with placeholders to fill. Rename it to CLAUDE.md, put it in your project's root folder, and edit it as the project grows.
Want ready-made versions for five common stacks? The Project Starter Kit has them, plus safe settings.