All video notes
Video notes · Claude Code memory

Claude Code Tutorial #2 - CLAUDE.md Files & /init

Video by Net Ninja on YouTube · 12 min · uploaded August 2025

Notes and analysis by BrainTube, written from the video. Not affiliated with Net Ninja. Watch on YouTube

In short

The video shows how /init scans a Next.js codebase and writes a CLAUDE.md file that Claude Code reads at the start of every session, then tests whether Claude follows it. The demo is clear and the advice to keep the file current is right. It underplays the most visible lesson of its own demo: CLAUDE.md is guidance the model may stretch, not a rule it must obey.

The argument

Net Ninja's argument is that a coding agent writes better code when it has a short, accurate description of the project in front of it, and that CLAUDE.md is the place for that. Running /init gets you a first draft for free on an existing codebase. On a new project you write it by hand. Either way the file has to change when the project changes, or Claude will follow stale guidance. He then shows the three places such guidance can live: the shared project file in version control, a personal local file for one project, and a user file that applies to every project. Two small tests check that Claude actually reads the file: a new hook lands in the folder the file names, and a new page gets a header link because a saved memory says it should.

Key ideas, with timestamps

  1. 0:14

    What /init does

    Running /init makes Claude Code scan the repository: folder structure, how the app starts, state management and existing docs. At 1:11 it builds a to-do list for itself, reads package.json and source files, and at 1:46 asks for approval before writing CLAUDE.md to the project root.

  2. 2:04

    What the generated file contains

    The output lists development commands from package.json, an architecture overview (a Next.js 15 blog with React 19, Tailwind v4 and Vitest), the project structure, the data layer (Hygraph for content), styling and testing notes. It reads like short internal documentation aimed at the agent.

  3. 3:07

    New projects get thin files

    On a project with almost no code, /init has little to find. He suggests writing the file yourself: planned structure, the frameworks and packages you will use, code style preferences and a one-paragraph summary of the app. At 3:40 he adds that you must update it when structure or packages change.

  4. 4:27

    Testing that Claude reads it

    He notices the file never mentions a hooks folder, adds a line saying reusable hooks go there, then asks for a hook that saves the theme toggle to local storage. Claude creates the missing hooks folder and a useTheme file in it, which shows the edit took effect.

  5. 5:20

    Scoping the request

    He ends the prompt with an instruction not to use the hook anywhere yet, because Claude Code tends to wire new code into the app unasked. It is a small habit with a real payoff: you review one change at a time.

  6. 6:21

    The # memory shortcut

    Starting a chat message with a hash saves it as a memory instead of a prompt. He saves a rule that every new page component gets a link in the header. At 7:02 Claude Code asks where to store it: project memory, local project memory or user memory.

  7. 7:24

    Three memory scopes

    Project memory is CLAUDE.md in the repo root, committed so the whole team shares it. Local project memory is a personal file for one project that stays out of the remote repository. User memory is a global file in the Claude folder on your machine that applies to every project.

  8. 10:08

    Claude goes beyond the brief

    The about page test works: Claude adds the page with an H2 and one line of placeholder text and updates the header. It also adds two more nav links nobody asked for. He suggests adding a do-only-what-I-ask rule to CLAUDE.md. At 10:27 he notes the docs were deprecating the local file in favour of imports, and at 10:54 shows /memory for opening any of the files.

What it gets right

The video tests its claims instead of asserting them. Adding a hooks line and then checking that the hook lands in that folder is the right way to learn what CLAUDE.md changes. Many tutorials show the generated file and stop.

The scope split is also explained well. Team conventions (folder layout, naming, test framework) belong in the committed project file. Personal tools belong in your own files. Mixing them is a common mistake, and it either leaks one developer's setup to the team or hides a team rule on one laptop.

The warning at 3:40 is the most useful line in the video. A stale CLAUDE.md is worse than none, because the agent will follow it with confidence.

What it leaves out

  • Guidance is not enforcement. The extra nav links at 10:08 are the real lesson. CLAUDE.md is text in the context window, and the model weighs it against the prompt and its own habits. Adding another rule to the file helps, but for things that must never happen, such as editing a generated file or running a destructive command, use Claude Code's permission settings and hooks (its scripted checks, not the React kind) instead.
  • Keep it short. /init writes a lot, and every line costs context in every session. Prune what Claude can read from the code itself, such as an obvious dependency list. Keep the parts that are not visible in the code: why a choice was made, which commands to run and what to avoid.
  • Imports and nesting. He mentions imports only as coming later in the course. CLAUDE.md can pull in other files with an @path reference, and Claude Code also reads CLAUDE.md files in subfolders when it works there. That is how large repos keep each file focused.
  • Commands change. As of the video's August 2025 upload, the # shortcut and the local memory option were both shown in the terminal, and he already flags the local file as deprecated. Claude Code moves fast, so check the current docs before you rely on a shortcut.

How this applies to memory across AI tools

CLAUDE.md is a good model of plain-text memory: readable, versioned and owned by you. Its limit is reach. It holds instructions for one agent in one repo, and it is loaded whole into every session whether it is relevant or not. It is not a place for everything you have read or researched about a topic.

That larger material needs search, not a file loaded at startup. The usual answer is to keep project rules in CLAUDE.md and put reference knowledge behind an MCP server the agent can query when it needs it. BrainTube is one option for the second part: it saves YouTube videos with their transcripts, articles, PDFs and podcasts into one compiled knowledge base and exposes it as an MCP server, so Claude, ChatGPT, Cursor and other MCP clients can search it. For other approaches, see Claude Code memory tools, and for the underlying trade-off, persistent memory vs the context window.

Who should watch it

Watch it if you are new to Claude Code and want to see /init, CLAUDE.md and the memory scopes working on a real Next.js project in twelve minutes. The core is 0:14 to 3:50 for /init and the generated file, then 6:21 to 8:30 for the # shortcut and the three scopes. 10:08 is worth a look for the scope creep it catches on camera. Skip it if you already maintain CLAUDE.md files, since it does not cover imports, nested files, permissions or hooks, and some of the shortcuts it shows may have changed since the upload.

Frequently asked

What does /init do in Claude Code?
It scans your repository, including folder structure, package.json, source files and existing docs, then proposes a CLAUDE.md file in the project root. The file summarises commands, architecture, structure and conventions. Claude Code loads it as context at the start of each session.
What is the difference between project, local and user memory in Claude Code?
Project memory is the CLAUDE.md in the repo, committed so the team shares it. Local project memory is a personal file for one project that is not pushed. User memory is a global file on your machine that applies to every project you open.
Why does Claude Code ignore my CLAUDE.md instructions sometimes?
CLAUDE.md is guidance the model reads, not a rule the tool enforces, so a strong habit or an ambiguous prompt can override it. Keep the file short and specific, and say what not to do in the prompt itself. For hard limits, use Claude Code's permission settings or hooks.

Keep videos like this one searchable

BrainTube saves YouTube videos with their transcripts into one compiled knowledge base that Claude, ChatGPT, Cursor and other MCP clients can search.

Start free

Go deeper

More video notes

Are you the creator and want this page changed or removed? Contact us and we will act within 48 hours.