← Back to Lessons
Getting Started

Give Claude a Memory: the CLAUDE.md File

One plain text file gives Claude a memory of your project, every session. The trick: you never hand-edit it. You tell Claude what the project is about, and Claude writes and updates the file for you.
⏱ About 10 minutes

The problem it solves. By default, every new Claude Code session starts cold. It does not remember the decisions you made yesterday, your project's conventions, or the thing you told it three times. The fix is a file named CLAUDE.md in your project. Claude reads it automatically at the start of every session and treats it as standing instructions.

You never write it by hand. This is the part people get wrong. You do not open CLAUDE.md and type into it. You talk to Claude about what your project is and how you like to work, and Claude writes and updates the file for you. Everything happens in the conversation.

1
Let Claude write the first draft

The fastest start is to have Claude read your project and draft the file. In a session, run:

/init

Claude looks through your folder and writes a starter CLAUDE.md describing what the project is, how it is structured, and how to run it. You do not have to open anything. If you want to see what it wrote, just ask:

Show me what's in CLAUDE.md right now.
Brand new or empty project?

/init still works, there is just less for it to read. That is fine, because you are about to tell Claude the rest in the next step.

2
Tell Claude what the project is about

This is the heart of it. Describe your project to Claude in plain language, the way you would brief a new teammate, then ask Claude to capture it. For example:

This project is my personal blog, built with Next.js. I write posts in Markdown, I like clean, simple designs, and I always want plain language with no jargon. Save all of that in CLAUDE.md so you remember it every time.

Claude updates the file and confirms. From now on, every session already knows your project. You never touched the file yourself.

The habit

Whenever you start something new, spend two minutes telling Claude what it is and how you want to work, and ask it to "put that in CLAUDE.md." That single habit is what makes Claude feel like it actually knows your project.

3
What is worth telling Claude to remember

Not sure what to say? These are the four kinds of things worth capturing. Just say them to Claude in plain words and ask it to save them.

What this project is

"This is a personal blog built with Next.js." "This folder holds my client proposals as Markdown."

How to run or build it

"Run the site with npm run dev." "The tests are npm test." The commands you always forget.

Rules and preferences

"Always use plain language, no jargon." "Never touch files in the archive/ folder." "Prefer simple solutions over clever ones."

Context Claude cannot guess

"The real config is in config/prod.json, ignore the sample." Decisions, gotchas, and where things actually live.

4
Grow it by talking, not editing

You will keep teaching Claude as you work, and the trigger is simple: any time you catch yourself correcting Claude or making a decision, tell it to remember. For example:

From now on, run the tests after you change any code. Add that to CLAUDE.md so you don't forget.

The moment you give the same instruction twice is the moment it belongs in CLAUDE.md. Say "add that to CLAUDE.md" and you will not have to say it a third time. You are always editing the file, you are just doing it by talking.

Keep it tight, and Claude will

A CLAUDE.md that turns into an essay gets skimmed. You do not have to police this by hand, just ask now and then: "Is CLAUDE.md getting too long? Tighten it to the rules that actually change how you work."

5
Where these files can live

You can have more than one, and they stack. You still manage all of them by talking to Claude.

  • Project CLAUDE.md (in your project root): rules for that project. Commit it so your team shares it.
  • Nested CLAUDE.md (in a subfolder): extra rules that apply when Claude works in that folder.
  • Personal CLAUDE.md (in your home ~/.claude/ folder): your global preferences across every project, like "no emoji" or "explain before making big changes." Tell Claude "remember this for all my projects" and it goes here.

Claude reads the ones relevant to where it is working and follows them together.

Questions?

Made by AI Service Engine. Next: the plan, build, review loop for working on bigger changes safely.