CLAUDE.md + Inheritance

Persistent instructions that travel with your repo — three levels deep.

What CLAUDE.md does

  • Tells Claude about your project before you say a word
  • Defines coding conventions, architecture, constraints
  • Specifies forbidden actions and required practices
  • Loaded automatically when Claude enters the directory
  • Shared with the team via git — everyone benefits

The three-level hierarchy

PathScopeShared?
~/.claude/CLAUDE.mdPersonal global — your style and conventionsNo
./CLAUDE.mdProject root — architecture, deploy rulesYes (via git)
./modules/auth/CLAUDE.mdNested directory — module overridesYes (via git); closer files win

Think CSS specificity

Claude merges all three levels. Global is the base, project overrides global, directory overrides project. Keep the root CLAUDE.md under ~5K tokens to protect your context budget.

Where to go next