LESSON · 1 OF 4

What CLAUDE.md is

What CLAUDE.md is

CLAUDE.md is your project's memory. Claude reads it at the start of every session, before you type a single word, so anything in it is already known. Write "tests run with make test" once and you stop repeating it in every new conversation.

Where it lives

Claude looks for memory in a few places and merges what it finds:

LocationScope
CLAUDE.md at the repo rootThis project, shared with the team via git
.claude/CLAUDE.mdThis project, if you prefer it out of the root
~/.claude/CLAUDE.mdYou, across every project on this machine

The repo-root file is the common one: it travels with the code, so everyone working in the project (and every future session) starts from the same facts.

How to create one

You do not have to write it from scratch. Run /init in the console and Claude reads your project, then drafts a CLAUDE.md describing it:

bash
claude
/init

Approve the write and you have a starting point to trim and edit.

Adding a memory on the fly

In the console, a line that starts with # is not a prompt. It appends that note to CLAUDE.md:

# always use pnpm, never npm, in this repo

That single line lands in your project memory and is remembered from then on. It is the fastest way to capture a fact the moment you notice Claude needs it.

Why it matters

Without memory, every session starts cold and you re-explain the same build command, the same conventions, the same gotchas. With a good CLAUDE.md, Claude opens each session already knowing how your project works.


Your lab setup

This VM comes with Claude Code preinstalled and signed in - just run claude to start.

Spin up a fresh environment and practice live.
claude-code-ubuntu · fresh machine · ready in under a minute