You have probably added something like this to a prompt: "Do not modify any file I have not explicitly mentioned."
The next session, the agent modified another file.
You added it again. The next session, same thing. You started putting it at the top of every prompt. Then you started wondering: why am I repeating something that never changes?
Because you are putting a rule in the wrong place. Prompt-level reminders get treated as context for that particular task — not as operating principles. They can fade mid-session. CLAUDE.md does not — it loads into system context and stays there throughout.
But only if you write it correctly.
01Two kinds of CLAUDE.md — and why one of them does not work
✕ CLAUDE.md as README
✓ CLAUDE.md as forcing function
Same file, two completely different roles. Most people's CLAUDE.md currently looks more like the left column — enough for the agent to understand context, not enough to shape behavior.
The difference is not about length or detail. It is about type of information. A README explains the current state. A forcing function sets rules for future behavior.
The test: "If I removed this line, would the agent do anything differently?" If not — it is a description, not a rule. And descriptions do not change behavior.
02Four things a working CLAUDE.md actually needs
Not everything belongs here. Four categories form the skeleton:
Things with no exceptions: "Never edit files outside the directory I specify." / "Always ask before deleting anything." / "If unsure about scope, stop and ask — do not guess." These must be commands, not suggestions. "You should ask when…" is much weaker than "Stop and ask when…"
Agents tend to either ask too much (confirming every step) or not enough (until it is too late). Define the trigger conditions explicitly: "If the change touches shared config or anything outside the current module — stop and ask first."
If you want it to report in a specific format, write commit messages in a specific convention, or keep to one language throughout — define it once here. Every time you correct the format in a prompt is a time you should not have needed to.
"The infra/prod/ directory is read-only — do not write to it." / "config.json is the source of truth — do not modify it autonomously." / "Service A and B share state — a change to one affects the other." The agent does not know your system's history. You have to tell it where the landmines are.
These four are enough for a working CLAUDE.md. Not complete enough, not long enough — the right kind. Add to it when you discover new patterns worth encoding, not to make it comprehensive from the start.
03Signs your setup is working against you
Each signal above is a small energy drain you have learned to ignore — because it happens gradually and nothing gives it a name.
04CLAUDE.md as a one-person culture document
The most useful way to think about CLAUDE.md is not as a configuration file. Think of it as an operating-principles document — the kind you would hand a new colleague before their first task.
A new colleague needs to know the things you treat as obvious — because nothing is obvious to someone new. They need to know which areas are fragile. They need to know when to stop and ask rather than decide on their own. And they need to know what format you expect when they report back.
You can say all of that at the start of every task — or you can write it once, in the right place, and never have to say it again. CLAUDE.md is that one time.
The only difference from a real colleague: the agent re-reads CLAUDE.md fresh every session and applies it exactly as written. Colleagues sometimes forget. The agent does not — but only if you have written the right things into it.