Claude Code instructions
CLAUDE.md Template
Copy a concise CLAUDE.md template for Claude Code with project commands, architecture, working rules, verification, imports, and context guidance.
Use this for project facts and instructions Claude Code should receive in every relevant session, especially commands, architecture, conventions, and recurring corrections.
Full version
Copy the CLAUDE.md template
Replace every bracketed value and delete any rule you cannot verify in the repository.
# Project Instructions
## Project Overview
[One sentence describing the product and primary runtime.]
## Commands
- Install: `[exact command]`
- Develop: `[exact command]`
- Focused test: `[exact command]`
- Full test: `[exact command]`
- Lint: `[exact command]`
- Type-check: `[exact command]`
- Build: `[exact command]`
## Architecture
- `[path]`: [responsibility and boundary]
- `[path]`: [responsibility and boundary]
- Source of truth for [domain]: `[path]`
## Claude Code Working Agreement
- Explain material assumptions when repository evidence is incomplete.
- Read the nearest implementation and tests before introducing a pattern.
- Preserve unrelated changes and do not rewrite files outside the task.
- Ask before deployments, migrations, destructive operations, or external writes.
- Never read, print, or commit secrets unless the task explicitly requires an approved secret workflow.
## Validation
- Add or update tests when behavior changes.
- Run focused checks while iterating and the required full checks before handoff.
- Report exact commands, outcomes, skipped checks, and remaining risks.
## Optional Shared Instructions
<!-- If AGENTS.md is the shared source, remove this comment and uncomment the next line. -->
<!-- @AGENTS.md -->Do not copy blindly: Do not put secrets, temporary task details, long procedures, or rules that must be technically enforced in CLAUDE.md.
Minimal version
Start smaller when the repository is simple
# Project Instructions
## Commands
- Test: `[exact command]`
- Lint: `[exact command]`
- Build: `[exact command]`
## Architecture
- `[path]`: [responsibility]
- `[path]`: [responsibility]
## Working Agreement
- Inspect existing patterns before editing.
- Keep the diff within the requested scope.
- Never expose or commit secrets.
- Run relevant checks and report their exact results.Customize each field
Project Overview
Keep this to one concrete sentence; Claude can inspect the README for the rest.
Commands
Use exact, verified commands. Include focused-test syntax because agents iterate more efficiently with narrow feedback.
Imports
Use `@AGENTS.md` when shared cross-agent rules already live there; avoid duplicating rules that can drift.
Working Agreement
Record recurring repository-specific corrections, not preferences that belong only to one user.
Validate the instructions
- Save as `CLAUDE.md` or `.claude/CLAUDE.md` at the project root.
- Start a new Claude Code session and run `/context` to confirm the file loaded.
- Ask Claude to list project commands and risky areas without editing files.
- Test one measurable instruction with a small task.
- Keep the file concise; move path-specific guidance into `.claude/rules/` when it grows.
Common mistakes
Using CLAUDE.md as an enforcement boundary
Instructions are context; use permissions and hooks to block actions reliably.
Duplicating AGENTS.md by hand
Import `@AGENTS.md` and add only Claude-specific guidance below it.
Loading an entire documentation set
Keep startup context concise and use rules or skills for conditional procedures.
Mixing personal paths into the shared file
Put local preferences in gitignored `CLAUDE.local.md`.
Related templates
Choose the closest repository shape.
Official sources
Instruction discovery and scope behavior were checked on August 13, 2026. Recheck product documentation when standardizing these files across a team.