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 ↗

CHAPTERS

  1. Why CLAUDE.md matters: persistent project memory

    The episode frames CLAUDE.md as one of the most valuable parts of Claude Code because it provides durable context about a codebase. Without it, Claude effectively restarts from zero each session, re-deriving structure and making assumptions that can misalign with your intent.

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

    CLAUDE.md is described as a Markdown file placed in the project root that Claude Code reads every time a session starts. Functionally, its contents are appended to your prompt, acting like a standing onboarding script for the repository.

  3. Bootstrapping with /init: generating a first draft from the codebase

    The speaker points to the /init command as a quick way to create an initial CLAUDE.md. Claude generates the file by inspecting the repository, giving you a baseline you can edit and refine.

  4. Example walkthrough: documenting the stack and architecture

    A sample CLAUDE.md is shown for a Next.js 15 application using the app router, Tailwind, and Drizzle ORM. The file captures key architectural conventions so Claude can immediately align its suggestions with the project setup.

  5. Operational guidance: commands, tests, linting, and code style rules

    The example also includes practical workflow instructions: how to run the dev server, tests, and linting, plus formatting and module conventions. These details help Claude produce code that fits the repo’s tooling and standards on the first try.

  6. Routing conventions: API routes vs server actions

    The file encodes where API routes should live and when to prefer server actions over API routes. This guides Claude away from implementing features in the wrong layer or directory structure.

  7. Immediate payoff: better first-pass code generation (React + Tailwind)

    With CLAUDE.md in place, Claude can generate components and style them correctly without needing a discovery phase. The speaker emphasizes the difference in quality and alignment “right off the bat.”

  8. Sharing and scope: version-controlled project memory vs personal memory

    The episode confirms CLAUDE.md should be committed for team-wide benefit, and introduces a hierarchy of memory files. Project-level memory lives at the repo root, while a separate user-level file applies across all projects for personal preferences.

  9. User-level CLAUDE.md: keep cross-project personal preferences here

    The user-level CLAUDE.md is positioned as a place for preferences that follow you everywhere, such as how you like comments written. This keeps project files focused on repo-specific conventions while still letting Claude adapt to your personal style.

  10. How to “teach” Claude: explicitly save recurring corrections to memory

    When you find yourself repeatedly correcting Claude (e.g., always use server actions), the speaker recommends explicitly instructing Claude to save that rule to memory. This ensures future sessions start aligned without repeating the same feedback.

  11. Linking internal docs: referencing files with @ paths

    The episode suggests pointing Claude to project documentation directly using an @ symbol with a file path. This makes it easier for Claude to ground answers and changes in the source-of-truth docs already in the repo.

  12. Keeping CLAUDE.md lean: start without it and add only what’s necessary

    Rather than writing a large spec upfront, the recommendation is to begin a project without a CLAUDE.md and observe where the model needs repeated steering. Then add only the minimal, high-value guidance to keep the file compact and effective.

  13. Practical template: start with stack, preferences, and commands—then iterate

    The closing takeaway is that productivity hinges on providing the right context, and CLAUDE.md is the mechanism to do it. The suggested structure is to document stack, preferences, and commands first, then evolve the file as the project and team learn what matters.

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