Add setting to exclude files from memory loading

Resolved 💬 5 comments Opened Jan 22, 2026 by acushner-rippling Closed Feb 28, 2026

Problem

When a project's CLAUDE.md references files via @filename syntax (e.g., @pyproject.toml), those files are automatically loaded into context as memory. There's currently no way to exclude specific files from memory loading without modifying the committed CLAUDE.md file.

The permissions.deny setting with Read() patterns successfully blocks the Read tool from accessing files, but it does not prevent files from being auto-loaded as memory at startup.

Use Case

In a shared codebase, the committed CLAUDE.md may include @pyproject.toml or other large files that are useful for some workflows but consume significant context tokens (e.g., 8k+ tokens for a large pyproject.toml). Individual developers should be able to locally exclude these from memory loading without modifying the shared config.

Proposed Solution

Add a memory.exclude (or similar) setting that can be configured in .claude/settings.local.json to exclude specific files from being loaded as memory:

{
  "memory": {
    "exclude": [
      "./pyproject.toml",
      "./CLAUDE.md"
    ]
  }
}

This would allow:

  • Local overrides without modifying committed files
  • Reducing context usage for users who don't need certain referenced files
  • More control over which memory files are loaded

Current Behavior

  • permissions.deny with Read(./file) blocks the Read tool but does not prevent memory loading
  • No way to exclude auto-loaded memory files via settings

Expected Behavior

A setting that allows excluding specific files from memory loading, respecting the existing settings precedence (local settings override shared settings).

View original on GitHub ↗

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