← Reddit

Claude Code's Auto Memory remembers your corrections across sessions — here's how it works (and where it hides the files)

Reddit · israynotarray · June 16, 2026
Claude Code now includes Auto Memory (v2.1.59+), which learns from user corrections and preserves them across sessions separately from the CLAUDE.md project rules file. Memory files are stored locally at ~/.claude/projects/<your-project>/memory/ rather than in the project repository, with only the first 200 lines or 25KB loading each session to prevent context bloat. The feature can be managed through commands like "remember:" and "forget:", and the memory persists through conversation compaction because it exists on disk rather than in chat history.

Detailed Analysis

Anthropic's Claude Code has introduced an Auto Memory feature, available from version 2.1.59 onward, that addresses one of the most persistent friction points in AI-assisted development workflows: the loss of user preferences and corrections between sessions. Previously, developers using Claude Code would need to repeatedly re-instruct the model on stylistic preferences or toolchain conventions at the start of each new conversation. Auto Memory resolves this by allowing Claude itself to identify, record, and reload relevant corrections and learned preferences automatically, without requiring manual documentation from the user.

The feature operates as a distinct system from the existing CLAUDE.md mechanism, a distinction that carries meaningful architectural implications. CLAUDE.md functions as a manually authored, project-level ruleset that loads in full at the start of every session — essentially a static configuration document managed by the developer. Auto Memory, by contrast, is dynamically authored by Claude itself based on what it infers is worth retaining from user interactions. It stores these notes in topic-specific files under a user's home directory at `~/.claude/projects/<project-path>/memory/`, deliberately separated from the project repository's `.claude/` folder. This separation ensures that Auto Memory files do not accidentally enter version control or get shared with collaborators, since the notes are personal, machine-local, and not synced to any cloud infrastructure.

The storage architecture reveals thoughtful engineering around context window efficiency. Rather than loading all accumulated memory into each session indiscriminately, the system uses a MEMORY.md index file capped at 200 lines or 25KB per session load, with individual topic files read lazily on demand. This design prevents memory from becoming a context bloat problem as usage accumulates over time. The feature also survives Claude Code's `/compact` command, which compresses chat history but leaves disk-based files untouched — meaning MEMORY.md and CLAUDE.md are re-read from disk after compaction, preserving continuity without inflating the conversation context.

The broader significance of Auto Memory lies in what it signals about the maturation of agentic developer tools. Early iterations of AI coding assistants treated each session as stateless, placing the full burden of context-setting on the user. Features like Auto Memory represent a shift toward persistent, adaptive tooling that accumulates useful state over time — moving closer to the behavior of a long-term collaborator rather than a stateless query engine. The decision to tie memory storage to the git repository path, with subdirectories and worktrees sharing a single memory namespace, also reflects an awareness of real-world developer workflows involving monorepos and branching strategies.

The practical question the article's author raises — what belongs in Auto Memory versus CLAUDE.md — is itself indicative of a broader design tension in AI tooling between user-controlled configuration and model-driven inference. CLAUDE.md is appropriate for stable, project-wide conventions that all contributors or sessions should respect, while Auto Memory is better suited to personal, evolving preferences that emerge organically from use. As these systems grow more sophisticated, the boundary between what developers explicitly configure and what AI systems learn implicitly is likely to become an increasingly important design consideration across the industry.

Article image Read original article →