Claude Memory: How Claude and Claude Code Remember
Claude memory explained: the memory feature in the Claude apps, CLAUDE.md and auto memory in Claude Code, and what the third-party claude-mem plugin adds.
Josh Pocock10 min read
AI Coding
Claude memory
Stride AI Academy
Claude memory works in three different ways depending on where you use Claude. In the Claude apps, memory saves topics from your chats and brings them into new ones. In Claude Code, memory is two kinds of plain markdown file: CLAUDE.md files you write, and auto memory notes Claude writes for itself. A third option, claude-mem, is an open-source plugin from an outside developer that records your Claude Code sessions and feeds a summary back in later.
The app and Claude Code facts below come from Anthropic's help center article on memory and the Claude Code memory docs, checked November 7, 2026. The claude-mem section comes only from its GitHub README, read the same day.
Claude memory at a glance
| Claude apps memory | Claude Code CLAUDE.md | Claude Code auto memory | claude-mem plugin | |
|---|---|---|---|---|
| Made by | Anthropic | Anthropic | Anthropic | Third-party, open source |
| Who writes it | Claude, from your chats | You | Claude | A second AI model that watches your sessions |
| Where it lives | Your Claude account | Files in your project or ~/.claude/ |
~/.claude/projects/<project>/memory/ |
~/.claude-mem on your machine |
| On by default | Yes on Free, Pro, Max and Ultra | Loads whenever the file exists | Yes in local sessions | No, you install it |
| Cost | Included in your plan | Free | Free | Uses model calls, see below |
Three layers of Claude memory
- 1
Claude apps memoryTopics saved from your chats on claude.ai, Desktop and mobile
- 2
Claude Code CLAUDE.mdRules you write, loaded at the start of every session
- 3
Claude Code auto memoryNotes Claude writes about your preferences and corrections
- 4
claude-mem (optional, third-party)Records tool activity and injects a summary into later sessions
Memory in the Claude apps
On claude.ai, Claude Desktop and the mobile apps, memory saves information as individual topics while you chat. It doesn't wait to summarize a conversation after it ends. You can also tell Claude to remember something directly, or ask it to change or forget a memory.
Memory is on by default for Free, Pro, Max and Ultra accounts. On Team and Enterprise, the organization owner decides.
Turn memory on or off
- Open Settings > Your Claude (older layouts call it Settings > Memory).
- Switch Generate memory from chats on or off.
- To see what's stored, select Manage next to Your memory. Each topic is listed under Topics, where you can read, edit or delete it.
Two other controls sit on the same page. Pause memory keeps what's saved but stops Claude using it or adding to it. Reset memory permanently deletes every memory, including project memories, and can't be undone.
Chat search is a separate feature
Searching past chats is not the same as memory. On paid plans (Pro, Max, Ultra, Team and Enterprise), you can ask "What did we discuss about this?" and Claude searches your old conversations. Turn it off with Search and reference chats in the same settings page.
Projects, one-off chats and incognito
- Projects have their own memory. Inside a project, Claude uses that project's memory plus your account memory, but not memory from other projects. To keep a project fully separate, turn off Use account memory on the project's page.
- Skip memory for one chat by clicking + in a new chat and turning off Memory before you send the first message. The chat still shows in your history and can be searched.
- Incognito chats (the ghost icon on a new chat) aren't saved to history or memory at all.
What it won't save
By default, Claude doesn't save sensitive topics such as health, religious beliefs or politics. You can opt in with Include sensitive topics in memory. Some things are never saved even if you ask: government ID numbers, criminal history, financial account numbers and immigration status.
On Team and Enterprise, owners control memory under Organization settings > Capabilities, but they can't read a member's memories.
Claude Code memory: CLAUDE.md and auto memory
Every Claude Code session starts with a fresh context window. Two things carry knowledge from one session to the next:
- CLAUDE.md files: instructions you write
- Auto memory: notes Claude writes for itself based on your corrections and preferences
Both load at the start of every session. Claude treats them as context, not as rules it can't break. If you need to block an action no matter what, use a hook instead. Our Claude Code hooks tutorial shows how.
CLAUDE.md vs auto memory
CLAUDE.md
You write it
- Build commands, coding standards, project layout
- Project, user or organization scope
- Shared with your team through git
- Whole file loads at launch
Auto memory
Claude writes it
- Your preferences and corrections
- One folder per repository, shared across worktrees
- Stays on your machine only
- First 200 lines or 25KB of
MEMORY.mdloads
Where CLAUDE.md files go
Claude Code reads CLAUDE.md files from four scopes. They load from the broadest to the most specific, so a project instruction lands after a user instruction:
| Scope | Location | Shared with |
|---|---|---|
| Managed policy | macOS: /Library/Application Support/ClaudeCode/CLAUDE.md, Linux and WSL: /etc/claude-code/CLAUDE.md, Windows: C:\Program Files\ClaudeCode\CLAUDE.md |
Everyone in the organization |
| User | ~/.claude/CLAUDE.md |
Only you, in every project |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md |
Your team, through source control |
| Local | ./CLAUDE.local.md (add it to .gitignore) |
Only you, in this project |
Claude Code loads these files from your working directory and every folder above it. They add up rather than override each other. CLAUDE.md files in subfolders load later, once Claude reads or edits a file in that subfolder.
If your repository has an AGENTS.md and no CLAUDE.md, Claude Code reads the AGENTS.md instead. If both exist, it reads the CLAUDE.md files only, unless your CLAUDE.md imports AGENTS.md.
Create your first CLAUDE.md
Run this inside a session in your project:
/initClaude looks through your codebase and writes a starting CLAUDE.md with build commands, test steps and conventions it finds. If you already have one, /init suggests improvements instead of overwriting it.
Anthropic suggests keeping each CLAUDE.md under 200 lines, because longer files use more context and Claude follows them less reliably. Write instructions you can check, like "Run npm test before committing" rather than "Test your changes." For copyable templates, see our CLAUDE.md file examples.
To confirm which files loaded, run:
/context alland look under Memory files.
Import other files
A CLAUDE.md can pull in other files with @ followed by a path:
See @README for project overview and @package.json for available npm commands.
# Additional Instructions
- git workflow @docs/git-instructions.mdRelative paths resolve from the file that holds the import. Imports can nest up to four hops deep. Imported files load with the CLAUDE.md that imports them, so they help you organize a file but don't save context. The first time a project imports a file from outside your working directory, Claude Code asks you to approve it.
Split rules by topic
For bigger projects, put topic files in .claude/rules/, such as testing.md or api-design.md. A rule can apply only to certain files by adding paths frontmatter:
---
paths:
- "src/api/**/*.ts"
---
# API Development Rules
- All API endpoints must include input validationThat rule only loads when Claude works on a matching file. Personal rules for every project go in ~/.claude/rules/.
How auto memory works
Auto memory is on by default in local sessions. As Claude works, it saves four kinds of note:
user: your role, expertise and working preferencesfeedback: corrections you give and approaches you confirmproject: ongoing work, deadlines and decisions it can't get from the codereference: where to find things outside the project, like an issue tracker
It skips anything it can read from the code, such as file paths or architecture, and anything your CLAUDE.md already says. It doesn't save something every session.
Each project gets one folder at ~/.claude/projects/<project>/memory/. Every worktree and subfolder of the same git repository shares it. Inside is a MEMORY.md index with one line per memory, plus one file per memory. The first 200 lines or 25KB of MEMORY.md, whichever comes first, loads at the start of each session. Auto memory stays on your machine and isn't shared across machines or cloud environments.
When you see "Saved 2 memories" or "Recalled 2 memories" in Claude Code, that's auto memory at work. If you say "remember that the API tests need a local Redis instance," Claude saves it to auto memory. Say "add this to CLAUDE.md" if you want it in the file instead.
Use the /memory command
/memoryThis lists your CLAUDE.md, CLAUDE.local.md and other memory files across user and project scopes. Pick one to open it in your editor. It also has the auto memory toggle and a link to the auto memory folder, so you can read, edit or delete anything Claude saved.
To turn auto memory off for one project, add this to that project's settings file:
{
"autoMemoryEnabled": false
}To turn it off with an environment variable, set CLAUDE_CODE_DISABLE_AUTO_MEMORY=1. To store it somewhere else, set autoMemoryDirectory in settings.json to an absolute path or one starting with ~/.
Subagents don't get the main conversation's auto memory. A subagent can keep its own with the memory field, which our subagents tutorial covers.
claude-mem: the third-party memory plugin
claude-mem is not made by Anthropic. It's an open-source project on GitHub by thedotmack, licensed under Apache 2.0. Everything in this section describes it from its own README. We haven't installed or tested it.
What it does
claude-mem records what happens in your coding sessions and gives later sessions a short summary of it. Per the README, it works in five parts:
- Hooks pass each tool call (reads, edits, commands) to a local worker.
- A worker, a local HTTP service managed by Bun, receives that activity.
- An observer, a second AI model, turns the activity into short observations and writes a summary when the session ends.
- A database in SQLite stores sessions, observations and summaries, with Chroma added for semantic search.
- Search tools over MCP (
search,timelineandget_observations) let Claude look up an index first, then pull full details only for the items it picks.
Memory starts showing up from your second session in a project. It also works with other coding agents, including Codex, Cursor and OpenCode. A web viewer runs at /viewer on the worker URL it prints at startup.
How to install it
The README gives two routes. The installer:
npx claude-mem installOr the Claude Code plugin commands:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-memThe README warns that npm install -g claude-mem installs only the library and doesn't set up the hooks or worker. It needs Node.js 20.19 or later in the 20.x line, or 22.12 or later. Bun and uv install themselves if missing. If something breaks, npx claude-mem doctor checks the setup. The installer also asks whether to turn off Claude Code's built-in auto memory. For how plugins work in general, see our Claude Code plugins guide.
Where data goes, and privacy
- Memory lives in
~/.claude-memon your machine, with the database at~/.claude-mem/claude-mem.dband settings in~/.claude-mem/settings.json. - Cloud sync is opt-in.
- Wrap anything in
<private>tags and the README says it's never stored. - Anonymous usage analytics are on by default. Turn them off with
npx claude-mem telemetry disable. - Converted copies of tool screenshots are kept under
~/.claude-mem/media-v1/by default. A "Keep images" switch in its settings turns that off.
What it costs
The observer is an AI model, so claude-mem uses model calls on top of your normal work. After you sign in, you pick a memory provider: the claude-mem observer, your own OpenRouter or Gemini key, or your Anthropic plan. The claude-mem observer starts a 30-day free trial that asks for a payment method. When the trial ends, memory falls back to your Anthropic plan unless you subscribe. The README doesn't list a price.
Which Claude memory should you use?
Picking the right memory
- 1Chatting on claude.ai, Desktop or mobile?Leave app memory on and check Manage now and then
- 2Coding in Claude Code?Write a short CLAUDE.md with /init and let auto memory run
- 3Want a searchable log of every past session?Consider claude-mem, after reading its privacy and cost notes
- 4Need Claude to never do something?Use a hook, not memory
For most people, the built-in options are enough. In Claude Code, CLAUDE.md holds your team's rules and auto memory picks up your personal corrections, both as free plain files you can edit.
Look at claude-mem if you want a full, searchable history of what Claude did across many sessions and agents. Read its README first, because it sends your session activity to a second model, it turns on analytics by default, and its default observer moves to a paid plan after the trial.
New to Claude Code? Start with how to install it. To use these setups for paid client work, the Claude Code for agencies course walks through it, and members share their CLAUDE.md files in the Claude Code community.
FAQ
Does Claude have memory?
Yes. The Claude apps save topics from your chats as memory and use them in new chats. It's on by default for Free, Pro, Max and Ultra accounts, and you can view, edit or turn it off under Settings > Your Claude.
Is Claude memory free?
Yes. Memory from chat history is available on the free plan. Searching past chats is a separate feature for paid plans.
How do I make Claude forget something?
Tell Claude in a chat what to forget, or open Settings > Your Claude, select Manage next to Your memory and delete the topic. Reset memory deletes everything and can't be undone.
Does Claude Code remember between sessions?
Yes, through CLAUDE.md files you write and auto memory notes Claude writes. Both load at the start of every session. Run /memory to see and edit them.
Where is Claude Code memory stored?
CLAUDE.md files live in your project or in ~/.claude/CLAUDE.md. Auto memory lives in ~/.claude/projects/<project>/memory/, with a MEMORY.md index. Both are plain markdown on your machine.
Is claude-mem made by Anthropic?
No. claude-mem is a third-party open-source plugin under the Apache 2.0 license. It stores data in ~/.claude-mem and uses a second AI model to summarize your sessions, so read its README before you install it.