CLAUDE.md
What is CLAUDE.md?
Section titled “What is CLAUDE.md?”CLAUDE.md is a Markdown file that provides persistent memory and project-specific instructions to Claude Code. It’s read automatically at the start of every conversation.
Owner: Anthropic Used by: Claude Code exclusively
How It Works
Section titled “How It Works”Claude Code looks for CLAUDE.md files in a hierarchy:
- Global:
~/.claude/CLAUDE.md— applies to all projects - Project root:
./CLAUDE.md— project-specific - Subdirectory:
./src/CLAUDE.md— directory-specific overrides
Template
Section titled “Template”## Project OverviewBrief description of what this project does.
## Commands- `npm install` — Install dependencies- `npm run dev` — Start development server- `npm test` — Run test suite
## Architecture- `/src/app/` — Next.js App Router pages- `/src/components/` — Shared React components- `/src/lib/` — Business logic and utilities
## Coding Conventions- TypeScript strict mode, no `any`- Functional components with hooks- Server components by defaultCLAUDE.md vs AGENTS.md
Section titled “CLAUDE.md vs AGENTS.md”| Aspect | CLAUDE.md | AGENTS.md |
|---|---|---|
| Audience | Claude Code only | All agents |
| Hierarchy | Global + Project + Dir | Project + Dir |
| Best for | Claude-specific tweaks | Universal context |
Best practice: Use both. AGENTS.md for universal instructions, CLAUDE.md for Claude-specific tweaks.