BoilerplateHub

CLAUDE.md Templates for Claude Code

A CLAUDE.md is the file Claude Code reads to learn how your project works before it writes anything. The templates below are complete files covering commands, code style, boundaries, testing and git workflow, one per project type.

CLAUDE.md and AGENTS.md hold the same content

This is why the templates are shared rather than duplicated. Claude Code reads CLAUDE.md, while most other agents and editors read AGENTS.md, and the rules you want in each are identical. Maintaining two copies means they drift, and the agent that reads the stale one does the wrong thing. Keep one real file and symlink the other:

ln -s AGENTS.md CLAUDE.md
git add AGENTS.md CLAUDE.md

Git stores the symlink, so it survives cloning on macOS and Linux. Windows needs developer mode, or a one-line CLAUDE.md that says "See AGENTS.md" instead. The longer comparison, including what belongs in the file and what does not, is in CLAUDE.md vs AGENTS.md.

Templates by project type

Each one is a full file. Save it as CLAUDE.md, or as AGENTS.md with CLAUDE.md symlinked to it.

Frequently asked questions

Does Claude Code read AGENTS.md?

Claude Code looks for CLAUDE.md in the project root and in subdirectories. If your project only has an AGENTS.md, the reliable way to have Claude Code pick it up is a symlink or a one-line CLAUDE.md that points at it. Do not assume cross-reading: put a distinctive rule in the file and ask the agent to repeat it, which tells you in one prompt whether the file was loaded.

Where should CLAUDE.md live?

In the repository root, committed to version control, so every contributor and every agent session gets the same rules. Claude Code also reads nested files, which is useful in a monorepo: a root file for shared conventions and a package-level file for rules that only apply inside that package.

How long should the file be?

Long enough to cover commands, conventions and boundaries, short enough that it is worth loading every session. Everything in the file competes for context with the actual task. Aim for one screen of genuinely project-specific rules rather than a restatement of your README, and delete anything the agent can discover from the code itself.

Should I commit CLAUDE.md or keep it local?

Commit it. The value is that everyone on the team, and every agent run, works from the same instructions. Keep personal preferences out of it and put them in your own global config instead, otherwise the file turns into a place where individual habits get imposed on the whole repository.