AI Memory

Claude Code Now Writes Its Own Memory Between Sessions

Auto-memory lets Claude Code record project patterns and preferences without manual setup.

Andrés Martínez
Andrés MartínezAI Content Writer
February 27, 20262 min read
Share:
Terminal window showing Claude Code memory directory structure with MEMORY.md and topic files

Anthropic's Claude Code now automatically records what it learns during coding sessions and carries that knowledge forward. The feature, called auto-memory, stores Claude's self-written notes in a per-project memory directory at ~/.claude/projects/<project>/memory/, separate from the user-maintained CLAUDE.md instruction files.

The distinction matters. CLAUDE.md files are instructions you write for Claude: your coding standards, preferred frameworks, common commands. Auto-memory is what Claude writes for itself, capturing debugging patterns, API conventions, and project quirks it discovers while working. Think of it as the difference between an onboarding doc and an engineer's personal notes.

Each project gets its own isolated memory directory, derived from the git repository root. A MEMORY.md file serves as the index, with optional topic files like debugging.md or api-conventions.md for detailed notes. Only the first 200 lines of MEMORY.md load into context at session start, a hard cap that nudges toward concise indexing rather than bloated dumps. You can manage everything through the /memory command or tell Claude directly: "remember that we use pnpm, not npm."

Auto-memory ships enabled by default. Developers who want manual control can disable it via CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 or toggle it off in /memory. Some users on GitHub have flagged concerns about Claude writing instructions they didn't review, and the opacity of what gets recorded. Anthropic's response: the files are plain Markdown, fully editable, sitting in your local filesystem.

This builds on Anthropic's broader memory rollout for the Claude chat interface, which reached Pro and Max subscribers in October 2025 after launching for Team and Enterprise users the month before. Auto-memory in Claude Code tackles a narrower problem: keeping an AI coding agent consistent across sessions on the same codebase.


Bottom Line

Claude Code's auto-memory writes a per-project MEMORY.md file capped at 200 lines, loading learned patterns into every new session by default.

Quick Facts

  • Auto-memory enabled by default in Claude Code
  • Storage: ~/.claude/projects//memory/MEMORY.md
  • Hard limit: first 200 lines of MEMORY.md loaded per session
  • Per-project isolation based on git repository root
  • Disable via CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 or /memory toggle
Tags:Claude CodeAnthropicauto-memorydeveloper toolsAI codingpersistent memory
Andrés Martínez

Andrés Martínez

AI Content Writer

Andrés reports on the AI stories that matter right now. No hype, just clear, daily coverage of the tools, trends, and developments changing industries in real time. He makes the complex feel routine.

Related Articles

Stay Ahead of the AI Curve

Get the latest AI news, reviews, and deals delivered straight to your inbox. Join 100,000+ AI enthusiasts.

By subscribing, you agree to our Privacy Policy. Unsubscribe anytime.

Claude Code Auto-Memory: Learning Between Sessions | aiHola