What this guide covers
The table below lists each setting and what it accomplishes. The file tree after it is the example monorepo every code sample on this page refers to.Settings on this page
Each setting below is independent. They layer rather than replace each other, so apply whichever fit your repository. Choose where to start Claude determines where your settings files live, so read it first. Put it together shows all of them combined.The example monorepo
The examples throughout this page refer to a monorepo with three packages. The same patterns work in a large single-tree codebase: where an example usespackages/api/, substitute your own subsystem directory such as src/backend/ or lib/core/.
Choose where to start Claude
Where you launchclaude determines which files Claude can read and edit without an additional permission grant, which CLAUDE.md files load into context at startup, and which project settings apply.
Project settings in
.claude/settings.json load only from your starting directory and are not inherited from parent directories the way CLAUDE.md files are: a .claude/settings.json at the repository root applies only when you start from the root.
Each section below states whether its settings file belongs at the repository root or in the subdirectory you start from, and whether it is committed or kept local.
Layer CLAUDE.md files by directory
In a large codebase, a single CLAUDE.md at the repository root tends to either grow to cover every subsystem’s conventions, costing context on instructions unrelated to the current task, or stay too generic to be useful. Splitting instructions across per-directory files means Claude loads repository-wide rules plus only the conventions for the code you’re working in. Claude Code loads every CLAUDE.md file from your working directory and every parent directory at launch, then loads each subdirectory’s file on demand when it reads files there. A root file sets repository-wide rules and each subdirectory adds its own. A common split is two levels:- Root
CLAUDE.md: instructions that apply everywhere, such as coding standards, commit conventions, and repository layout - Per-subdirectory
CLAUDE.md: conventions specific to that area’s stack. In a monorepo that’s one per package. In a large single tree it’s one per subsystem such assrc/db/orsrc/api/
CLAUDE.md orients Claude to the repository structure:
CLAUDE.md
CLAUDE.md, here packages/api/CLAUDE.md, adds context specific to that area’s stack:
packages/api/CLAUDE.md