Build and run websites with Claude ›
Module 2 of 7 · Free · about 9 minutes
CLAUDE.md: the project’s memory
Every new chat starts fresh. A CLAUDE.md file in your repository tells each session your rules, your decisions and how you want replies.
How it works
- Put inPurpose and audience, commands, design and accessibility rules, workflow, reply format, shortcuts, open items.
- Keep outPasswords, keys and tokens, personal details, dated history, long chat logs.
Write rules you could check: “fits 3 phone screens at 400px”, not “not too long”. When you make a decision in a chat that should last, ask Claude to add it here.
Practise
Vague rule, clear rule
Before
Make it look good.
After
Home is a dashboard: one heading, one line, a compact action bar, then tiles. It fits 2 to 3 phone screens at 400px, footer included.
- A rule you can measure is a rule Claude can follow and you can check.
Before
Be careful with secrets.
After
Never commit passwords, API keys, .env files or backups. Anything a visitor pays for is served only by a server function after the payment check.
- It names exactly what is forbidden and where paid content must live.
Before
Tell me when you are done.
After
End every reply about a site change with three lines: Pull Request Link, Preview Link, Live URL.
- A fixed reply format means you always know where to click to check the work.
Before
Remember what we decided.
After
At the end of a session, record lasting decisions in the right section of this file and update Open items. Don’t add dated history; git keeps it.
- The file stays short and current instead of turning into a diary.
Copy and adapt
Starter CLAUDE.md
Save it as CLAUDE.md in the top folder of your repository, then fill in the parts in <angle brackets>.
# <Site name> (<domain>) ## What this site is <One or two sentences: who it is for and what it helps them do.> ## Stack and commands - Plain static HTML and one styles.css; no framework, no build step. - Run locally: python3 -m http.server 8000 - Hosting: Cloudflare Pages, production branch main. Merging to main deploys. ## Design rules - Home is a dashboard: one heading, one line, a compact action bar, then tiles. - Home fits 2 to 3 phone screens at 400px wide; other pages 3 to 4. - Use the colour variables in styles.css; no new hard-coded colours. ## Accessibility - WCAG 2.2 AA in light and dark mode: skip link, one h1, tap targets at least 44px. - Animations play once, in under 5 seconds, and stay still with reduced motion. ## Workflow - Never push to main. Work on a branch, open a pull request, merge after the checks pass. - Before saying something is live, check main and the live site. ## Reply format End every reply about a site change with: Pull Request Link: <URL> Preview Link: <URL> Live URL: <URL> ## Shortcuts - msc = merge, solve conflicts (see below). ## Never - No passwords, API keys, tokens or personal details in this file or the repo. ## Open items - <What is waiting on you, the owner.>
Reply format rule
Add it under a “Reply format” heading. Every answer then ends with the links you need to check the work.
Every reply about a site change ends with: (1) one paragraph on the next improvement, naming the task and its benefit; (2) exactly these three lines: Pull Request Link: <pull request URL> Preview Link: <preview URL of the exact page> Live URL: <live URL of the exact page> Replies that change nothing (questions, advice, plans) skip both.
Reload prompt
Paste it into a fresh chat when a long one gets slow or you switch device. It carries the task, not the whole history.
RELOAD: <project> on <domain>. Read the repo's CLAUDE.md first and follow it. Task: <one sentence goal>. Current state: <what is done, with links>. Open steps: 1. <next step> 2. <the step after> Waiting on me: <decisions or files only I can give>. Rules: branch and pull request, merge after the checks pass, test at 400px and desktop in light and dark, no secrets in the repo.
Shortcuts: merge and reload
Shortcuts work because they are written down. Claude reads the meaning here instead of guessing.
## Owner's shortcuts - msc = merge, solve conflicts: bring main into the pull request branch, resolve conflicts (keep both sides where they don't contradict), push, merge after the checks pass, then check main and give the live URL. - reload prompt = one ready-to-paste prompt for a fresh chat: task, current state, open steps, my to-dos and the standing rules. Only when I ask.
All-sites prompt
One change, many sites. Each site still follows its own CLAUDE.md. Module 5 shows how to schedule it.
ALL SITES: <the change, in one sentence>. Sites: every site listed under "Shared across the sites" in CLAUDE.md. For each site, one at a time: 1. Read its CLAUDE.md and follow it. 2. Make the change on a new branch, in that site's own style. 3. Test at 400px and 1280px, in light and dark mode. 4. Open a pull request and merge it after the checks pass. 5. Check the live site. If a site's rules conflict with this change, skip it and tell me why. At the end, reply with a table: site, pull request, live URL, anything that failed.
Quick quiz
Question 1 of 5
What is CLAUDE.md?
It is a plain text file in your repository. Because it is read at the start of a session, every chat begins with the same rules.
Question 2 of 5
Which line belongs in CLAUDE.md?
It is a lasting rule that is easy to forget. Keys never go in the repo, and the history already lives in git.
Question 3 of 5
Where should dated history, such as what changed last Tuesday, live?
Git and pull requests record what changed and when. CLAUDE.md holds only the rules and decisions that still apply.
Question 4 of 5
What does a reload prompt do?
A fresh chat is faster and less confused. The reload prompt carries only what the next session needs.
Question 5 of 5
Why does a shortcut such as “msc” work the same way every time?
Written-down steps don’t depend on memory or guessing. If a shortcut isn’t defined, define it before you use it.
Is your CLAUDE.md ready?
Independent course by GetReady Academy. It is not made, endorsed or sponsored by Anthropic. Claude and Claude Code are Anthropic’s products and their features change, so check the official Claude Code documentation too. Results depend on your project and your own checks; we don’t promise any outcome or income. Everything on this page runs in your browser and nothing you choose or type is sent.