Study FAQ
How should I initialize and organize Claude Code instructions for a repository?
Also asked as 2
- What should go in CLAUDE.md versus path-specific Rules?
- How do I use Claude Code /init and check which repository instructions it loaded?
Answer
Start Claude Code in the intended repository and use a concise CLAUDE.md for broadly applicable build and test commands, navigation, conventions, and review expectations. Put independently maintained guidance in .claude/rules/; use documented path targeting where a rule applies only to certain files. Inspect /memory to confirm which instruction and memory files are active.
You can run /init to create a starting file or suggest improvements to an existing one. Review the output against the repository’s build and contribution files, verify each command and path, and check it for guesses, secrets, and duplication before adoption. Keep reviewed team guidance in version control and private workstation preferences in an appropriate local scope.
Instructions can accumulate from managed, user, project, and more specific locations. If a rule seems absent, check the working directory, its path pattern, and when the file enters context. Tighten contradictory instruction text rather than adding another version of the same rule. Put requirements that must be enforced in the applicable test, hook, permission rule, or managed policy.
Full explanation
Claude Code Operation, Configuration, and Extension Surfaces
Study guide · CCDV-F
Read the full explanation