If how to write CLAUDE.md covers "what and how to write," this post is a set of ready-to-paste, complete examples by project type. Don't leave them as-is — always adapt them to your own project. (Official memory docs: docs.claude.com · as of June 2026)
Before you use these
- Only what's unique — instead of generic advice like "write clean code," capture rules specific to this project.
- Keep it concise — longer files consume more context and can reduce adherence (the official docs warn against overly long files).
- Replace placeholders — every
<...>below is a placeholder.
Web app project
# Project: <name>
## Overview
- Stack: <e.g. Next.js, TypeScript, Tailwind>
- Structure: <key directories>
## Rules
- Components: <e.g. functional + explicit prop types>
- State: <e.g. prefer server components, minimal global state>
## Commands
- Dev: <actual dev command>
- Build/test: <actual commands>
## Watch out
- Secrets via env vars only; never in code/commits
- <project-specific pitfall>
Data / ML project
# Project: <name>
## Overview
- Goal: <what you analyze/train>
- Data location: <path or store>
## Rules
- Reproducibility: fix seeds, pin env/versions
- Experiment logging: <where and how>
- Never commit large/sensitive data
## Commands
- Setup: <actual command>
- Train/eval: <actual command>
Docs / content project
# Project: <name>
## Style
- Tone: <e.g. friendly, polite>
- Length/format: <e.g. 2-3 sentence paragraphs, minimal bullets>
## Terminology
- Always: <e.g. "user" (yes) / "u" (no)>
- Avoid: <e.g. overstated/absolute claims>
## Process
- Pre-publish checks: <checklist>
Monorepo: root + subfolders
In a monorepo, put shared rules at the root and component-specific rules in subfolders. Per the official docs, Claude Code loads all CLAUDE.md files walking up from your location (ancestors) at startup, loads a subfolder's CLAUDE.md when you work with files there (lazy), and does not load sibling folders' files unrelated to your work.
monorepo/
├── CLAUDE.md # shared (coding standards, commit rules) — always loaded
├── frontend/
│ └── CLAUDE.md # frontend-only — loads when working in frontend
└── backend/
└── CLAUDE.md # backend-only — loads when working in backend
Refining further
To avoid duplication, import existing docs with @path (e.g. @README.md). Imported files also load at startup, so keep only what every session truly needs. The location hierarchy (project ./CLAUDE.md, user ~/.claude/CLAUDE.md, etc.) and mechanics are covered in how to write CLAUDE.md and the complete CLAUDE.md guide.
Related guides
New to Claude Code itself? See what Claude Code is and how to use it.
These examples are only a starting point and must be adapted to your project. Loading behavior, locations, and syntax may change, so verify against the official docs (docs.claude.com). This site is not an official Anthropic site.