CLAUDE.md explained
What is CLAUDE.md?
CLAUDE.md is a Markdown file that gives Claude Code persistent project instructions, workflow preferences, and context.
CLAUDE.md meaning
`CLAUDE.md` is used by Claude Code as a memory and instruction file. Anthropic describes these as Markdown files that give Claude persistent instructions for a project, a personal workflow, or an organization. When you start a Claude Code session, the file is loaded automatically, so the assistant begins each session already knowing your context, conventions, and rules.
There are different levels of CLAUDE.md. A project file lives at the repository root and is shared with the team through Git. A personal file applies to your own workflow across projects. This layered memory means you do not have to re-explain the same setup, style, and safety rules every time.
What to put in CLAUDE.md
Keep it focused on what helps Claude act correctly:
- Project overview and goals
- Commands for setup, tests, lint, and build
- Preferred coding style and naming conventions
- Architecture notes and important file paths
- Review rules, commit conventions, and safety constraints
- Things to never do (touch generated files, push to main, expose secrets)
- Links to DESIGN.md, API docs, or other project notes
A short CLAUDE.md example
# CLAUDE.md
## Project
Next.js app for invoicing. Source in `src/`.
## Commands
- Install: `pnpm install`
- Test: `pnpm test`
- Build: `pnpm build`
## Style
- TypeScript, functional components
- Keep PRs small and focused
## Rules
- Never edit files in `generated/`
- Run tests before claiming a task is done CLAUDE.md vs AGENTS.md
AGENTS.md is a broader convention for coding agents. CLAUDE.md is Claude-specific. If you use multiple AI coding tools, keep shared instructions in AGENTS.md and Claude-only preferences in CLAUDE.md. Compare it with GEMINI.md and Copilot instructions in the AI agent instruction files guide.
How CLAUDE.md helps AI coding
A good CLAUDE.md reduces repeated explanations. It tells the assistant how to run the project, what files matter, how to verify changes, and what style to follow. That can make AI-assisted work faster and more consistent.
Preview CLAUDE.md before using it
Use Markdown Docs online editor to preview headings, command blocks, and lists. For local projects, install Markdown Docs and open CLAUDE.md directly from Windows.
Related references
- Anthropic Claude Code memory docs for CLAUDE.md behavior.
- Claude Code overview for Claude Code context.
FAQ
Is CLAUDE.md only for Claude Code?
Yes, CLAUDE.md is most closely associated with Claude Code. Other tools may not read it unless they explicitly support that convention.
Can I have both CLAUDE.md and AGENTS.md?
Yes. Many teams can use AGENTS.md for shared agent rules and CLAUDE.md for Claude-specific context or preferences.
Should CLAUDE.md be short?
Usually yes. Keep it focused and link to deeper Markdown files for long architecture, design, or process notes.