CLAUDE.md templates that pull their weight.
The difference between an agent that nails your conventions and one that fights them is usually forty lines of markdown. Five templates from our client work: Next.js, Python, monorepo, API service, and a lean starter, each annotated with why every section exists.
Five shapes of project, covered.
| Template | For |
|---|---|
| CLAUDE-starter.md | Any project; the lean baseline everyone should start from |
| CLAUDE-nextjs.md | Next.js App Router apps: server/client boundaries, caching rules, metadata discipline |
| CLAUDE-python.md | Python services: env management, async pitfalls, migration hygiene |
| CLAUDE-monorepo.md | pnpm/Turborepo workspaces, with the nested per-package pattern |
| CLAUDE-api-service.md | Node/TypeScript backends: request lifecycle, boundary validation, forward-only migrations |
Each is fill-in-the-brackets: copy the closest one to your repo root as CLAUDE.md, replace the <angle brackets>, delete what doesn’t apply. Ten minutes, honestly.
Behavior over description.
Most CLAUDE.md files fail the same way: they describe the project instead of directing the agent. Claude can read your file tree; it cannot read your mind. The templates are built on one test applied to every line: would this change what Claude does?
## What doesn't work ## What works
"We use pnpm in this "Package manager is pnpm.
project and prefer Never use npm or yarn."
consistent tooling."
"Typecheck: pnpm typecheck.
"Please try to keep Run it after any multi-file
the code type-safe." change."
"The tests can be a "Tests hit a real local
little tricky to run." Postgres: docker compose up -d
first, or they hang for 60s."The highest-value lines are the gotchas. Every “the dev server caches schema, restart after editing db/” saves a full wasted debugging loop, every session, forever. When Claude does something wrong twice, that is not a prompting problem; that is a missing line in CLAUDE.md.
Monorepos: nest the files.
Claude reads the nearest CLAUDE.md as well as the root one, which is the clean way to keep workspace rules and package rules separate:
repo/
├── CLAUDE.md ← workspace rules (this pack's monorepo template)
├── apps/
│ └── web/
│ └── CLAUDE.md ← web-app-specific rules (nextjs template)
└── packages/
└── ui/
└── CLAUDE.md ← component-library rulesThe monorepo template is written for exactly this split: cross-package rules at the root (workspace commands, import boundaries, codegen), app-specific rules next to the app.
Common questions.
01What is CLAUDE.md?
A markdown file at your repo root that Claude Code reads automatically at the start of every session in that repo. It is where you put the things Claude cannot learn from the code itself: which commands to run, which rules are non-negotiable, which landmines waste an hour. Think of it as onboarding notes for a very fast new teammate with no institutional memory.
02Where does the CLAUDE.md file go?
Repo root, next to package.json, committed to git so your whole team (and their agents) share it. Two supplements: ~/.claude/CLAUDE.md applies to every project you open (personal preferences), and nested CLAUDE.md files in subdirectories apply when Claude works in that part of a monorepo.
03What should I put in CLAUDE.md?
Four things, in order of value: exact commands (build, test, lint, with real script names), non-negotiables (never/always rules like "never use npm here"), conventions that differ from ecosystem defaults, and gotchas that waste time (the cache that needs flushing, the test suite that needs Docker). Leave out anything Claude can read from the file tree; describing your folder structure is decoration.
04How long should a CLAUDE.md be?
Short. The file loads into every session, so every line costs attention, and attention on line 180 is attention not spent on your actual request. Forty sharp lines outperform two hundred mushy ones. Our rule: if a line would not change what Claude does, cut it.
05What is the difference between CLAUDE.md and AGENTS.md?
AGENTS.md is the emerging cross-tool convention supported by multiple coding agents; CLAUDE.md is Claude Code’s native file. They serve the same purpose, and a common setup is one AGENTS.md with the real content and a CLAUDE.md that just imports it with a single @AGENTS.md line, so every agent reads the same rules.
- Claude Code skills packTen ready-made skills, plus the install and activation guide people actually search for.Free · 10 skills
- Claude Code hooks packEight production-grade hooks with the missing documentation: events, stdin payloads, exit codes.Free · 8 hooks
- Claude Code subagents packSix specialist subagents, with the frontmatter reference and delegation patterns explained.Free · 6 subagents
- Claude Code statuslineA one-file statusline showing model, git branch, context left and session cost. Paste, done.Free · 1 script
Want your whole agent setup done right?
A sharp CLAUDE.md is step one. Hooks that enforce the rules, skills that encode the workflows, agents that know the architecture: that is the full setup we build for teams shipping with Claude. techpotions is a small studio; you talk to the people who build.