CLAUDE.md is a plain text file with a special name. When you start Claude Code in a project, it looks for this file and loads it into the conversation before you type anything. Whatever you write there, such as how to run the tests, which folders matter or which colors are allowed, becomes background knowledge for every task.
Think of it as the note you would leave for a new developer on their first day. It saves you from repeating the same instructions in every prompt, and it is the main way to make an AI agent follow your project's habits instead of its own.
How does CLAUDE.md work?
Claude Code reads CLAUDE.md files from several places, so rules can be shared or kept private. According to the official Claude Code memory docs, the main scopes are:
- Project: a CLAUDE.md in the repository root, committed to git and shared with everyone on the team.
- Personal: a CLAUDE.md in your user folder (~/.claude/CLAUDE.md) that applies to all your projects.
- Local: a CLAUDE.local.md in the project for private preferences you keep out of version control.
- Subfolders: a CLAUDE.md inside a folder loads when Claude starts working in that folder.
A CLAUDE.md can also pull in other files with an @ path, for example @brand.md, so you can keep long rules in separate documents and reference them from one place.
What goes in a CLAUDE.md file?
Keep it short and specific. The docs suggest staying under about 200 lines, because every line is read on every task. Useful content includes:
- Commands: how to install, run, test and build the project.
- Conventions: naming, folder structure, which libraries to use and which to avoid.
- Design rules: a pointer to your brand file and tokens, plus a few hard bans such as no purple gradients.
- Gotchas: things Claude cannot work out from the code, like a deploy step that must never be run locally.
CLAUDE.md vs DESIGN.md
CLAUDE.md is the general instruction file for one specific tool, Claude Code. DESIGN.md (or a brand.md) is a dedicated file for visual and brand rules that any agent can read. A common setup keeps the design rules in their own file and adds one or two lines to CLAUDE.md pointing at it. Our guide on how to give Claude Code a brand before it writes code walks through exactly that, with a free template.
How to write a good CLAUDE.md
- Run /init in Claude Code to generate a first draft from your codebase.
- Delete anything Claude could already figure out by reading the code.
- Add the rules it keeps breaking, written as concrete instructions rather than adjectives.
- Move long topics, such as your brand, into separate files and import or reference them.
- Review it whenever the output drifts. It is a living document, not a one-time setup.
Common mistakes
- Vague taste words. "Make it modern and clean" gives the model nothing to check. Exact HEX values and banned patterns do.
- Treating it as enforcement. Claude reads CLAUDE.md as context, not as a linter. Back important rules with code, such as design tokens that only allow your colors.
- No brand to point at. Rules can remove the generic look described in why Claude Code websites look the same, but they cannot invent an identity. If you do not have one yet, the Monstric brand studio creates a name, logo, colors and brand kit you can reference.
