Claude Code now remembers what it learns between sessions
Written by Joseph Nordqvist/February 27, 2026 at 5:27 AM UTC
6 min read
Anthropic has rolled out an automatic memory feature for Claude Code, the company's command-line AI coding tool. Claude Code now writes its own notes — project patterns, debugging discoveries, user preferences — to a persistent MEMORY.md file that carries context between sessions without requiring the developer to manually record anything.[1][2]
The feature was announced on February 26, 2026, by Thariq Shihipar, an engineer at Anthropic who works on Claude Code.[1]
How it works
Claude Code's memory system now operates on a two-file model. CLAUDE.md is the developer's instruction file — coding standards, project rules, preferred workflows — written and maintained by the human. MEMORY.md is Claude's own scratchpad, written by the AI itself as it works.[1][2]
The auto memory is stored at ~/.claude/projects/<project>/memory/, with each project getting its own isolated directory derived from the git repository root.[2] The main MEMORY.md file is loaded into Claude's context at the start of every session, though only the first 200 lines are read automatically.[2][3] If a project's accumulated memory exceeds that limit, the system encourages developers to break it into separate topic files — debugging.md, api-conventions.md, patterns.md — and use MEMORY.md as a concise index pointing to them.[2][3]
The feature is enabled by default.[2] Developers can toggle it through the /memory command within a session, disable it globally via settings, or override everything with an environment variable (CLAUDE_CODE_DISABLE_AUTO_MEMORY=1) for CI and managed environments.[2]
When a developer tells Claude to remember something — "always use pnpm, not npm" or "the API tests require a local Redis instance" — Claude writes it to the memory file directly.[2] Claude is also instructed to check for existing entries before writing new ones, to avoid duplicates, and to remove entries when the developer says to forget something.[3]
What it saves (and doesn't)
According to the system prompt instructions visible in public changelog tracking, Claude is guided to save patterns that prove useful across multiple interactions: project-specific conventions, key commands, debugging approaches, and user preferences.[3] It is instructed not to save one-time information, anything that duplicates existing CLAUDE.md instructions, or speculative conclusions drawn from reading a single file.[3]
The memory is organized semantically by topic rather than chronologically, and Claude is expected to update or remove entries that prove incorrect or outdated.[3]
The community response
The feature first appeared around Claude Code version 2.1.32, according to a GitHub issue filed on February 6.[4] The initial rollout generated mixed reactions. Some developers appreciated the zero-configuration persistence. Others raised concerns about Claude writing a parallel set of instructions that the developer didn't author, couldn't easily review, and might conflict with their carefully maintained CLAUDE.md files.[4]
One developer on GitHub described discovering that Claude Code had added revised specifications for MCP servers to the memory file — specifications that overlapped with instructions already present in their CLAUDE.md. They had to manually transfer the contents and delete the memory file to resolve the conflict.[4]
Anthropic has since added the /memory toggle to let developers switch auto memory on or off independently from CLAUDE.md loading, as well as the environment variable override for automation contexts — addressing the original request in that GitHub issue.[2]
The broader memory picture
The auto memory feature sits within a broader hierarchy of context sources that Claude Code loads at startup. Enterprise-level CLAUDE.md files (managed by IT/DevOps) take highest precedence, followed by project-level CLAUDE.md files shared through version control, user-level personal preferences, project-local preferences, and finally auto memory.[2]
This layered approach means a company's coding standards always override project conventions, which override personal preferences, which override Claude's own recorded notes. The auto memory file is local to each developer's machine and never touches git.[2][3]
Brent Peterson, a developer who wrote about the feature after running it for several weeks, observed that across 13 projects and months of daily use, Claude had recorded only 19 lines of memory — mostly configuration fixes that kept recurring across sessions. His assessment: auto memory is useful, but it is automated configuration, not learning. The distinction matters because developers working with multiple memory layers — CLAUDE.md, MCP memory servers, and auto memory — must understand what each does and wire them together themselves.[5]
Why this matters
AI coding tools have long suffered from what developers call "context amnesia" — the complete loss of accumulated knowledge when a session ends or the context window compresses. GitHub Copilot, Cursor, and earlier versions of Claude Code all started each session with effectively zero knowledge of what happened before, forcing developers to re-explain project context repeatedly.
Claude Code's approach — giving the AI its own persistent, editable, project-scoped note-taking system that loads automatically — is a concrete step toward solving that problem. The 200-line limit and topic file system suggest Anthropic is thinking about how this scales: memory needs to be concise enough to fit in a context window alongside actual code, but detailed enough to be useful across weeks of development.
The announcement comes during a period of rapid iteration for Claude Code, which has also recently added agent teams (a research preview for multi-agent collaboration), partial conversation summarization, and a tool search feature that reduces token consumption from MCP server tool definitions.[6]
Written by
Joseph Nordqvist
Joseph founded AI News Home in 2026. He studied marketing and later completed a postgraduate program in AI and machine learning (business applications) at UT Austin’s McCombs School of Business. He is now pursuing an MSc in Computer Science at the University of York.
This article was written by the AI News Home editorial team with the assistance of AI-powered research and drafting tools. All analysis, conclusions, and editorial decisions were made by human editors. Read our Editorial Guidelines
References
- 1.
Claude Code auto-memory announcement — Thariq Shihipar, X (formerly Twitter), February 26, 2026
Primary - 2.
- 3.
Claude Code system prompt changelog — auto memory instructions — Marc Krenn, GitHub, February 26, 2026
- 4.
- 5.
- 6.
Was this useful?
Related
Google launches Nano Banana 2, bringing pro-level image generation to its Flash model
February 26, 2026
Anthropic launches Remote Control for Claude Code, enabling mobile access
February 25, 2026
Google rolls out Lyria 3 music generation in the Gemini app
February 18, 2026
Anthropic releases Claude Sonnet 4.6, bringing near-flagship performance to its mid-tier model
February 18, 2026