Feature request: Store project memory files in project-local .claude folder
Current Behavior
Project-specific memory files are stored in a global path:
~/.claude/projects/<encoded-project-path>/memory/MEMORY.md
Desired Behavior
Store memory files inside the project's own .claude/memory/ folder, e.g.:
<project-root>/.claude/memory/MEMORY.md
This is more intuitive — when working on multiple projects with separate sessions, users naturally expect each project's memory to live within that project's directory, not in a centralized global location.
Concern: Accidental Git Commits
Memory files contain personal session history and should never be committed to version control. To address this:
- If memory files are created in a project-local
.claude/folder (whether by user request or via a future feature/option), Claude Code should automatically ensure.claude/memory/is listed in.gitignorebefore any git commit. - If
.gitignoredoesn't exist, create it with the entry. - If
.gitignoreexists but doesn't include the path, append it.
This would make the feature safe by default while keeping the project structure clean and self-contained.
Additional Context
The project-level .claude/ folder already exists for shared settings like CLAUDE.md. Adding a memory/ subfolder there (with proper .gitignore protection) would be a natural extension of the existing structure.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗