Preflight Checklist
Problem Statement
When working in a subdirectory of a large monorepo, Claude Code recursively loads all parent CLAUDE.md files into context with no way to opt out. This causes large irrelevant documentation to consume context tokens unnecessarily, thereby degrading performance and usefulness of Claude Code.
Per the memory documentation:
Claude Code reads memories recursively: starting in the cwd, Claude Code recurses up to (but not including) the root directory / and reads any CLAUDE.md or CLAUDE.local.md files it finds.
This behavior is problematic for monorepos with multiple teams/tech stacks where parent-level documentation is irrelevant to subdirectory work.
Example Scenario
monorepo/
├── CLAUDE.md (40k+ chars - Go microservices docs)
├── services/
│ ├── ui-app/ # Frontend app
│ │ ├── CLAUDE.md # Frontend-specific docs
│ │ └── packages/
│ │ └── app/ # <- Working directory
│ │ └── CLAUDE.md
Currently loaded: All 3 CLAUDE.md files, including backend Go service documentation that's irrelevant to the working directory.
Desired: Only load the 2 UI-related CLAUDE.md files, excluding the one in root directory.
Proposed Solution
The ideal solution is some sort of setting or configuration knob to customize CLAUDE.md loading, that can be checked in to main repo (something akin to a .gitignore).
Alternative Solutions
Tried denying permission to read from CLAUDE.md in .claude/settings.json - this doesn't work as this controls tool uses by Claude Code but not auto-loading CLAUDE.md into the context window.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
No response
Additional Context
Related issues:
Preflight Checklist
Problem Statement
When working in a subdirectory of a large monorepo, Claude Code recursively loads all parent
CLAUDE.mdfiles into context with no way to opt out. This causes large irrelevant documentation to consume context tokens unnecessarily, thereby degrading performance and usefulness of Claude Code.Per the memory documentation:
This behavior is problematic for monorepos with multiple teams/tech stacks where parent-level documentation is irrelevant to subdirectory work.
Example Scenario
Currently loaded: All 3 CLAUDE.md files, including backend Go service documentation that's irrelevant to the working directory.
Desired: Only load the 2 UI-related CLAUDE.md files, excluding the one in root directory.
Proposed Solution
The ideal solution is some sort of setting or configuration knob to customize CLAUDE.md loading, that can be checked in to main repo (something akin to a .gitignore).
Alternative Solutions
Tried denying permission to read from CLAUDE.md in .claude/settings.json - this doesn't work as this controls tool uses by Claude Code but not auto-loading CLAUDE.md into the context window.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
No response
Additional Context
Related issues:
~/.claude/CLAUDE.mdbased on working directory (closed as duplicate of Context Duplication in Worktrees Causing Excessive Context Consumption #3232)