claude-code - 💡(How to fix) Fix [FEATURE] Option to exclude global CLAUDE.md from specific projects [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45259Fetched 2026-04-09 08:09:33
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Fix Action

Fix / Workaround

Current workarounds

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The global ~/.claude/CLAUDE.md is loaded into every session and its instructions accumulate with project-level files. There's no way to opt a specific project out of the global memory file.

This becomes a problem when:

  • A project has conventions that conflict with global preferences (e.g., global says "use Vitest" but the project uses Jest)
  • You're running specialized agents where the global context is irrelevant noise that wastes instruction budget
  • You want a clean-slate session for a particular repo without modifying your global file

Project-level CLAUDE.md can override on conflicts, but you still pay the token cost and risk instruction degradation from the accumulated rules. There's no way to say "don't load global memory for this project."

Proposed Solution

Any of these would work (not mutually exclusive):

  1. Project setting — A key in .claude/settings.json like "ignoreGlobalMemory": true that prevents ~/.claude/CLAUDE.md from being loaded for that project.
  2. CLI flag — Something like --no-global-memory for one-off sessions (less invasive than --bare, which disables much more).
  3. Selective imports — Allow project-level CLAUDE.md to declare something like <!-- ignore-global-memory --> to skip the global file.

Alternative Solutions

No response

Priority

Low - Nice to have

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

Current workarounds

  • Keeping the global CLAUDE.md nearly empty (defeats the purpose of having one)
  • Using project-level overrides for each conflicting rule (tedious, doesn't save token budget)
  • Using --bare (too aggressive — disables hooks, plugins, LSP, and skills too)

extent analysis

TL;DR

Implementing a project setting or CLI flag to ignore global memory could resolve the issue of conflicting global and project-level instructions.

Guidance

  • Consider adding a "ignoreGlobalMemory": true key to .claude/settings.json for projects that require isolation from global memory.
  • Introduce a --no-global-memory CLI flag for one-off sessions to prevent loading the global ~/.claude/CLAUDE.md file.
  • Evaluate the feasibility of allowing project-level CLAUDE.md files to declare an <!-- ignore-global-memory --> directive to skip the global file.
  • Assess the impact of keeping the global CLAUDE.md file minimal or using project-level overrides as temporary workarounds.

Example

// .claude/settings.json
{
  "ignoreGlobalMemory": true
}

This example demonstrates how a project could opt-out of loading the global memory file by adding a setting to its .claude/settings.json file.

Notes

The proposed solutions aim to address the issue without introducing significant changes to the existing architecture. However, the implementation details and potential side effects should be carefully evaluated.

Recommendation

Apply a workaround, such as keeping the global CLAUDE.md file minimal or using project-level overrides, until a more permanent solution like the proposed project setting or CLI flag is implemented. This approach allows for some level of isolation while minimizing the impact on the existing workflow.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING