Lean CLAUDE.md template (under 200 lines)

A short CLAUDE.md starter that follows Anthropic's guidance: commands, workflow, project rules and security, well under the 200-line target.

· By Codema Editorial

Free account required

Anthropic recommends keeping each CLAUDE.md under 200 lines. Longer files use more context and get followed less. This one is under 50.

Preview: CLAUDE.md

## Commands

- Dev: `[npm run dev]`
- Build: `[npm run build]`
- Test one file: `[npm test -- path/to/file.test.ts]`
- Lint and types: `[npm run lint && npx tsc --noEmit]`

## Workflow

- Plan first for anything touching more than three files. Show the plan before editing.
- Prefer running single tests over the whole suite.
- After a series of changes, run the type check and lint, and paste the real output.
- Keep diffs small. Don't refactor code you weren't asked to touch.

## Project rules Claude can't guess

- [Example: API handlers live in `app/api/`; use the error helper in `lib/errors.ts`.]
- [Example: Dates are stored in UTC and shown in the user's time zone.]
- [Example: Never edit an applied migration in `supabase/migrations/`; add a new one.]

## Security

What's inside

  • Commands, workflow, project rules, security, gotchas
  • An @AGENTS.md import line, so it works alongside AGENTS.md
  • Maintainer notes in HTML comments, which Claude Code strips before loading

How to use it

  1. Save as CLAUDE.md in your repo root.
  2. No AGENTS.md? Delete the @AGENTS.md line.
  3. Replace every [bracket].
  4. Move long, occasional procedures into skills.

Who it's for

Claude Code users whose CLAUDE.md has grown too long, or who are starting fresh.

Keep reading

Keep reading

Newsletter

The Codema publication. Consent is required. You are not subscribed until you confirm from the email, and nothing is stored if email delivery is not connected.