A drop-in CLAUDE.md template with 13 rules that make Claude Code sessions more disciplined: fewer hallucinations, less over-engineering, tighter feedback loops.
Copy CLAUDE.md into one of these locations depending on scope:
# Apply to all your Claude Code sessions (recommended)
cp CLAUDE.md ~/.claude/CLAUDE.md
# Apply to a single project (commit it so your team gets it too)
cp CLAUDE.md ./CLAUDE.mdClaude Code loads CLAUDE.md automatically at the start of every session.
- Think Before Coding — state assumptions, ask when uncertain, stop when confused.
- Simplicity First — minimum code that solves the problem. No speculation.
- Surgical Changes — touch only what you must. Don't drive-by refactor.
- Goal-Driven Execution — define success criteria, loop until verified.
- Use the model only for judgment calls — code answers when code can.
- Token budgets are not advisory — surface the breach, don't silently overrun.
- Surface conflicts, don't average them — pick one pattern and explain why.
- Read before you write — read exports, callers, shared utilities first.
- Tests verify intent, not just behavior — encode the WHY, not the WHAT.
- Checkpoint after every significant step — summarize done / verified / left.
- Match the codebase's conventions — conformance > taste inside the codebase.
- Fail loud — surface uncertainty, never hide skipped work.
- Explore, plan, then execute — read and plan before non-trivial edits.
The first 12 rules came from real-world Claude Code sessions where the model produced plausible-looking work that turned out to be wrong, over-engineered, or silently incomplete. Each rule directly addresses one of those failure modes.
Rule 13 was added after reviewing Anthropic's official Claude Code best practices, which calls out the explore → plan → execute workflow as the highest-leverage habit for non-trivial work.
Treat the file like code: prune what doesn't earn its keep, add what your project actually needs. Anthropic's own guidance: "For each line, ask — would removing this cause Claude to make mistakes? If not, cut it."
A bloated CLAUDE.md is worse than a short one, because Claude starts ignoring rules that get lost in the noise.
MIT