Allow opting out of parent CLAUDE.md auto-loading

Resolved 💬 2 comments Opened Mar 19, 2026 by AlexAndriesUiPath Closed Mar 19, 2026

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:

  1. A config option in .claude/settings.json (local or project-level):

``json
{ "ignoreParentClaudeMd": true }
``

  1. Support for .claudeignore patterns that apply to CLAUDE.md files
  1. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗