ダブルクリックで英日反転
Applied Sciences · Engineering
Claude Code's CLAUDE.md Hierarchy — Which Instructions Reach How Far
CLAUDE.md is the instruction sheet Claude Code loads automatically into every conversation. Multiple files across a hierarchy all load together — none is skipped.
The Four Layers
- Managed policy (company-issued PC) — highest priority, cannot be excluded
- User global (~/.claude/CLAUDE.md) — shared across all your projects
- Project parent-ancestor — applies to every repo under that folder
- Repo-specific (repo root) — narrowest scope, read last
Conflict Resolution: Lower Wins
- All applicable files are concatenated and handed to the AI together
- Reading order determines priority — the lower (more specific) file is read later and wins
- Flatly contradictory rules across layers cause the AI to waver; delete duplicates
CLAUDE.md vs settings.json
- CLAUDE.md = natural-language instructions for the AI ("behave like this")
- settings.json = tool-level config (permissions, hooks) executed by Claude Code itself
- Automation like "reformat on save" belongs in hooks, not CLAUDE.md
Placement Guide
- Cross-project preference → global ~/.claude/CLAUDE.md
- Team/company rules → CLAUDE.md in a shared parent folder
- Repo-only agreements → CLAUDE.md at the repo root
- Rule of thumb: the wider the audience, the higher up you write it
→ Every layer loads; when layers conflict, the more specific (lower) file wins — "only global takes effect" is a myth.
Applied Sciences · Engineering
Claude Code の CLAUDE.md 階層 — 指示はどの範囲まで届くか
CLAUDE.md は Claude Code(ターミナルで動く AI 開発ツール)が毎回自動で読み込む指示書。階層内の複数ファイルはすべて同時に読み込まれ、スキップされるものはない。
4 つの層
- 管理ポリシー(会社支給 PC)— 最優先・除外不可
- ユーザーグローバル(~/.claude/CLAUDE.md)— 全プロジェクト共通
- プロジェクト祖先ディレクトリ — その配下の全リポに適用
- リポ固有(リポルート)— 最も狭いスコープ・最後に読まれる
競合時のルール:下位が勝つ
- 該当するファイルはすべて連結(concatenate)されて AI に渡される
- 読み込み順が優先度を決める — より下位(具体)のファイルが後から読まれ優先される
- 層をまたいで真っ向矛盾する指示があると AI が揺れる → 重複削除を推奨
CLAUDE.md と settings.json の違い
- CLAUDE.md = AI への自然言語指示(「こう振る舞え」)
- settings.json = ツール本体の設定(権限・フック)。AI ではなく Claude Code が実行
- 「保存時に自動整形」などの自動化はフック(hook)に書く — CLAUDE.md ではない
どの層に書くか
- 全プロジェクト共通の好みは ~/.claude/CLAUDE.md
- チーム・会社ルールは共有親フォルダの CLAUDE.md
- リポ限定の取り決めはリポルートの CLAUDE.md
- 判断基準:「誰に・どこまで届けたいか」で置く高さを決める
→ 全層が読み込まれ、競合時は下位(より具体的)なファイルが勝つ。「グローバルだけが効く」は誤解。
Applied Sciences · Engineering
Claude Code's CLAUDE.md Hierarchy — Which Instructions Reach How Far
CLAUDE.md is the instruction sheet Claude Code loads automatically into every conversation. Multiple files across a hierarchy all load together — none is skipped.
The Four Layers
- Managed policy (company-issued PC) — highest priority, cannot be excluded
- User global (~/.claude/CLAUDE.md) — shared across all your projects
- Project parent-ancestor — applies to every repo under that folder
- Repo-specific (repo root) — narrowest scope, read last
Conflict Resolution: Lower Wins
- All applicable files are concatenated and handed to the AI together
- Reading order determines priority — the lower (more specific) file is read later and wins
- Flatly contradictory rules across layers cause the AI to waver; delete duplicates
CLAUDE.md vs settings.json
- CLAUDE.md = natural-language instructions for the AI ("behave like this")
- settings.json = tool-level config (permissions, hooks) executed by Claude Code itself
- Automation like "reformat on save" belongs in hooks, not CLAUDE.md
Placement Guide
- Cross-project preference → global ~/.claude/CLAUDE.md
- Team/company rules → CLAUDE.md in a shared parent folder
- Repo-only agreements → CLAUDE.md at the repo root
- Rule of thumb: the wider the audience, the higher up you write it
→ Every layer loads; when layers conflict, the more specific (lower) file wins — "only global takes effect" is a myth.
Applied Sciences · Engineering
Claude Code の CLAUDE.md 階層 — 指示はどの範囲まで届くか
CLAUDE.md は Claude Code(ターミナルで動く AI 開発ツール)が毎回自動で読み込む指示書。階層内の複数ファイルはすべて同時に読み込まれ、スキップされるものはない。
4 つの層
- 管理ポリシー(会社支給 PC)— 最優先・除外不可
- ユーザーグローバル(~/.claude/CLAUDE.md)— 全プロジェクト共通
- プロジェクト祖先ディレクトリ — その配下の全リポに適用
- リポ固有(リポルート)— 最も狭いスコープ・最後に読まれる
競合時のルール:下位が勝つ
- 該当するファイルはすべて連結(concatenate)されて AI に渡される
- 読み込み順が優先度を決める — より下位(具体)のファイルが後から読まれ優先される
- 層をまたいで真っ向矛盾する指示があると AI が揺れる → 重複削除を推奨
CLAUDE.md と settings.json の違い
- CLAUDE.md = AI への自然言語指示(「こう振る舞え」)
- settings.json = ツール本体の設定(権限・フック)。AI ではなく Claude Code が実行
- 「保存時に自動整形」などの自動化はフック(hook)に書く — CLAUDE.md ではない
どの層に書くか
- 全プロジェクト共通の好みは ~/.claude/CLAUDE.md
- チーム・会社ルールは共有親フォルダの CLAUDE.md
- リポ限定の取り決めはリポルートの CLAUDE.md
- 判断基準:「誰に・どこまで届けたいか」で置く高さを決める
→ 全層が読み込まれ、競合時は下位(より具体的)なファイルが勝つ。「グローバルだけが効く」は誤解。
Related notes
- Agentic Commerce — ACP and Visibility into Being 'Bought by AI'
- AI Search Evaluation: The 12 Metrics — Gateway
- AI Search Evaluation ①Citation Rate — How Many URLs Are Pulled In Per Answer
- AI Search Evaluation ②Source Diversity — How Unskewed the Cited Sources Are
- AI Search Evaluation ③Accuracy Score — How Often It Answers Factual Questions Correctly
- AI Search Evaluation ④Answer Length — How Many Characters It Returns to the User on Average