Claude Code Basics Lesson 26 of 46
How to Write a CLAUDE.md That Actually Works
- Short beats thorough: past a certain length, instructions get followed worse.
- Write things that are verifiable, not wishes: "files go in X" instead of "keep things tidy".
- You add a line on the second repeated correction, not by anticipating.
- Real maintenance is removing, not adding.
The trap: writing everything into it
The moment you understand what it's for, the temptation is irresistible: write everything into it. How you work, what you like, every exception, every edge case, the project's history.
And here's the counterintuitive part, the one worth the whole lesson: a longer file doesn't get followed better. It gets followed worse.
Two reasons, and you already know both. First: that file enters the working space at every session, so the longer it is, the more room it takes. Second, and more important: buried among two hundred lines, the three that actually matter carry less weight. The signal dilutes into the noise — exactly like in a conversation that's run too long.
The practical benchmark: under two hundred lines. If you're going over, you don't need more room: you need to cut.
Write things that are verifiable, not wishes
The difference between an instruction that works and one that's almost always ignored comes down to this: can you check whether it was followed?
"Keep the files organized" → "New contracts go in Documents/Contracts/year, named client-date"
"Write professionally" → "In emails: no exclamation marks, always close with name and role"
"Be careful with numbers" → "Every total gets double-checked by adding it up again before writing it down"
The first ones are wishes: there's no way to know if they were honored, so there's no way to honor them. The second ones are checks.
What goes in and what doesn't
Goes in: how your stuff is organized, naming conventions, things to always do, the commands you use, what things are called in your world.
Doesn't go in: long step-by-step procedures. They take up room in every session even when they're not needed. There's a tool made just for those, and it's the chapter right after this one.
Also doesn't go in anything that's obvious from looking at the folder: if it's visible on its own, writing it down is wasted space.
When you add a line
Not by anticipating. The file grows from experience, and the signal is precise:
you've corrected the same thing for the second time;
you've caught yourself typing in chat a sentence you'd already typed the session before;
a new person, to do your job in your place, would have needed to know that exact thing.
If any of these is true, that line earns its space. Otherwise, wait.
Real maintenance is removing
There's a habit that sets apart people who use these tools well: they remove things every once in a while. Try deleting a rule and see if it gets that wrong again. If nothing happens, that line wasn't doing anything for you — and you were paying for it every session.
Two signs it's time to clean up: instructions that contradict each other (if two lines say opposite things, it'll follow one at random) and stale instructions, ones that describe how you worked six months ago.
What's next
I've said twice now that things "take up space", and I've been acting like you already know what space I mean. In the next lesson we actually look at it: the context window, meaning how much it can hold on the table at once.
Did you get it?
Two minutes, no grade. Trying to answer — even getting it wrong — cements the concepts far more than rereading. Not in the mood? Skip it: the lesson still counts as complete.
A very long CLAUDE.md that explains everything: what happens?
It's counterintuitive, and it's why so many instruction files don't work: past a certain length, instructions dilute and compliance drops. A short, precise file gets followed better than a long, thorough one.
Which of these two instructions is well written?
The first is a wish: there's no way to know if it was honored. The second is verifiable — either the file is in that folder with that name, or it isn't. Verifiable instructions are the ones that get followed.
When is it worth adding a line to CLAUDE.md?
Anticipating produces long files full of stuff you don't need. A repeated second correction, though, is a real signal: you'll keep saying that thing forever, so it's worth the line. The file grows from experience, not from imagination.
-
Chapter 1 Introduction
-
Chapter 2 What's Underneath
-
Chapter 3 You Choose the Engine
-
Chapter 4 First Time at the Controls
-
Chapter 5 What You Let It Touch
-
Chapter 6 What It Knows About You
-
Chapter 7 Skills
-
Chapter 8 How Many You Put to Work
-
Chapter 9 What It's Connected To
-
Chapter 10 Automating the Setup
-
Chapter 11 Wrap-Up