Skip to content
S
Beginner7 min read

The Anatomy of a Great CLAUDE.md File (With Template)

A clear, non-technical walkthrough of what belongs in your CLAUDE.md β€” the main file that directs your AI agent team. Includes a downloadable template.

What CLAUDE.md Does

CLAUDE.md is the operating system for a Claude Code project. When you open a folder containing CLAUDE.md in VS Code, Claude Code reads the file first and uses it as the master rulebook for every action it takes inside that folder.

The file is plain Markdown. No code. No programming. It's closer to a well-organized employee handbook than to a config file.

The 4 Required Sections

1. Project Overview β€” one paragraph explaining what this folder does, for whom, at what cadence.

2. Folder Map β€” a bullet list of the sub-folders (/context, /agents, /templates, /data) and what each holds.

3. Routing Rules β€” at least two "if X, then call Y" rules that describe how sub-agents hand off work.

4. Work Rules β€” constants the AI should always obey: tone requirements, approval checkpoints, brand guardrails.

A Working Template

Below is a minimal but production-grade CLAUDE.md you can copy as a starting point.

# [Project Name] ## Project Overview [One paragraph: what, for whom, cadence] ## Folder Map - /context β€” brand & business context - /agents β€” sub-agents (research, content, review) - /templates β€” standard output formats - /data β€” CSV inputs ## Routing Rules 1. If user asks for [X], call research_agent first. 2. If research returns < 3 sources, loop before content_agent. ## Work Rules - All outputs must match /context/brand_guidelines.md tone. - Semi-auto mode: confirm before publishing.

Generate Yours in 2 Minutes

If writing CLAUDE.md from scratch feels intimidating, use the Harness Builder. Answer five questions and you get a complete CLAUDE.md plus sub-agent files as a ZIP.

Test What You Learned

Apply what you've learned with our free PROMPT Score analyzer.

Score your prompt now β†’

Get weekly prompt tips

Join 5K+ professionals improving their AI skills.

Subscribe for free β†’