Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
CLAUDE.md  ›  Capstone Project

Where CLAUDE.md Files Live

Locations 15 minInstruction files exist at personal, project, folder and organisation level, and each instruction belongs at the narrowest level where it is always true.

Where CLAUDE.md Files Live

Some instructions are about you ("keep explanations short"), some are about the whole project ("run pytest -q"), and some are about one corner of it ("every string in the templates must be bilingual"). Claude Code reads instruction files from several places, so each kind can live where it belongs.

The rule

Put each instruction at the narrowest level where it is always true.

Location Applies to Shared?
~/.claude/CLAUDE.md You, in every project No, it stays on your machine
CLAUDE.md at the project root Everyone working on this project Yes, commit it
CLAUDE.md in a subfolder, such as templates/CLAUDE.md Work in that folder; read when Claude works with files there Yes, commit it
A personal, uncommitted file for this project You, in this project only No
An organisation-wide policy file Everyone in a company, set by administrators Managed centrally

Claude Code also reads CLAUDE.md files in the folders above the one you start in, which helps when several projects sit inside one parent folder. The name and location of the personal per-project file have varied between versions, so check the current docs for yours.

To see which instruction files a session has picked up, and to open one for editing, use /memory.

If two files disagree, you are leaving Claude to settle the conflict. Better not to create one: say each thing once, at the right level.

The shortcut

Ask two questions: Who needs it? Where is it always true? Only you, everywhere: your user file. The whole team, the whole repository: the root file. Only inside one folder: that folder's file. Only you, only here: the personal project file.

Sorting four instructions for tiffinStep 1 of 5
  1. "Explain changes in short bullet points"

    Your own taste, in every project. ~/.claude/CLAUDE.md.

Why the narrowest level? A rule placed too wide costs context in sessions where it does not apply, or, if it is personal, pushes your setup onto teammates. A rule placed too narrow is missing when it is needed.

Drills

Answer fast — trust the rule.

quick drill

"I prefer answers in short bullet points." Where does this go?

quick drill

"Every customer-facing string in templates/ must be in English and Hindi." Following the rule, where does it go?

quick drill

"My local database runs on port 5433." Where does it go?

quick drill

How can you see which instruction files the current session has picked up?

Remember

  • Put each instruction at the narrowest level where it is always true.
  • Shortcut: who needs it, and where is it always true?
  • Trap: personal settings committed for the whole team, or the same rule written in two places.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWhere does each instruction live?

Sort these instructions into CLAUDE.md locations and explain the rule you used: 'explain changes in short bullets', 'run tests with pytest -q', 'every customer-facing string in templates/ must be in English and Hindi', 'my local database runs on port 5433'.