Rules & instructions Official

CLAUDE.md

Markdown files of persistent project, user and org instructions that Claude Code loads at the start of every session.

Author
Anthropic
Works with
Claude Code
Documented
Oct 2, 2026

What CLAUDE.md is

CLAUDE.md files give Claude Code persistent instructions for a project, your personal workflow or your organization. They load at session start as context, not enforced configuration. Rules can be split into .claude/rules/ files, optionally scoped to paths.

What it does

How CLAUDE.md plugs in: which agents run it and what it addsRUNS INYour agentClaude Codeone host documentedRULES · OFFICIALCLAUDE.mdProject instructions the agent re…5 install stepsno extra permissions listedWHAT IT ADDSWhat it doesLoads project instructions from .…Supports user-level ~/.claude/CLA…Supports managed-policy CLAUDE.md…Imports other files with @path/to…agent → extension → new capability · from the official repository or docs
Where CLAUDE.md runs and what it adds, from its documentation
  • Loads project instructions from ./CLAUDE.md or ./.claude/CLAUDE.md, shared via version control
  • Supports user-level ~/.claude/CLAUDE.md and private ./CLAUDE.local.md
  • Supports managed-policy CLAUDE.md for organization-wide instructions
  • Imports other files with @path/to/file syntax (max depth four hops)
  • Splits instructions into .claude/rules/*.md, with optional paths frontmatter for file-scoped rules
  • /init generates a starting CLAUDE.md from the codebase

When to use it

Good fit

  • You re-explain the same build commands or conventions each session
  • A team wants shared coding standards in version control
  • An organization needs company-wide policies applied to all users

Not for

  • Guaranteed enforcement: docs say to use a PreToolUse hook to block actions
  • Multi-step procedures or single-area instructions: use a skill or path-scoped rule

How to install CLAUDE.md

You need: Claude Code

  1. Create ./CLAUDE.md or ./.claude/CLAUDE.md in the project root
  2. Add build/test commands, conventions and project layout, targeting under 200 lines
  3. Or run /init to generate a starting file
  4. Run /context and check the Memory files list to confirm it loaded
  5. Add CLAUDE.local.md to .gitignore for personal preferences
Configuration example (from the official docs)
See @README for project overview and @package.json for available npm commands for this project.

# Additional Instructions
- git workflow @docs/git-instructions.md

Permissions and security

Security notes from the maintainers

  • Treated as context, not enforced configuration; use hooks to guarantee behavior
  • Managed policy CLAUDE.md cannot be excluded by users

Review the source before granting an agent access to credentials or production systems. We document what the maintainers state; we do not audit code.

Limitations

  • Longer files consume more context and reduce adherence; target under 200 lines
  • Contradicting instructions may be resolved arbitrarily
  • Imports do not reduce context cost, imported files also load at launch

Tools it extends

Frequently asked questions

Where can CLAUDE.md files live in Claude Code?

Project: ./CLAUDE.md or ./.claude/CLAUDE.md; user: ~/.claude/CLAUDE.md; local: ./CLAUDE.local.md; managed policy at an OS-specific system path. source

How large should a CLAUDE.md be?

Target under 200 lines per file; longer files reduce adherence. source

Does Claude Code strictly obey CLAUDE.md?

No. It is delivered as context, not enforced configuration; use hooks for must-run behavior. source

How do I exclude a CLAUDE.md in a monorepo?

Use the claudeMdExcludes setting with absolute-path globs; managed policy files cannot be excluded. source

Sources and gaps

Not stated by the maintainers: Repo URL is the Claude Code repo; CLAUDE.md has no separate repository.

More extensions to look at