One file controls how smart Claude Code actually is, and most people set it up completely wrong. Here are five tips to build your CLAUDE.md the right way, including the one almost everyone skips.
Why This One File Matters
Claude Code can read every file in your project, but it doesn't read them all at once, and it shouldn't. The thing that decides what it pays attention to is a single file at the root of your project called CLAUDE.md.
This is the one file Claude reads automatically, every single session, before you've typed anything. Get it right and Claude shows up already knowing how your project works. Get it wrong, or leave it empty, and you spend the first ten minutes of every session re-explaining the same things. Here are five tips to build it right.
Tip 1
Know What It Actually Is
Your CLAUDE.md is the table of contents for your project. You might have hundreds of files, but this is the index Claude reads first to know where everything lives and how you like things done.
So it's not a place to dump everything. It's a map that points to everything else. Think build commands, your folder layout, your conventions, and short pointers to the deeper docs. A good CLAUDE.md doesn't try to hold all the detail. It tells Claude where the detail is.
Tip 2
Don't Write It From Scratch
This is where people freeze, staring at a blank file. You don't have to write it yourself. Claude Code can write the first draft for you.
Open your project in Claude Code and run the slash command /init. It reads through your project and generates a starter CLAUDE.md based on what it actually finds: your stack, your scripts, your structure. Thirty seconds, and you go from a blank file to a real draft.
Run this in your project
/init
Tip 3
Treat The Starter As A Draft
The /init output is a starting point, not gospel. Read it yourself. Claude guessed at some things, and it won't know the unwritten rules in your head.
Go through it line by line. Fix anything wrong, delete anything generic, and add the stuff Claude couldn't know, like "always run the tests before committing" or "never touch the files in /legacy." Then keep updating it over time as your project changes. The best CLAUDE.md files are owned and reviewed like code, not written once and forgotten.
Tip 4
Give Claude A Map
The single highest-value thing you can add is a quick summary of the project plus a simple folder tree showing where the important stuff lives. Now Claude knows exactly where to look instead of digging around blind, which wastes time and tokens.
Paste a block like this into your CLAUDE.md
# Project: [your project name] What it is: [one or two sentences on what this project does] ## Commands - Install: [e.g. npm install] - Run: [e.g. npm run dev] - Test: [e.g. npm test] - Build: [e.g. npm run build] ## Where things live - src/components/ UI components - src/lib/ shared helpers and utilities - src/api/ API routes and handlers - data/ config and seed data - tests/ test files ## Rules - Run the tests before committing. - Match the style of the file you're editing. - Don't touch anything in /legacy. ## Deeper docs (read when relevant) - Architecture notes: docs/architecture.md - Deploy steps: docs/deploy.md
Swap in your real folders and commands. Even this much turns Claude from guessing into navigating.
Tip 5
Keep It Under 200 Lines
This is the one almost everyone skips. Because this file loads into every session, a bloated CLAUDE.md actually backfires. When it gets too long, the important instructions get diluted, and Claude pays less attention to what really matters.
Keep it lean. Anthropic's own rule of thumb is under 200 lines. If a section is getting long, move the detail into a separate doc and leave a one-line pointer to it in CLAUDE.md. Remember tip one: this is a table of contents, not the whole book. Lean is more productive, every time.
The 30-second test
Open your CLAUDE.md and ask: could a brand-new teammate read this in two minutes and know how to work in my project? If yes, Claude can too. If it's empty, or 400 lines of noise, that's exactly why Claude keeps missing the obvious.
Already have a CLAUDE.md and not sure if it's any good? Paste this prompt into Claude Code and let it grade and tighten the file for you.
Copy-paste prompt
Read my CLAUDE.md and review it like a senior engineer. 1. Is it acting as a clear table of contents, or is it trying to hold too much detail itself? 2. Flag anything inaccurate or out of date vs. the actual project. 3. Flag anything generic that adds no real signal. 4. Is there a project summary and a folder map? If not, draft one from what you see in the repo. 5. Is it over 200 lines? If so, tell me exactly what to move into separate docs and leave as a pointer. Then give me a rewritten, leaner version I can paste in.
That's the whole playbook. Set this one file up properly and everything else in Claude Code gets easier, because it finally knows where it is and how you work.
If you want to read more about CLAUDE.md files, check it out here.
The Only AI Masterclass You Need
If this guide helped, but you’re looking to go deeper, I got you!! My 30-Day Challenge takes you from saving AI tips you never use to actually building with AI, step-by-step.
I show you exactly how I automated two e-commerce brands, my social media, and most of my personal life, then hand you the agents, workflows & systems to do the same. I’m teaching you every single thing I know with one lesson and one build a day.
Join the AI Masterclass →© 2026 Mariah Brunner. All rights reserved.