Skip to content
BENIBIX Learn

CLAUDE.md

AI⌨️ Claude CodeClaude Code Concepts

Also known as CLAUDE.md file, Project memory, /init

A file of rules Claude Code reads each time it starts.

Think of it like

It is like a note on the fridge that says how this house works.

Example

Emma's team keeps telling Claude to use their test command. She adds it to CLAUDE.md once, and every session after that uses it.

Why it matters

It is the easy way to stop saying the same thing in every session.

Definition

CLAUDE.md is a plain text file of instructions that Claude Code reads at the start of every session. You write it in Markdown. It can hold your build commands, your style rules and things to avoid. There can be one in your home folder for all projects, one in the project for the team, and more in sub-folders. Claude Code loads them all together. Running /init writes a first version for you by looking at your code.

Example code

markdown
# Project rules
- Run npm test before you commit.
- Use 2 spaces, not tabs.
A short CLAUDE.md with two rules.
Files from three folders, all read in one go.

Common mistake

Writing a very long file. The docs suggest under 200 lines, because long files use up context and get followed less well.

Key takeaways

  1. 1
    Read at every start. Every session.
  2. 2
    Many levels. Home, project, sub-folder.
  3. 3
    Keep it short. Under 200 lines.

Compare

Learn it properly