The most underrated habit in is also the simplest. Boris Cherny — who built Claude Code — explained his team’s rule like this:
Anytime we see Claude do something incorrectly, we add it to so it doesn’t repeat next time.
That’s the whole tip.
What it looks like in practice:
- Claude keeps creating files in
src/lib/when they belong insrc/services/. Add to CLAUDE.md: “New business logic lives insrc/services/, notsrc/lib/.lib/is reserved for stateless helpers.” - Claude keeps using
letwhere the team writesconst. Add: “Preferconstfor everything;letonly when the variable is genuinely reassigned.” - Claude keeps logging customer IDs in plain text. Add: “Customer IDs (
cust_*) are PII. UseredactCustId()fromsrc/lib/log.ts.”
Each line is short. Each line replaces a correction you would otherwise type every session.
Two rules that keep this from bloating:
- One line per rule. If the rule needs five lines of explanation, it probably belongs in a real doc (
docs/conventions.md), referenced from CLAUDE.md by one line. The CLAUDE.md is the index, not the encyclopedia. - Delete rules that no longer apply. If you moved the file, changed the convention, or fixed the underlying bug — drop the line. Stale rules are worse than missing ones because Claude follows them anyway.
CLAUDE.md is shared (it’s in git). When you write down a rule, you’re teaching the next colleague too. The file is the team’s collective memory written in a form Claude can read.
The meta-trick: you don’t have to open the file yourself. When you catch Claude making a mistake, say:
That’s wrong — we always do X instead. Add a one-line rule to
CLAUDE.mdin the right section so this doesn’t happen again next session.
Claude opens CLAUDE.md, picks the right section, adds the rule, and shows you the diff. The habit becomes typing one sentence instead of editing a file every time.
Pair this with the Worked CLAUDE.md example tip for the shape, and the Keep CLAUDE.md clean tip for what to trim.