Claude can write its own memory. When it discovers something useful, it saves it to ~/.claude/projects/<project>/memory/.
MEMORY.md is the index. Claude loads the first lines of this file every session, and topic files like debugging.md or patterns.md are loaded on demand when relevant.
I want to flag one thing: you can run /memory to open these files and edit them directly. If Claude has learned something wrong, correct it there. If it's missing context, add it. Auto-memory and your hand-written CLAUDE.md work together.