How Claude remembers your project changedmemory
Nearest release: v2.1.330, published 4 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 21 Nov 2026 00:10 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 21 Nov 2026 00:37 UTC.
Upstream edited
Recorded here
Lines+7added
Lines−7removed
From line
2
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits52to this page, all time
The whole hunk
from line 2, old and new numbered
/
from line 2
22
33> Give Claude persistent instructions with CLAUDE.md or AGENTS.md files, and let Claude accumulate learnings automatically with auto memory.
44
5Each Claude Code session begins with a fresh context window. Two mechanisms carry knowledge across sessions:
5Each Claude Code session begins with a fresh context window. CLAUDE.md files and auto memory carry knowledge across sessions:
66
77* **CLAUDE.md files**: instructions you write to give Claude persistent context. Claude can also read a repository's [`AGENTS.md` files](#agents-md) in place of CLAUDE.md
88* **Auto memory**: notes Claude writes itself based on your corrections and preferences
from line 17
1717
1818## CLAUDE.md vs auto memory
1919
20Claude Code has two complementary memory systems. Both are loaded at the start of every conversation. Claude treats them as context, not enforced configuration. To block an action regardless of what Claude decides, use a [PreToolUse hook](https://code.claude.com/docs/en/hooks-guide.md) instead. The more specific and concise your instructions, the more consistently Claude follows them.
20Use CLAUDE.md files when you want to guide Claude's behavior. Auto memory lets Claude learn from your corrections without manual effort.
2121
2222| | CLAUDE.md files | Auto memory |
2323| :- | :- | :- |
from line 24
2424| **Who writes it** | You | Claude |
2525| **What it contains** | Instructions and rules | Learnings and patterns |
2626| **Scope** | Project, user, or org | Per repository, shared across worktrees |
27| **Loaded into** | Every session | Every session (first 200 lines or 25KB) |
27| **Loaded into** | Every session | Sessions with [auto memory on](#enable-or-disable-auto-memory), up to the first 200 lines or 25KB of [`MEMORY.md`](#how-it-works) |
2828| **Use for** | Coding standards, workflows, project architecture | Your preferences, corrections you give Claude, project context Claude can't derive from the code |
2929
30Use CLAUDE.md files when you want to guide Claude's behavior. Auto memory lets Claude learn from your corrections without manual effort.
31
3230Subagents can also maintain their own auto memory. See [subagent configuration](https://code.claude.com/docs/en/sub-agents.md#enable-persistent-memory) for details.
3331
32Claude treats CLAUDE.md files and auto memory as context. They aren't enforced configuration. To block an action regardless of what Claude decides, use a [PreToolUse hook](https://code.claude.com/docs/en/hooks-guide.md) instead. The more specific and concise your instructions, the more consistently Claude follows them.
33
3434## CLAUDE.md files
3535
3636CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. You write these files in plain text; Claude reads them at the start of every session. If your repository uses `AGENTS.md` instead, see [AGENTS.md](#agents-md).
from line 529
529529
530530```text theme={null}
531531~/.claude/projects/<project>/memory/
532├── MEMORY.md # Index, one line per memory, loaded into every session
532├── MEMORY.md # Index, one line per memory, loaded at session start
533533├── user_role.md # One memory
534534├── feedback_testing.md # One memory
535535└── ... # Any other topic files Claude creates
from line 543
543543
544544### How it works
545545
546The first 200 lines of `MEMORY.md`, or the first 25KB, whichever comes first, are loaded at the start of every conversation. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files.
546While auto memory is on, the first 200 lines or 25KB of `MEMORY.md`, whichever comes first, load at session start. Content beyond that threshold is not loaded at session start. Claude keeps `MEMORY.md` concise by moving detailed notes into separate topic files.
547547
548548After Claude writes to `MEMORY.md`, Claude Code measures the file against the 200-line and 25KB read limits. If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries. If the file is over a limit, the write still succeeds, but Claude Code returns an [error telling Claude to rewrite the index](https://code.claude.com/docs/en/errors.md#memory-index-is-over-its-read-limit), because everything past the limit is dropped on the next load.
549549
No line in this hunk matches that.