Without project-level instructions, Claude Code:
- Generates code that doesn't match your style conventions
- Uses packages or APIs you don't want in your project
- Makes architectural decisions that conflict with your design
- Loses context between sessions — you repeat the same instructions
CLAUDE.md is a configuration file that Claude Code reads at the start of every session. It acts as persistent project memory.
- Project overview — what this project does, in 1-2 sentences
- Tech stack — framework, language, package manager
- Commands — how to build, test, lint, and run
- Prohibited actions — things Claude should never do
- File structure — where components, utils, and configs live
- Coding standards — naming conventions, patterns to follow
- Session workflow — what to read first, what to check before committing
- Model assignment — which AI models handle which tasks
- Pipeline phases — multi-step workflows with approval gates
- Rules files —
.claude/rules/*.mdfor topic-specific guidelines
- Be specific. "Write clean code" is useless. "Use named exports, no default exports" is actionable.
- Include the why. Rules without reasons get ignored when they seem inconvenient.
- Keep it current. Outdated instructions are worse than no instructions.
- Layer your config. Use CLAUDE.md for essentials,
.claude/rules/for detailed topic rules.
Claude Code reads instructions from multiple levels:
~/.claude/CLAUDE.md # User-level (your personal preferences)
project/CLAUDE.md # Project-level (shared with team)
project/.claude/rules/*.md # Topic-specific rules (auto-loaded)
project/.claude/settings.json # Permissions and tool access
project/.claude/commands/*.md # Custom slash commands
Project-level files override user-level. Rules files are always loaded alongside CLAUDE.md.
A tech blog (32blog.com) uses this structure to manage 120+ articles across 3 languages:
CLAUDE.md— project overview, tech stack, session workflow.claude/rules/article-pipeline.md— 7-phase content pipeline with model assignments.claude/rules/token-saving.md— context window optimization.claude/commands/review.md— code review slash command.claude/settings.json— safe permission defaults
The result: consistent quality across sessions, even when context is lost.