PrepGenAICerts

CLAUDE.md as Hierarchical Project Memory

Core

Apply the CLAUDE.md memory hierarchy · Difficulty 2/5

0%
claude-mdmemory-hierarchyproject-memoryinit

Explanation

What CLAUDE.md Is

`CLAUDE.md` is a special Markdown file that Claude Code automatically pulls into context as project memory. It is where a team puts architecture notes, conventions, common commands, and gotchas -- the standing context Claude should have on every turn without being re-told.

The Hierarchy

`CLAUDE.md` is hierarchical and merged from multiple locations, from broadest to most specific:

LevelLocationScope
Enterprise/systemmanaged centrallyorganization-wide policy
User~/.claude/CLAUDE.mdpersonal defaults across all of a developer's projects
Project./CLAUDE.md (checked into the repo)shared team conventions for that codebase
Subdirectorydeeper CLAUDE.md files in the treemore specific guidance for that part of the code

More specific files layer on top of broader ones -- a subdirectory `CLAUDE.md` refines, rather than replaces, the guidance inherited from the project, user, and enterprise levels.

Because the project-level `CLAUDE.md is committed to version control, the whole team shares identical guidance -- it is not each developer's individual preference file (that role belongs to the user-level file at ~/.claude/CLAUDE.md`).

Bootstrapping with /init

Run /init in a repo to bootstrap a starter `CLAUDE.md` from the existing codebase -- Claude Code analyzes the project and generates an initial file rather than the developer starting from a blank page.

Common exam traps

  • **CLAUDE.md is memory/instructions loaded into context, not executable configuration.** Permissions, hooks, and tool allow/deny lists live in settings.json, not `CLAUDE.md`. An exam item may offer "store permission rules in CLAUDE.md" as a plausible-sounding wrong answer.
  • Assuming the user-level `~/.claude/CLAUDE.md` is what a team shares -- it is personal, not committed to the repo; the project-level file is the team-shared one.
  • Forgetting that subdirectory-level files layer on top of (not replace) broader levels.

Key Takeaways

  • CLAUDE.md is auto-loaded project memory (conventions, commands, context), not executable configuration
  • Four hierarchy levels, broadest to most specific: enterprise/system, user (~/.claude/CLAUDE.md), project (./CLAUDE.md), subdirectory
  • More specific CLAUDE.md files layer on top of broader ones rather than replacing them
  • Project-level CLAUDE.md is committed to version control so the whole team shares the same guidance
  • /init bootstraps a starter CLAUDE.md from an existing codebase; permissions/hooks belong in settings.json, not CLAUDE.md

Glossary Terms

Related Concepts

PrepGenAICerts is an independent exam-prep site. It is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. Claude and Anthropic are trademarks of Anthropic, PBC. Exam details are taken from publicly available Anthropic and Pearson documentation. About PrepGenAICerts.