Launch offer: the first 1,000 users get Settl free for a year* Claim your spot
settlbuilding in public

The CLAUDE.md starter template + exactly what to put in it

Claude starts every session knowing nothing about your project: not your stack, not your test command, not the gotcha that burned you last Tuesday. I build Settl, an expense-splitting app, solo with Claude, and a single file at the repo root killed most of the corrections I used to retype every session. Here is that file, a template to steal, and the habit that makes it compound.

Why one file fixes the amnesia

The mistake people make is treating it as documentation. It is not documentation. It is a briefing. A briefing is short, current, and ruthlessly practical.

The starter template

Copy this into CLAUDE.md at your repo root and replace the specifics:

# myapp

Expense tracker for freelancers. Node API + React web client.

<!-- Claude reads this file automatically every session.
     Rule of thumb: if you have typed a correction twice, it belongs here. -->

## Stack

- Node 22, TypeScript strict mode, Express 5
- React 19 + Vite, code in src/web/
- Postgres 16 via Drizzle ORM, migrations in drizzle/
- Vitest for unit tests, Playwright for e2e

## Commands

- Dev: `npm run dev` (API on :3000, web on :5173)
- Unit tests: `npm test`
- E2E: `npm run test:e2e` (needs the dev server running)
- Typecheck: `npm run typecheck` (CI runs this; green tests alone are not green)
- DB migrate: `npm run db:migrate`

## Conventions

- Named exports only, no default exports.
- One route handler per file in src/api/<resource>/.
- Every request body gets a Zod schema, defined next to the handler.
- Errors: throw AppError from src/lib/errors.ts, never raw strings.
- Ask before adding any new dependency.

## Gotchas

- `npm test` does NOT typecheck. Run both before calling anything done.
- The dev database reseeds on restart. Never verify persistence against it.
- The auth middleware skips OPTIONS requests. CORS bugs usually live there.

That is the whole thing. Under 40 lines, ten seconds to read, and it front-loads exactly what a sharp new hire would need on day one.

What each section earns you

Stack. Versions and locations. "React" is not enough when React 19 changed how refs work. "Code in src/web/" saves Claude a search on every single task.

Commands. The exact commands with flags. If Claude guesses npm start and your project uses npm run dev, you lose a round trip. If CI runs a stricter build than your local script, say so here or you will keep shipping "worked locally" bugs.

Conventions. Only rules you actually enforce. Three to six is right. Twenty is a style guide nobody reads, and the important rules drown in the trivial ones.

Gotchas. The highest-value section in the file. Each of those three example lines encodes an afternoon somebody lost once. Write yours down so nobody, human or model, loses that afternoon again.

The habit that makes it compound

Every time Claude gets something wrong about your project, add one line.

One line per mistake, added in the same session the mistake happened. After a month you have a file that preempts your project's greatest hits. That is the compounding part: the file gets sharper exactly at the spots where your project is confusing.

What NOT to put in it

Keep the whole file under about 60 lines. When it grows past that, prune it like a briefing: keep what prevents mistakes, cut what merely describes.

Run this on your codebase

Paste this into a Claude session at your repo root:

Read this repo and draft a CLAUDE.md at the root. Keep it under 60 lines.

Include:
- a one-line description of what the project is
- the stack with versions and where the code lives
- the exact commands for dev server, tests, typecheck, lint, and DB tasks
  (verify these against package.json / Makefile / CI config, do not guess)
- 3 to 5 conventions you can infer from the existing code
- a Gotchas section: look for test commands that skip checks CI runs,
  environment quirks in setup scripts, and places where the README
  contradicts the actual code

No secrets, no changelog, no philosophy. Show me the draft before writing
the file.

Get the next one in your inbox