CLAUDE.md Configuration Hierarchy
CoreConfigure CLAUDE.md files with appropriate hierarchy, scoping, and modular organization · Difficulty 2/5
Claude Code reads project instructions from multiple configuration sources with a specific precedence order.
Configuration Sources
CLAUDE.md or .claude/CLAUDE.md -- loaded for every conversationCLAUDE.md files -- additive context when working in those directories~/.claude/CLAUDE.md -- personal instructions, lowest priority, not version-controlled.claude/rules/ files with optional glob patterns -- topic-specific, conditionally loadedKey Rules
Common Mistake
Team puts guidelines in each developer's ~/.claude/CLAUDE.md instead of the project's .claude/CLAUDE.md. New developers who join don't receive those guidelines. Solution: move shared guidelines to project scope.
The /memory Command
Use /memory to verify which memory files are loaded and diagnose inconsistent behavior across sessions. This helps identify when instructions are missing or incorrectly scoped.
Key Takeaways
- ✓Project CLAUDE.md is loaded for every conversation; user-level has lowest priority
- ✓Shared team guidelines must be in project scope, not user scope
- ✓CLAUDE.md is read fresh each session, no cross-session caching
- ✓Use /memory to verify which configuration files are loaded
Related Concepts
Test Yourself1 of 3
Your CLAUDE.md has over 400 lines. You want Claude to always follow coding standards and testing conventions, but only apply PR review, deployment, and migration guidance when performing those tasks. What's the most effective restructuring?