Allow opting out of parent CLAUDE.md auto-loading
Problem
In monorepos where different teams own different subdirectories (e.g., C# backend at root, Angular frontend in a subdirectory), Claude Code auto-loads every CLAUDE.md from the cwd up to the git root. There is no way to opt out of this.
This means the frontend team gets the backend's root CLAUDE.md injected into every session — adding irrelevant context, consuming the context window, and potentially conflicting with their own instructions.
Why existing workarounds don't work
.claudeignore— doesn't apply to CLAUDE.md auto-loading- Editing the root CLAUDE.md — owned by another team, can't modify it
- Starting Claude from the subdirectory — still walks up to git root
- Separate git repo / submodule — too disruptive a structural change just for this
Proposed Solution
Any of these would work:
- A config option in
.claude/settings.json(local or project-level):
``json``
{ "ignoreParentClaudeMd": true }
- Support for
.claudeignorepatterns that apply to CLAUDE.md files
- A directive inside a child CLAUDE.md that stops the upward walk:
``markdown``
<!-- claude:root -->
Use Case
Monorepos with multiple teams/stacks sharing a single git repository, where each team has its own CLAUDE.md scoped to their part of the codebase.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗