CLAUDE.md Template

A Claude Code project instruction file: context, commands, style, and the accumulated gotchas that make sessions start smart. Copy it below, fill the bracketed fields, delete what you don't need.

claude-md.md
# CLAUDE.md

## Project context
[What this project is, who uses it, what must not break.]

## Commands
- Test: `[command]`
- Build: `[command]`
- Run locally: `[command]` (port [PORT], never [WRONG_PORT])

## Code style
- [The rules that matter and are not machine-enforced]

## Workflow rules
- [e.g. Write the failing test first for any bugfix]
- [e.g. Never commit directly to main]

## Gotchas
- [Environment quirk and its workaround]
- [Dependency or tooling trap discovered the hard way]

## Decisions log
- [Date] - [Decision and the one-line reason]

Field notes

FieldWhy it matters
GotchasThe section that appreciates in value. Every hard-won environment fact recorded here is a mistake no future session repeats.
Decisions logDated one-liners beat prose. Agents (and humans) need the what and the why, not the meeting minutes.
CommandsState the wrong answer as well as the right one where confusion is common: 'port 4242, never 3000' outperforms 'port 4242.'

Go deeper