Page languageFrançaisEnglish
Teacher area
Laurent PoupetClaude trainer and artificial intelligence architectStudent area

Category · Method and documentation

What is CLAUDE.md?

CLAUDE.md is the instruction file Claude Code reads at the start of every session, with the project’s commands, conventions and structure. Claude reads it as context, not as an absolute rule. Keep it short, under 200 lines.

By , Claude trainer and artificial intelligence architect · Updated

How it works

  • At launch, Claude Code reads the CLAUDE.md files of the working folder and its parents, and those of subfolders when it touches a file there. These files add up instead of replacing each other.
  • The documentation recommends fewer than 200 lines per file, because a long file uses up context and is followed less well. The rest goes into path-specific rules or into skills loaded on demand.
  • An @path import includes another file, and since version 2.1.277 Claude Code reads an AGENTS.md when there is no CLAUDE.md in the working folder or above, so the same rules can be shared with other assistants.

The trap to avoid

The trap is writing a prohibition there that must always hold. Claude reads it as context, so a firm rule goes through a hook or through the organization’s managed settings.

A concrete example

At the root of the project, a thirty-line CLAUDE.md says: the command that runs the tests, “never add a dependency without approval”, the database in use and where the pages live. At every new session, Claude Code reads it before starting: you no longer repeat those instructions, and everyone working on the project shares the same ones.

What is the difference with an agent skill?

CriterionCLAUDE.mdan agent skill
When it is readAt every session, in fullOnly when the task calls for it
ContentThe project’s rules and landmarksA method for one kind of task
Recommended sizeShort, under 200 linesLonger, loaded on demand

Related terms

Where this is taught

Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.

See the full program

Sources

All glossary terms

Trial lesson · 30 min · $20

Book (new tab)