autoMemoryDirectory Setting for Custom Auto-Memory Storage

Claude Code

Claude Code v2.1.74 introduces the autoMemoryDirectory setting, allowing developers to configure a custom directory for auto-memory storage instead of the default project-scoped location. This long-requested feature enables scenarios such as storing auto-memory in a git-tracked location for cross-machine synchronization, team-shared memory across repositories, or custom backup setups. The setting is intentionally restricted to user and local settings β€” not project settings β€” to prevent shared project configs from redirecting memory writes to unintended locations.


autoMemoryDirectory: Custom Storage for Claude Code's Auto-Memory

Claude Code's auto-memory system lets the tool accumulate knowledge across sessions β€” build commands, debugging patterns, architecture notes, and preferred workflows β€” without requiring developers to maintain memory files manually. Since its introduction, the default storage location has been fixed: ~/.claude/projects/<project>/memory/, derived from the git repository root so all worktrees and subdirectories share a common memory pool.

With v2.1.74, Anthropic introduces the autoMemoryDirectory setting, giving developers full control over where auto-memory is stored.

What Changes

The new autoMemoryDirectory setting can be added to user or local settings and accepts any valid directory path. When set, Claude Code writes auto-memory entries to the specified directory instead of the default project-scoped location.

{
  "autoMemoryDirectory": "~/sync/my-project-memory"
}

This is a deliberate design choice: the setting is accepted from policy, local, and user settings, but not from project settings (.claude/settings.json). This prevents a shared project configuration from silently redirecting memory writes to sensitive or unexpected locations β€” a meaningful security consideration in team environments.

Use Cases

The most common motivation for this feature is cross-machine synchronization. Developers who use Claude Code across multiple machines can point autoMemoryDirectory to a directory tracked in a personal dotfiles or notes repository, keeping memory in sync via git. Teams exploring shared knowledge bases can also use this to consolidate auto-memory across multiple projects into one location.

A second major use case is monorepo and read-only root setups, where the project root directory may be read-only or managed by a build system. The new setting allows auto-memory to be redirected to a writable location outside the project tree without disabling the feature entirely.

Context

This feature was a highly requested addition, tracked in the community since auto-memory launched in Claude Code v2.1.59. The autoMemoryDirectory setting is the first configurability extension to the auto-memory system since launch, reflecting Anthropic's continued investment in making the feature production-grade for teams and power users.