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 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.

Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (

🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
0/M input, $50/M output tokens). The one-time
🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
00 credit applied only to the Fable 5 transition and is not offered for 5.1. Some coding and debugging requests may be answered by an Opus model due to a security classifier (both models). See the Fable 5.1 guide and the Fable 5 availability 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