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. 0:000:02

    Intro

    1. CL

      [upbeat music]

  2. 0:020:32

    Why CLAUDE.md matters: persistent project memory for Claude Code

    1. CL

      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

  3. 0:320:42

    What CLAUDE.md is and how Claude Code uses it automatically

    1. CL

      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

  4. 0:420:53

    Bootstrapping with /init: generating a starter CLAUDE.md from the codebase

    1. CL

      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

  5. 0:531:03

    Concrete example: documenting stack and conventions (Next.js, Tailwind, Drizzle)

    1. CL

      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,

  6. 1:031:19

    Encoding workflow basics: commands, tests, linting, and formatting rules

    1. CL

      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

  7. 1:191:35

    Immediate payoff: better first-try code generation aligned to your stack

    1. CL

      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.

  8. 1:352:05

    Sharing and scope: the memory hierarchy (project vs user-level)

    1. CL

      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

  9. 2:052:16

    Personalizing behavior: explicitly ask Claude to save corrections to memory

    1. CL

      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

  10. 2:162:27

    Pointing Claude to internal docs: referencing files with @ paths

    1. CL

      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

  11. 2:272:39

    Right-sizing CLAUDE.md: start without it, then add only what you need

    1. CL

      correct the model. This keeps your CLAUDE.md file compact and contain only the necessary information that Claude can work with. [upbeat music] The

  12. 2:393:00

    Wrap-up framework: context is everything—stack, preferences, commands, iterate

    1. CL

      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.