Skip to main content

CLAUDE.md Templates — Copy-Paste Sections and Examples

Copy-paste CLAUDE.md templates plus the essential 6 sections, advanced patterns, and common mistakes. (The full memory system and features are covered in the separate complete guide.)

🌐 This article was machine-translated and may contain inaccuracies. Read the Korean original if in doubt.

CLAUDE.md is a project-context file that Claude Code reads automatically at the start of every session. It tells Claude things it can't infer from code alone — build commands, code style, workflow rules — so Claude works the way your project expects. This article covers the principles and a ready-to-copy template. (Check the official docs for exact behavior.)

🟢 Model references match the current lineup · model notice · Fable subscription
🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5.5 / Claude Haiku 5.5 (higher tier: Claude Fable 5.2). This notice changes only when Anthropic ships a new model.

Fable subscription (updated November 17, 2026): Claude Fable 5.2, released November 9, 2026, is the current Fable model; Fable 5.1 and Fable 5 are now legacy. Plan terms are the same for all three — Max and Ultra plans and premium seats on Team and seat-based Enterprise plans include Fable at up to 50% of the weekly usage limit; Pro plans and standard seats use usage credits (not available on Free). API pricing is $8/M input and $40/M output tokens for Fable 5.2, and $10/$50 for Fable 5.1 and 5. Some cybersecurity and biology requests may be answered by an Opus model due to safety classifiers. See the Fable 5.2 launch news and the Fable 5.2 guide for details.

CLAUDE.md: 6 essential sections CLAUDE.md # 1. Project overview # 2. Tech stack # 3. Directory structure # 4. Coding conventions # 5. Data model & API # 6. Common commands Place in project root; auto-loaded each session. ~300-800 lines.

Where it goes

Usually at the project root, named CLAUDE.md, in markdown format. We recommend running /init to generate a starter based on your current project structure, then refining it.

Writing principles

  • Keep it short and concise: it loads in full every session, so a long file buries the rules that matter. For each line, ask: "Would removing this cause Claude to make a mistake?" If not, cut it.
  • Be specific: instead of "write clean code" (aspirational), write "server components by default; add 'use client' only when truly needed" (testable).
  • Explain the why: stating the reason behind a rule helps Claude judge edge cases.
  • Use emphasis: marking must-follow items with "IMPORTANT" or "YOU MUST" improves adherence.

CLAUDE.md is advisory — Claude is said to follow it about 80% of the time. For things that must be enforced every time without exception (formatting, linting, security checks), use a hook rather than CLAUDE.md. Also, for domain knowledge or workflows needed only sometimes, prefer skills (loaded on demand) over bloating every conversation via CLAUDE.md.

What to include

  • Build/test commands (e.g., npm run build, how to run a single test)
  • Code style (e.g., import style, naming conventions)
  • Workflow rules (e.g., typecheck after changes, commit conventions)
  • Project structure / architecture decisions that aren't obvious from code
  • Gotchas

Conversely, don't include what's already in the README or package.json, anything that changes weekly, or things Claude already does well on its own (that's just noise).

Ready-to-copy starter template

Here's a starting point for a general web project. Trim and adapt it to your project.

# Project overview
[One or two sentences: what the project does, core stack]

# Commands
- Dev server: [e.g., npm run dev]
- Build: [e.g., npm run build]
- Typecheck: [e.g., npm run typecheck]
- Test (single): [e.g., npm test -- path/to/test]  # prefer single tests over the whole suite

# Code style
- [e.g., Use ES modules (import/export), not CommonJS (require)]
- [e.g., Server components by default; add 'use client' only when truly needed]

# Workflow
- IMPORTANT: always typecheck after finishing a set of changes
- [e.g., commit messages in English, separate commits per file]

# Gotchas
- [Pitfalls you can't see from the code, with the reason why]
How CLAUDE.md works1. Place fileproject root2. Auto-loadAt session start,it reads itself3. Apply rulesin the background, to all workProject rules are passed automatically, without re-explaining · as of 2026.6

Operating tips

Treat CLAUDE.md like code — version it, review it when things go wrong, and prune it regularly. After adding a rule, check in a fresh session whether Claude's behavior actually changes. If Claude asks questions already answered in CLAUDE.md, the wording is probably ambiguous; if it ignores a rule, the file may be too long and the rule is getting lost.

For the concept overview, see the complete CLAUDE.md guide.

Once you know how to write it, grab paste-ready web/data/docs/monorepo examples in CLAUDE.md examples by project type.

This article is for general guidance only. Claude Code's features and behavior may change by version. Check the official docs (code.claude.com/docs) for the latest recommendations.

New here?: What Is CLAUDE.md? (beginner)

Was this helpful?

Keep reading