Skip to content
ClaudeClaude

The CLAUDE.md file

Give Claude Code persistent memory about your project with a simple Markdown file called the: "CLAUDE.md" In this video, we cover what to put in your CLAUDE.md file, how the file hierarchy works, and tips for keeping it effective. Take the full course: claude.com/courses

Claudehost
May 10, 20263mWatch on YouTube ↗

EVERY SPOKEN WORD

  1. CL

    [upbeat music] One of the most useful parts of Claude Code is the CLAUDE.md file. It gives Claude Code persistent memory about your project. When you open up Claude Code without a CLAUDE.md file, it's like it has to start fresh every single time. It has to re-explore your code base, understand what dependencies are needed, and the features that are already implemented. Sometimes it has to make assumptions, which makes it harder for us to steer Claude in the right direction. But that's where CLAUDE.md comes in. It's a Markdown file that you add to the root of your project, and Claude Code reads it automatically every time you start a session. It's like an onboarding script for your code base. Simply put, the contents of CLAUDE.md file are appended to your own prompt. You can run the /init command, which will make Claude generate one based off of your code base. So let's have a look at one. This is a Next.js 15 app using the app router, Tailwind, and Drizzle ORM. Command, dev server, run tests, lint, code style, use two-space indentation, prefer named exports, all API routes go in app/api, use server actions instead of API routes where possible. And it's pretty straightforward. Now, if I ask Claude Code to create a React component, it knows how to style it with Tailwind or any other CSS framework that I'm using. We can see that Claude does a better job at doing its job right off the bat versus having to understand where everything is at first. And before you ask, the answer is yes. You share this in your version control for your team to use, but there's actually a hierarchy of memory files depending on who it's for. So first you have your project level CLAUDE.md that lives in the root directory of your project. You have a user level CLAUDE.md that lives in your configuration folder. This one is just for you and goes across all your projects. So put your personal preferences here, like how you write code comments. First, if you have to correct Claude to do something, like always use server actions instead of API routes, then explicitly ask Claude to save this to memory so that when you come back to this project, it will know every single time. Second, if you have docs in your project that you want Claude to reference, just use the @ symbol with the file path. And third is we recommend you start off a project without a CLAUDE.md file, so you can see where you have to constantly course correct the model. This keeps your CLAUDE.md file compact and contain only the necessary information that Claude can work with. [upbeat music] The difference between a frustrating Claude Code session and a productive one comes down to the context, and the CLAUDE.md file is how you provide that context. Start with your stack, your preferences, and then commands, and just build from there as you go. [upbeat music]

Episode duration: 3:00

Install uListen for AI-powered chat & search across the full episode — Get Full Transcript

Transcript of episode O0FGCxkHM-U

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.

Add to Chrome