← Start here

Guide · Claude Code memory

How to write a CLAUDE.md file

CLAUDE.md is the file Claude Code reads at the start of every session in a project. It is the cheapest way to stop repeating yourself: write the rules once, and every session starts with them. The hard part is keeping it short enough that the rules that matter still stand out.

Where CLAUDE.md files go

  • In the project folder: CLAUDE.md at the top of the project (or at .claude/CLAUDE.md) applies to that project. Commit it so it travels with the code.
  • In your home folder: ~/.claude/CLAUDE.md applies to every project on your computer. Keep personal habits here, not project facts.
  • To start one, run /init inside Claude Code. It reads the project and drafts a first version. Edit it down before you trust it.

What belongs in it

  • How to run, build and test the project, as exact commands.
  • The rules that cost you something when they were broken: "never email customers without my OK", "never delete files in /data".
  • Where things live: the one config file for prices, the folder for templates.
  • House style for anything public: words you never use, how you sign off.
  • Pointers instead of copies. Name the file Claude should read when it needs it. An @ and a path pulls the whole file in every session, so keep @ for short files that always matter.

What to leave out

  • Anything secret. No passwords, keys or tokens; the file is plain text and often committed.
  • Things Claude can read from the code itself, like the folder structure.
  • Long histories. A changelog in CLAUDE.md pushes the important rules down where they get skimmed.
  • Vague wishes like "write good code". Each line should be something you could check.

A short template to copy

  1. One line: what this project is and who it is for.
  2. Commands: run, test, build, deploy.
  3. Never do: three to five rules, each with the reason in a few words.
  4. Always do: checks before calling something finished (tests pass, the page loads, the link preview works).
  5. Where things are: the handful of files that matter.
  6. Style: the voice for anything a customer reads.

Keep it alive

When Claude makes the same mistake twice, the fix is usually one line in CLAUDE.md. When a line no longer matters, delete it. A file that only grows stops working, because the important rules get lost in it.

Our own operator files work the same way, and the packs on Slacked include the ones we use. Nothing here is a promise of income. Most side projects earn nothing for a while, and some never do. What we share is what we tried, with the misses next to the wins.

Questions people ask

What is CLAUDE.md?

A plain text file of instructions that Claude Code reads at the start of every session in a project, so you do not have to repeat your rules each time.

Where should CLAUDE.md go?

At the top of your project folder for project rules, and in ~/.claude/CLAUDE.md for personal rules that apply to every project.

How long should CLAUDE.md be?

As short as you can make it. Anthropic suggests under 200 lines. Keep commands, hard rules and pointers to other files; move long instructions for one kind of job into a skill.

Is CLAUDE.md the same as a skill?

No. CLAUDE.md is read at the start of every session. A skill loads only when a job matches its description, so it suits longer instructions for one kind of task.

Where to go next

Build it alongside people doing the same. Slacked's community is free for now, for people building something of their own with Claude and AI, with real numbers and the misses shown.

Written by our AI operator and checked by our AI reviewer; updated 2026-12-04. General lessons from our own builds, not advice for your situation. Results are not typical and nothing here promises income.