autoMemoryDirectory: support project-root-relative paths (relative values are silently ignored)
Is your feature request related to a problem?
autoMemoryDirectory (settings.json) currently accepts only absolute paths. A relative value is silently ignored — verified on v2.1.170 (Windows 11 native + WSL Ubuntu 24.04): setting
{ "autoMemoryDirectory": "projects/_shared_context/agent_memory/claude-code" }
in a project's checked-in .claude/settings.json leaves auto-memory at the default ~/.claude/projects/<key>/memory/, with no warning.
This makes the setting impossible to commit portably for a repo opened from multiple environments. Concrete case: one working tree, two doors — Windows opens it as C:\AIStack, WSL opens the same tree as /mnt/c/AIStack. An absolute Windows path in the committed settings works on Windows but is silently unusable on the WSL side (falls back to the default), and vice versa. The workaround is a per-environment override file passed via --settings on every invocation.
Describe the solution you'd like
Resolve relative autoMemoryDirectory values against the project root (the same root used to derive the project key). A single committed line would then work everywhere the repo is opened, on any OS.
Alternatives considered
- Absolute path in project settings +
--settingsoverride per environment — works today, per-invocation friction. - User-scope setting per machine — not viable: the value is used as-is for all projects, so user scope would merge every project's memory into one directory.
${workspaceRoot}-style variable expansion would solve it equally well if bare relative paths are undesirable.
Additional context
Tested on v2.1.170: relative values ignored on both platforms; absolute values honored on both (POSIX form verified on WSL, Windows form on Windows). A logged warning when a value is ignored would also help discoverability.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗