#CLAUDE.md
9 articles
-
CLAUDE.md vs AGENTS.md vs GEMINI.md: keep one source of truth across three tools
How Claude Code, Codex and Gemini CLI load their context files, and how to keep one source of truth with imports, context.fileName and symlinks instead of three copies.
-
Does # add to CLAUDE.md in Claude Code? What the current docs say
You typed # expecting it to append to CLAUDE.md, and nothing happened. Here is what the official docs actually say, and the three documented ways to add to CLAUDE.md.
-
Log which CLAUDE.md files Claude Code loads, and when, with the InstructionsLoaded hook
Use the InstructionsLoaded hook to record every CLAUDE.md and .claude/rules/ file as it enters context: matcher values, input JSON fields, a logging example, and its limits.
-
Scope Claude Code rules to specific files with .claude/rules/ and paths frontmatter
When CLAUDE.md gets long, move topics into .claude/rules/ and add paths frontmatter so a rule loads only when Claude touches matching files: glob syntax, timing, user-level rules.
-
Stop Claude Code loading other teams' CLAUDE.md files with claudeMdExcludes
Keep a monorepo root or another team's CLAUDE.md out of your context with claudeMdExcludes: pattern syntax, which settings file to use, what cannot be excluded, and how to verify.
-
What Claude Code's /init puts in CLAUDE.md, and what to change afterwards
What the /init command inspects and writes into CLAUDE.md, how it behaves when a file already exists, what to cut and add after generation, and how to confirm the file loads.
-
When does Claude Code load a CLAUDE.md in a subdirectory? Monorepo layout and how to check
When Claude Code loads a CLAUDE.md in a subdirectory, how it combines with the root file, a monorepo layout that keeps context small, and how to check with /memory.
-
Why the CLAUDE.md in a --add-dir directory is not loaded, and the setting that fixes it
A --add-dir directory does not load its CLAUDE.md by default. What CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD changes, which files it covers, and how to make it permanent.
-
How to write CLAUDE.md: the three levels (user, project, directory) and a ready-to-use template
Where Claude Code looks for CLAUDE.md, which level wins, what belongs in it and what does not, plus a template you can drop into a small or medium web project today.