Chapter 05 · Daily driving
CLAUDE.md & memory
Every conversation starts fresh; Claude forgets yesterday. CLAUDE.md fixes that: a plain text file of standing instructions that Claude reads at the start of every session. Write it once, benefit forever.
Let Claude write it: /init
Type /init and Claude studies your project, then drafts a CLAUDE.md for you. Edit it any time with /memory or like any normal file.
What goes in it
The golden test, straight from the official guide: for each line ask "would removing this cause Claude to make mistakes?" If not, cut it. Long files get ignored.
✓ Put in
How to run and test the project · rules that differ from the norm · things that burned you before · "always ask before X"
✗ Leave out
Anything Claude can see by reading the code · long tutorials · obvious advice like "write good code"
# Portfolio tracker
## Run it
Open index.html in a browser. No build step.
## Rules
- Files in data/ are broker exports: read them, never edit them
- Show money with 2 decimals and a thousands separator
- I'm a beginner: explain changes in plain English
Where it lives
| File | Applies to |
|---|---|
CLAUDE.md in your project | This project, shared with teammates if you use git |
CLAUDE.local.md | This project, just you |
~/.claude/CLAUDE.md | Every project on your computer (your personal preferences) |
Save thoughts mid-chat with #
Notice something worth remembering while working? Start a message with #:
Automatic memory
Claude also keeps its own notebook: things it learns about your project (which commands work, what you corrected it on) get saved automatically and recalled next session. Browse or edit it with /memory. It's all plain text; nothing is hidden.
If Claude keeps ignoring a rule, your CLAUDE.md is probably too long and the rule is drowning. Prune it. For rules that must happen every single time, use a hook instead; hooks can't be forgotten.
/init
Read what it wrote. Delete half of it. That's usually the right length.