Back to Guides
How-To

How to Create a CLAUDE.md That Claude Actually Reads

CLAUDE.md takes 20 minutes to set up and saves hours every week. Here is exactly how to do it right.

Last updated: 2026-07-01

What CLAUDE.md is

CLAUDE.md is a Markdown file that Claude Code reads automatically at the start of every session. It is your project's onboarding document for Claude -it tells Claude your tech stack, folder structure, coding conventions, and rules before any code is written. There is no setup required: just create the file and Claude will read it.

Where to put it

Put CLAUDE.md at the root of your repository. Claude reads it automatically. You can also put CLAUDE.md files in subdirectories -Claude reads them when working in that directory. This is useful for monorepos where the backend and frontend have different conventions.

What to include (and what to skip)

Include: tech stack, folder structure, key conventions (exports, naming, typing), what Claude must never do, and how to run tests. Skip: general programming advice Claude already knows, copy-pasted documentation from libraries, and anything longer than about 300 lines. Longer files get partially deprioritized. Concise, concrete, specific beats exhaustive.

Minimal effective CLAUDE.md

This template covers the essentials in under 100 lines.

CLAUDE.md
# Project Overview
[One paragraph describing what this project is and does.]

## Stack
- Framework: [Next.js 16 App Router / React 19 / etc.]
- Language: TypeScript (strict)
- Styling: [Tailwind CSS v4 / CSS Modules / etc.]
- State: [Zustand / Context / React Query]
- Testing: [Vitest + React Testing Library]

## Folder Structure
src/
├── app/        # [Routes only / Pages]
├── components/ # Shared UI components
├── hooks/      # Custom React hooks
├── lib/        # Server utilities (server-only)
├── types/      # Global TypeScript types
└── utils/      # Pure helper functions

## Key Rules
1. Named exports only -never default export a component.
2. No `any` in TypeScript -use `unknown` and narrow.
3. [Framework-specific rule, e.g.: "Server Components are default -add 'use client' only when needed"]
4. One component per file -file name is kebab-case.
5. Booleans prefixed isX / hasX / canX.

## Never Do
- [Your most commonly violated rule]
- [Another frequent violation]

## Run Tests
```bash
npm run test
```

How to test that Claude is reading it

Start a fresh Claude Code session and ask: "Summarize the most important rules from my CLAUDE.md." Claude should be able to list your key rules. Then ask it to write a small component and check each convention. If Claude can't summarize your rules or still violates them, your file is too long, too vague, or the rules aren't specific enough -add concrete examples.

Generate your CLAUDE.md automatically

standarx generates a complete CLAUDE.md for your stack -with all the right conventions, formatted for maximum Claude compliance.

Generate my rules file