CLAUDE.md
CLAUDE.md is a Markdown file of persistent instructions that Claude Code loads automatically at the start of every session. It usually sits in the project's root folder and holds the key commands, style rules and things Claude must not do. You can also keep a personal one in ~/.claude/CLAUDE.md that applies to all your projects. Claude treats its contents as instructions to follow, not as enforced rules.
A text file that Claude reads at the start of every session. It’s like an instruction sheet stuck on the fridge for a new colleague.
How it shows up in Claude Code
Claude doesn't remember yesterday's conversations: every session starts with an empty working memory. CLAUDE.md is how you hand it, every time, what it needs to know about the project. The /init command explores the project and writes a first CLAUDE.md, which you then trim and correct. The docs recommend keeping each file under 200 lines: a long file takes up room in the context and gets followed less reliably.
The files add up rather than replace each other: your personal one, the project one, and CLAUDE.local.md, your private notes for this project, which your teammates never see. The /memory command opens them for editing.
Example
A short CLAUDE.md for a website:
# Commands
- npm run dev starts the site
- npm test runs the tests
# Rules
- All page copy is in plain English.
- Never edit the .env file.
With this file, Claude knows from the first message how to start the site and what it must not touch, without you repeating it.
Common mistakes
- Writing too much: project history, long explanations, things obvious from the code. Every line is read at every start.
- Relying on it for hard bans. CLAUDE.md is an instruction; anything that must be blocked for sure belongs in permissions or a hook.
- Writing it once and never updating it when the commands change.
Related terms and where you learn it
Rules that apply only to some files go in .claude/rules/. For a recipe you only need now and then, a skill fits better. It's all covered in the lesson “What is CLAUDE.md?” in module 02 · CLAUDE.md: your project's memory.
How it appears in the course
CLAUDE.md is a text file with instructions about the project.
Introduction · Module 02, CLAUDE.md: your project’s memory
CLAUDE.md is your sheet on the fridge, for Claude.
What is CLAUDE.md? · Module 02, CLAUDE.md: your project’s memory
The organization one lives in /etc/claude-code/CLAUDE.md on Linux, and in /Library/Application Support/ClaudeCode/CLAUDE.md on macOS.
Where can CLAUDE.md live? · Module 02, CLAUDE.md: your project’s memory
Learn Claude Code from zero, in plain English
12 modules with 1–2 minute lessons, which you can also do on your phone. The first two modules are free.