# CLAUDE.md Starter Template

Copy-paste CLAUDE.md files for Claude Code, plus a guide to where the file goes, how to write good instructions, how to test that it works, and what to do when Claude Code ignores it. You do not need to code. A CLAUDE.md is a plain text file of your own rules that Claude Code reads at the start of every session, so you stop repeating yourself. Features and file locations can change, so confirm current details on Anthropic's page: https://code.claude.com/docs/en/memory

New to Claude Code? Start here: https://coding180.com/blog/what-is-claude-code and https://coding180.com/tutorials/install-claude-code

---

## How to use this file (4 steps)

1. Pick the template below that is closest to your folder and copy it.
2. Save it in the folder where you start Claude Code, in a plain text file named exactly `CLAUDE.md` (capital letters, with the dot and the md).
3. Replace every [bracket] with your own details, and delete any line you do not need.
4. Start Claude Code in that folder and type `/context`. Under **Memory files** you should see your CLAUDE.md. If you do, it is loaded.

Prefer to let Claude write a first draft? In your folder, type `/init`. Anthropic says Claude Code analyzes your project and creates a starting CLAUDE.md, and if one already exists it suggests improvements instead of overwriting it. Then replace the generic parts with your own rules.

---

## Where the file can live

| Scope | Location | Use it for |
| --- | --- | --- |
| Project | `./CLAUDE.md` or `./.claude/CLAUDE.md` (in the folder you start Claude Code in) | Rules for this one folder or project |
| You, all projects | `~/.claude/CLAUDE.md` (the .claude folder in your home folder) | Your personal preferences everywhere |
| You, this project only | `./CLAUDE.local.md` | Private notes for one project. Add it to .gitignore if you use Git |

Claude Code also loads CLAUDE.md files from folders above the one you start in. Files in subfolders load when Claude works with files there. Type `/memory` inside Claude Code to list your memory files and open one in your editor.

---

## Template 1: Everyday work folder (no coding)

For a folder of documents, notes, spreadsheets or client files.

```
# About this folder
This folder holds [what it contains, for example: client proposals and meeting notes for my consulting business].

# About me
- I am [your role, for example: a freelance designer].
- My readers or clients are [who they are].

# How I like you to work
- Always explain what you plan to do in plain English before you change anything.
- Never delete or overwrite a file. Make a copy with "-new" in the name instead.
- Ask me one short question if something is unclear, instead of guessing.
- Keep answers short: [for example: five bullet points or fewer] unless I ask for more.

# Writing style
- Use simple words and short sentences.
- Do not use em dashes. Use commas or full stops.
- Write in [your tone, for example: friendly and direct].

# Never do this
- Never include passwords, API keys or private customer details in any file.
- Never send anything outside this folder without asking me first.
```

---

## Template 2: Website project

For a small site you are building with Claude Code.

```
# Project
This is the website for [business name]. It is [what it is, for example: a one-page site that explains my services and has a contact button].

# How the site is built
- Plain HTML, CSS and JavaScript. No frameworks.
- The main page is index.html. Styles are in style.css.

# Design rules
- Use a [light or dark] design with these colours: [colour 1], [colour 2].
- Use [font name or "a clean system font"] for all text.
- Keep the layout simple and readable on a phone.

# Working rules
- Before big changes, show me your plan and wait for my yes.
- After changes, tell me how to open the page and what I should see.
- Do not add new tools or libraries without asking.

# Never do this
- Never put secret keys or passwords into any file.
```

---

## Template 3: Writing and content folder

For articles, newsletters, scripts and social posts.

```
# What this folder is for
Drafts and final versions of [what you write, for example: my weekly newsletter and blog posts].

# My audience
[Who reads it, what they already know, what they want from you.]

# Voice and style
- Write in first person as [your name].
- Tone: [for example: warm, practical, no hype].
- No em dashes. No filler openings like "In today's world".
- Prefer short paragraphs of two to four sentences.

# Process
1. Ask me for the topic and the one thing the reader should do afterwards.
2. Give me an outline and wait for my yes.
3. Write the draft, then list any facts I should double-check.

# Never do this
- Never invent quotes, statistics or sources. If you are not sure, say so.
```

---

## Blank template (copy and fill in)

```
# About this project
[One or two lines: what it is and who it is for.]

# How I like you to work
- [A habit you always want, written so you could check it.]
- [A second habit.]
- [A third habit.]

# Style
- [Tone or format rule, with a number if you can: "Keep replies under 150 words."]

# Never do this
- [A hard limit.]
- Never include passwords, API keys or private data in any file.

# Useful details
- [Anything Claude would otherwise ask you every session: names, dates, file names, links.]
```

---

## How to write good instructions

Anthropic says Claude treats CLAUDE.md as context, not strict settings, so how you write it affects how well it is followed.

1. **Be concrete enough to check.** Weak: "Keep answers short." Strong: "Keep answers to five bullet points or fewer." Weak: "Be careful with my files." Strong: "Never delete a file. Copy it with -new in the name."
2. **Keep it short.** Anthropic recommends under 200 lines per file. Longer files use more of Claude's working memory and can be followed less well. The templates above are about 20 lines.
3. **Use headings and bullets.** Organized sections are easier to follow than one long paragraph.
4. **Do not contradict yourself.** If two rules clash, Claude may pick one at random. Re-read the file every few weeks.
5. **Write down what you keep repeating.** Anthropic suggests adding a line when Claude makes the same mistake twice, or when you type the same correction in two sessions.
6. **Leave notes for yourself.** Block-level HTML comments, like `<!-- note to self -->`, are removed before Claude reads the file, so they cost nothing.

### What to include and what to leave out

| Include | Leave out |
| --- | --- |
| Rules about style, tone and format | Things Claude can work out by reading your files |
| Names, terms and details you keep repeating | Long essays and tutorials |
| Hard limits ("never delete a file") | Details that change every week |
| Where important files live | Self-evident advice like "do a good job" |

---

## Test it in 3 minutes

1. Start Claude Code in the folder and type `/context`. Check that your CLAUDE.md appears under **Memory files**.
2. Ask a question your rules should change, for example: "Summarize the files in this folder." Does the answer follow your style rule?
3. Change one rule, run `/clear`, and ask again. Does the behavior change?

---

## If Claude Code is not following it

| Problem | Fix |
| --- | --- |
| The file is not listed under Memory files in /context | Check the file name is exactly CLAUDE.md and that it is in the folder where you started Claude Code. Use /memory to open or create it |
| Claude ignores one rule | Make it more specific and add a number or an example. "Use short sentences" becomes "Keep sentences under 20 words" |
| Two rules clash | Remove or reword one. Check any other CLAUDE.md files above or below your folder |
| The file is very long | Trim it below 200 lines. Move rules for one job into a Skill (https://coding180.com/blog/what-are-claude-skills) |
| A rule must happen every single time | Instructions are guidance, not a guarantee. Anthropic recommends a hook for things that must always run. Ask Claude to help you write one |
| A rule vanished after /compact | The project CLAUDE.md is re-read after /compact. A rule you only said in chat is lost, so add it to the file |

Optional check: `/doctor prompt-audit` asks Claude to look for outdated or conflicting instructions in your instruction files. Anthropic lists it as needing Claude Code v2.1.283 or later, and it changes nothing until you approve.

---

## CLAUDE.md, auto memory or a Skill?

| You want... | Use |
| --- | --- |
| Rules and facts Claude should know every session | CLAUDE.md |
| Claude to remember your corrections by itself | Auto memory (Claude saves notes for itself, and you can browse them with /memory) |
| A step-by-step procedure for one repeat job | A Skill |
| Something that must run every time, no exceptions | A hook |

---

## Checklist before you save

- [ ] The file is named CLAUDE.md and sits in the folder where I start Claude Code.
- [ ] Every [bracket] is replaced or deleted.
- [ ] Each rule is specific enough that I could tell if it was followed.
- [ ] No passwords, keys or private data are written in it.
- [ ] It is under 200 lines.
- [ ] I ran /context and can see it under Memory files.

CLAUDE.md Starter Template from https://coding180.com
