[BUG] Auto-memory Write tool creates files inside project repo instead of user memory directory

Resolved 💬 3 comments Opened Apr 2, 2026 by leonardoauer Closed Apr 6, 2026

Description

When Claude Code's auto-memory system saves a memory file using the Write tool, it can write the file inside the project repository (e.g., <project-root>/.claude/projects/.../memory/) instead of the correct user-level memory directory (C:\Users\<user>\.claude\projects\<project>\memory\).

This means memory files (which contain personal feedback, user preferences, and project notes) end up tracked by git and could be accidentally committed and pushed to a remote repository.

Steps to Reproduce

  1. Open Claude Code on a project (Windows 11, CLI)
  2. Have auto-memory enabled
  3. During conversation, Claude decides to save a feedback memory
  4. Claude uses the Write tool with path: <project-root>/.claude/projects/C--Users-Leo-TI-HOME-VSCode-Workspace-NexusTrack/memory/feedback_appstate_language.md
  5. The file is created inside the project directory, not in C:\Users\Leo\.claude\projects\...\memory\

Expected Behavior

Memory files should always be written to the user-level directory: C:\Users\<user>\.claude\projects\<project-key>\memory\

They should never be created inside the project's working directory.

Actual Behavior

The Write tool created the file at:

C:\Users\Leo\TI_HOME\VSCode_Workspace\NexusTrack\.claude\projects\C--Users-Leo-TI-HOME-VSCode-Workspace-NexusTrack\memory\feedback_appstate_language.md

Instead of:

C:\Users\Leo\.claude\projects\C--Users-Leo-TI-HOME-VSCode-Workspace-NexusTrack\memory\feedback_appstate_language.md

Impact

  • Data leak risk: Personal memory/feedback files could be committed to git and pushed to a shared repo
  • Privacy concern: Memory files may contain user preferences, corrections, and personal context not intended for the repository

Environment

  • Claude Code CLI (Windows 11)
  • Model: Claude Opus 4.6 (1M context)
  • Platform: win32
  • Shell: bash

Related Issues

  • #36636 — autoMemoryDirectory setting does not update memory path in system prompt
  • #39204 — auto-dream ignores autoMemoryDirectory

View original on GitHub ↗

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