What Is a CLAUDE.md File?

Michael Murr··6 min read

Last updated: July 2026

A CLAUDE.md file is a plain Markdown file you keep in your project that Claude reads automatically at the start of every session. It holds your standing instructions: how you want Claude to behave, the facts about your project, and the rules it should never break. Think of it as the onboarding document you would hand a new team member, except Claude actually reads all of it, every single time.

The short version

  • It is Claude's memory between sessions: without one, you re-explain your project every time you open it. With one, Claude starts already knowing.
  • It lives at your project's root as plain text: usually 20 to 100 lines of Markdown, and you do not need to write a line of code to make one.
  • It is the highest-leverage twenty minutes you will spend with Claude Code: every session afterward gets sharper, because you stop repeating yourself.

What does a CLAUDE.md file actually do?

Every time you start Claude in a project, it loads the CLAUDE.md file into its working memory before you type a single word. So instead of opening with "remember, we use this framework, my tone is this, never do that," all of it is already in the room. You start the real work at sentence one.

A marketing director I worked with this month spent his first two sessions re-explaining his brand voice to Claude at the start of every chat: the same three corrections, every time. We spent fifteen minutes writing a CLAUDE.md that captured his tone, his audience, and his hard rules (one of which was, fittingly, "never use em dashes"). The repetition stopped. From then on Claude opened every session already sounding like his brand, and he spent his time editing real work instead of re-teaching the basics.

That is the whole job of the file: it turns instructions you keep repeating into instructions Claude remembers. Anthropic's own Claude Code best practices treat it as the first thing you set up, for exactly this reason. It is the same instinct behind good prompt engineering: say the important thing clearly once, in a place the model always sees, instead of vaguely every time.

What should you put in one?

Whatever you find yourself saying to Claude more than twice. If you correct the same thing in three sessions, it belongs in the file. Here is how the most common repeated corrections map into a CLAUDE.md:

If you keep telling Claude...Put this in CLAUDE.mdWhy it works
"We use this framework or tool"A short "Stack" or "Tools" sectionClaude stops guessing and uses what you actually use
"Write in my voice, not generic"3 to 5 voice rules with one exampleOutput sounds like you from the first draft
"Never do this"A short "Rules" or "Do not" listHard constraints stop slipping through
"Here is what this project is"A two-line project summary at the topClaude works toward the goal, not just the task

Keep each section short. A CLAUDE.md is a cheat sheet, not documentation. My own file for this blog runs about thirty lines: two lines on what the site is, a short list of the tools it runs on, a voice section that says write like a working professional explaining something to a peer, and a rules block that bans em dashes and marketing clichés. That is it, and it does more for output quality than any clever prompt I could write in the moment.

How long should a CLAUDE.md file be, and how do you write it?

Short. Most good ones run 20 to 100 lines. If yours is longer than a page, Claude starts to lose the signal in the noise, the same way a person skims a wall of text, so lead with the few rules that matter most and cut the rest.

You also do not write it all at once, and you should not try. Start with five lines: what the project is, the two or three tools you use, and one or two hard rules. Then let it grow. Every time you catch yourself correcting Claude on the same thing, add a line for it. Within a week the file reflects how you actually work, not how you imagined you would. The official Claude Code documentation shows how to scaffold one automatically, but a file you built from your own repeated corrections will always beat a generic template.

One thing not to do: do not dump your entire project into it. It is a briefing, not an archive. Claude can read your files when it needs them. The CLAUDE.md is only for the things that should be true in every session, before it reads anything else.

If you are just starting to use Claude at work, this is the first habit worth building. It is the difference between a tool you re-train every morning and one that shows up already knowing the job.

Frequently Asked Questions

Do I really need a CLAUDE.md file?

If you use Claude on the same project more than a handful of times, yes. For a one-off question, no. The value compounds with repetition: the more sessions you run, the more the file saves you. Most people feel the difference by the third session.

Where does the CLAUDE.md file go?

At the root of your project folder, named exactly CLAUDE.md. Claude looks for it there and loads it on its own. You do not have to point to it or paste it into the chat.

Does Claude Cowork use a CLAUDE.md file too?

Not in the same place. Cowork, the version built for non-developers, keeps its standing instructions in its settings rather than a file at your project root. The idea is identical, give Claude your context once so it stops asking, the location is just different. If you work in Cowork, set your instructions there.

What is the difference between a CLAUDE.md and a prompt?

A prompt is what you ask right now. A CLAUDE.md is what is always true. Your prompt changes every session; the CLAUDE.md holds the things that never change, so you stop wasting prompts restating them.

Will a CLAUDE.md file cost me more tokens?

A little, because it loads every session. But it is a small, fixed cost that usually saves far more, since Claude makes fewer wrong turns you have to catch and correct. Keep the file short and the trade lands heavily in your favor.

Want your setup done right the first time?

Most people do not need more Claude tips. They need someone to look at how they actually work and set it up so it sticks. That is most of what a first session with us is: your CLAUDE.md, your tools, your rules, configured once so every session after is faster. Book a free 15-minute Discovery Call, and bring the corrections you keep repeating to Claude. We will turn them into a setup that holds.

Written by Michael Murr for AI Tutor Code: private 1-on-1 online tutoring for professionals learning Python, AI tools, Data Science, ML, and LLM engineering. 200+ students taught, 3,000+ hours delivered.

Related articles

Keep reading on related topics.

Enjoyed this article?

You can master this and more with a dedicated 1-on-1 tutor.

Book a Free Discovery Call