Back to Learn
Getting Started
5 min read

What is CLAUDE.md and Why You Need It

clauderules.net

The Problem CLAUDE.md Solves

Every time you start a new Claude Code session, Claude has no memory of your previous conversations. It doesn't know your project's naming conventions, your preferred libraries, or the architectural decisions your team made six months ago.

Without CLAUDE.md, you spend the first few minutes of every session re-explaining your stack. You correct the same mistakes repeatedly. Teammates get different behavior from Claude because they haven't set up the same context.

What CLAUDE.md Is

CLAUDE.md is a Markdown file that Claude Code reads automatically at the start of every session. Place it at the root of your project, commit it to git, and every session — for every developer on your team — starts with Claude already knowing your codebase.

CLAUDE.md
# My Project

## Tech Stack
- Next.js 15, TypeScript strict mode
- Prisma + PostgreSQL
- Tailwind CSS

## Rules
- Always use named exports
- Never use `any` type
- Prefer `const` over `let`
- Use Zod for all runtime validation

How Claude Processes It

Claude reads CLAUDE.md before your first message in every session. The contents are injected into Claude's context as a system-level instruction, giving it persistent knowledge of your project without consuming your conversation turns.

You can also have CLAUDE.md files in subdirectories — Claude reads them when it navigates into those directories, enabling per-module rules.

What to Put In It

Focus on project-specific knowledge Claude cannot infer from reading your code:

  • Tech stack and versions
  • Coding conventions and style preferences
  • Common commands (build, test, deploy)
  • Architectural constraints ("never use X")
  • File and directory structure
  • Business domain context
Start with 10–20 lines covering your stack and top 3 conventions. Expand from there as you notice Claude making mistakes you could prevent.