Session memory should not be scoped to working directory path
Resolved 💬 4 comments Opened Apr 29, 2026 by kmathewmk Closed Jun 4, 2026
Currently, Claude Code's auto-memory system stores memories under a path derived from the working directory (e.g. .claude/projects/-home-user-scm-myproject/memory/). This means:
- Moving or renaming a project directory silently orphans all accumulated memory.
- Switching to a different workspace for the same work starts a blank session with no prior context.
- There is no way to resume a session's memory from a different directory without manually copying files.
Expected behaviour: Memory should be associated with a named session or project identifier that the user controls, not the filesystem path. This would allow memory to survive project moves, renames, and workspace switches.
Suggested fix: Allow users to assign a named project ID (e.g. in CLAUDE.md or a config flag) that is used as the memory key instead of the directory path. The directory-derived key could remain as the default for backwards compatibility.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗