Skip to content
Academy ofAI Learning

Learn it by doing it

How to write a Claude.md for my project

Watch it done first, then do it yourself in the lessons below. Pause the walkthrough at any step and try it on your own computer.

Watch it done: give a project its CLAUDE.md memory

>

Step 1 of 7

Let Claude write the first draft. You will spend most of your time afterwards deleting lines.

  1. Let Claude write the first draft. You will spend most of your time afterwards deleting lines. Type: /init. Claude looks at the codebase and creates a CLAUDE.md with the build commands, test instructions and conventions it finds. If a CLAUDE.md already exists, it suggests improvements instead of overwriting it.
  2. Trim it to what Claude cannot work out from the code, and aim for under 200 lines. The @docs/release.md line imports that file too. Create CLAUDE.md containing: # Commands - Install: npm install - Run one test file: npx vitest run path/to/file.test.ts - Typecheck: npx tsc --noEmit # Conventions - Dates are stored as ISO strings, never as Date objects - src/old-api/ is still live, but do not copy its patterns # Gotchas - Release steps: @docs/release.md
  3. Personal notes for this project go in CLAUDE.local.md, next to CLAUDE.md. It loads the same way but is only for you. Create CLAUDE.local.md containing: # My notes for this project - My dev server runs on http://localhost:3000 - Use the test user created by scripts/seed.ts
  4. Keep your personal file out of git. The team shares CLAUDE.md through version control, not your local notes. Type: add CLAUDE.local.md to .gitignore. Claude edits .gitignore. In Manual mode it shows the change and asks first.
  5. Check what actually loaded. This is the quickest way to confirm Claude can see your files. Type: /context all. Look at the list under Memory files. If a CLAUDE.md you expected is not there, Claude cannot see it.
  6. Open any memory file without hunting for it. Selecting one that does not exist yet creates it. Type: /memory. Claude Code lists your CLAUDE.md, CLAUDE.local.md and other memory locations. Select one to open it in your editor, or use the toggle to switch auto memory on or off.
  7. Say "remember that" for a note Claude keeps itself. Say "add this to CLAUDE.md" when you want a standing instruction you control. Type: remember that the API tests need a local Redis instance. Claude saves this to auto memory, its own notes for this project, not to CLAUDE.md.

Commands from the official Claude Code docs, checked 18 November 2026. Lines marked Note describe what happens and are not real output.

From the lesson CLAUDE.md: give your project a memory.

Your path: 1 lesson

0 of 1 done · about 7 min

Do them in this order. Each one has you try it for real, then checks you can.

  1. 1

    Level 4: Claude Code · 7 min

    CLAUDE.md: give your project a memory

    Where CLAUDE.md files live, what to put in them, how @ imports work and why a short file beats a long one.

    Start

Next: CLAUDE.md: give your project a memory. Start it now

These lessons are part of the Professional Diploma, unit D1: Building with Claude Code. See what it covers

Prefer to read first?