Vibe Coder · Unit 8: Building With Claude Code · Lesson 12 of 15

CLAUDE.md and memory

Engineers: how project, user and nested CLAUDE.md files load, what belongs in each, and how to keep them effective.

Read the short notes and pictures.Do everything inside a blue frame.

Memory files

Claude Code loads CLAUDE.md files into context at the start of a session. A project file is shared through Git. A user file holds your own preferences across projects. Files inside subfolders add detail when the agent works there.

A 3D scene of coloured blocks and cards. Levels: user, project, folder.
User, project and folder levels.

What earns a place

Commands

How to build, test, lint and run.

Conventions

Naming, file layout, the libraries you use and avoid.

Constraints

"Never edit generated files." "All database access goes through lib/db."

Pointers

Links to longer docs, so they load only when needed.

A 3D scene of coloured blocks and cards. Put in: commands to run, conventions, constraints, things the code already shows.
Commands, conventions and constraints.

Maintaining it

  1. Generate a first draft

    Claude Code can create one from the repository.

  2. Edit ruthlessly

    Remove anything obvious or stale.

  3. Add rules from real mistakes

    One line each.

  4. Review it in pull requests

    Like any other file.

ActivityBuild stepThe first working version

Write your project memory

Create a project CLAUDE.md with your commands, conventions, constraints and the decision records from Unit 6. Commit it, start a fresh session, and verify that the agent follows it without being told.

Done when

Prune it whenever it passes a page.

Keep these

  • CLAUDE.md loads at session start.
  • Use user, project and folder files for different scopes.
  • Keep it short and reviewed.