CLAUDE.md Best Practices: Templates + What to Delete

You correct Claude on the same three things every session. It forgets your stack, ignores your naming rules, and rewrites files you told it never to touch. The fix isn't a longer prompt. It's a CLAUDE.md that actually works, and most people bloat theirs until it stops working entirely.
Quick answer: A good CLAUDE.md follows these best practices: keep it under ~200 lines, state your commands, conventions, and the why behind each rule, and delete everything Claude can already infer. CLAUDE.md is the memory file Claude Code reads at the start of every session, so without it Claude begins each conversation with a blank context window and repeats the same mistakes.
What is CLAUDE.md and why it's the biggest lever on output quality
CLAUDE.md is a plain markdown file that Claude Code reads automatically when it starts working in your project. Think of it as the standing instructions you'd give a sharp contractor on day one: here's how we do things, here's what not to touch, here's why. Without it, every session starts from zero and you become the quality check, correcting the same mistakes on repeat.
The reason it matters more than any single prompt is that it persists. A good prompt fixes one message. A good CLAUDE.md fixes every message. This is the same setup discipline we cover in how to set up Claude Code for your business — the memory file is where most of the quality difference actually lives.
Here's the counterintuitive part: more is not better. The instinct is to dump everything you know into the file so Claude never gets it wrong. That instinct is what breaks it.
Why a bloated CLAUDE.md makes Claude worse (context rot)
A bloated CLAUDE.md makes Claude less accurate, not more, because everything in it competes for space in the context window. This is called context rot: as you cram in more text, the model gets worse at using any single piece of it.
The Chroma 2025 context rot study put numbers on this. Model accuracy dropped from roughly 95% to around 60% as input length grew, per a breakdown by maketocreate. That's not a rounding error. That's the difference between an agent you trust and one you have to double-check.
So a 600-line CLAUDE.md documenting every edge case doesn't make Claude careful. It buries the five rules that actually matter under 595 lines of noise, and Claude starts missing the ones you care about most. Every line you add is a line competing with your commands and conventions for attention.
The practical takeaway: treat CLAUDE.md like a budget, not a bucket. Aim for under ~200 lines. If a rule earns its place, it stays. If Claude can figure it out from the code, delete it.
The CLAUDE.md template a non-developer can copy
Here's a complete CLAUDE.md template built for a founder or no-code builder, not a professional developer. Copy it, replace the bracketed parts with your details, and delete any section you don't need. It covers the four things that carry almost all the value: commands, conventions, the why intent, and hard boundaries.
# Project: [what this project is, one sentence]
## Commands
- Run the app: [exact command, e.g. npm run dev]
- Run tests: [exact command]
- Deploy: [exact command or "ask me before deploying"]
## Conventions
- File naming: [e.g. kebab-case for files, PascalCase for components]
- Where things live: [e.g. all pages in /app, shared logic in /lib]
- Style: [e.g. match the existing patterns in this repo, don't introduce new libraries]
## Why (intent behind the rules)
- We keep dependencies minimal because [reason].
- We test before deploy because [reason].
- Match existing patterns because consistency matters more than cleverness here.
## Never do this
- Never touch [specific file/folder, e.g. .env or /config].
- Never commit secrets or API keys.
- Never rewrite working code unless I ask.
## When unsure
- Ask a clarifying question instead of guessing.
- Prefer the smallest change that solves the problem.
That's it. Under 30 lines and it already outperforms most 400-line files, because every line does a job. The why section is the part most people skip and the part that matters most. When Claude understands intent, it makes better calls on the cases you didn't spell out.
The one section people always forget: intent
State the why behind your rules, because intent generalizes and rules don't. If you write "use TanStack Query" with no reason, Claude follows it literally. If you write "use TanStack Query so we're not managing loading states by hand," Claude understands the goal and applies it to situations you never listed.
This is the difference between an agent that follows orders and one that makes good decisions. One line of intent replaces ten lines of edge cases.
What to delete from your CLAUDE.md right now
Delete anything Claude can infer from your code, anything it already knows, and anything you wrote once and never enforced. Here's the checklist.
- Generic best practices. "Write clean code," "add comments," "handle errors." Claude already does this. You're spending context to tell it what it already knows.
- Framework documentation. Don't paste how React or Next.js works. Claude knows the framework. Only include your deviations from the defaults.
- File trees Claude can read. Don't maintain a copy of your folder structure. Claude can list the directory itself, and your copy goes stale the moment you add a file.
- Long code examples. A ten-line convention beats a hundred-line example. State the rule; don't demonstrate it at length.
- Rules you don't actually enforce. If half your files already break a rule, it's not a rule. Delete it or fix the files. A rule Claude sees contradicted everywhere gets ignored.
- Duplicate instructions. Say each thing once. Repeating a rule three times doesn't triple its weight; it just eats context.
A useful test: read each line and ask would a sharp new hire need this written down, or would they figure it out? If they'd figure it out, delete it.
Bloated CLAUDE.md vs lean CLAUDE.md
The difference shows up in every session. Here's the same file two ways.
| Bloated (600+ lines) | Lean (under 200 lines) | |
|---|---|---|
| Content | Every edge case, framework docs, full file tree | Commands, conventions, why, boundaries |
| Accuracy | Degrades as file grows (context rot) | Stays sharp — rules get attention |
| Maintenance | Goes stale constantly | Rarely changes |
| What Claude does | Misses key rules under noise | Follows the rules that matter |
| Your job | Still the quality check | Stop being the quality check |
Common pitfalls
The mistakes that turn a good CLAUDE.md into a useless one are predictable. Watch for these.
- Writing it once and never updating it. If you keep correcting Claude on something in chat, that correction belongs in CLAUDE.md. If a rule is obsolete, delete it. The file is a living document, not a setup step you do once.
- Confusing more rules with more control. The founders who get the most out of Claude Code have the shortest CLAUDE.md files. Control comes from clarity, not volume.
- Skipping the boundaries. The "Never do this" section is short but saves you from the worst outcomes: deleted work, committed secrets, rewritten files. Two lines here prevents most disasters.
- Leaving out the commands. If Claude has to guess how to run your app or your tests, it guesses wrong. The commands section is boring and it's the section you'll rely on most, which is exactly the kind of boring, high-leverage work agents are best at. That's the same thesis behind the 3 AI agents to deploy first.
FAQ
Where does the CLAUDE.md file go?
Put CLAUDE.md in the root of your project folder, where Claude Code will read it automatically at the start of each session. You can also keep a personal one in your home directory for preferences that apply across every project.
How long should a CLAUDE.md be?
Aim for under ~200 lines, and most good ones are far shorter than that. The goal is every line earning its place. A lean 30-line file usually beats a bloated 400-line one because context rot degrades accuracy as the file grows.
What's the difference between CLAUDE.md and a prompt?
A prompt fixes one message; CLAUDE.md fixes every message. The prompt is what you type right now, while CLAUDE.md is the standing memory Claude reads every session, so anything you'd otherwise repeat belongs in the file.
Do I need to know how to code to write a CLAUDE.md?
No. CLAUDE.md is plain English in a markdown file. You're writing instructions, not code. Fill in the commands you already run, your naming conventions, and what Claude should never touch, and you're done.
What should I never put in a CLAUDE.md?
Never put secrets or API keys in CLAUDE.md, since it's a plain text file often committed to your repo. Also skip framework documentation, generic best practices, and folder trees Claude can read itself. All of it wastes context.
If you want the copy-paste CLAUDE.md files, Claude Code use cases, and the masterclass that walks through setting all of this up the right way, join the free Claude Community. 7,800+ builders are sorting out exactly this kind of setup together.
About Terrell Gentry
Founder at 6omb
Terrell is the founder of 6omb and runs Claude Community, the #1 Skool community for Voice AI agents. Over 16 months his team has built 100+ AI agent systems delivering $10M+ in business value, including voice agents like Emily, which booked 453 new clients for a law firm in 8 months. He is a Y Combinator Startup School alum (SUS20) and a Gold Retell partner.
You might also like

Why Claude Writes Bad Code (and How to Fix Your Setup)
Claude writes bad code because your setup is broken, not the model. Fix CLAUDE.md, context, plan mode, and verification so Claude stops hallucinating.
How to Set Up Claude Code for Your Business (No Coding Required)
How to set up Claude Code for your business with no coding required: install it, add your context, hand off one real workflow, and stop being the quality check.

Automate, augment, or strategize: how to sort every task in your business for AI
How to sort every task in your business for AI using the automate, augment, or strategize framework, so agents own the boring work and you keep the calls.
Join 10k+ founders going AI-first with Claude
The Claude Masterclass, 50+ copy-paste Claude Code skills, agent-building workshops, and a community actively building the same thing you are. Free for now.
Join the free community