𝗖𝗹𝗮𝘂𝗱𝗲 𝗖𝗼𝗱𝗲 𝗔𝘂𝘁𝗼 𝗠𝗲𝗺𝗼𝗿𝘆: 𝗦𝘁𝗼𝗽 𝗥𝗲-𝗘𝘅𝗽𝗹𝗮𝗶𝗻𝗶𝗻𝗴 𝗬𝗼𝘂𝗿 𝗣𝗿𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲𝘀
You open a new Claude Code session. It forgets everything you taught it yesterday. You tell it to stop using emojis. The next morning, it uses emojis again.
Claude Code Auto Memory fixes this. It records your corrections and patterns as you work. It saves these lessons for your next session.
You need Claude Code v2.1.59 or newer to use this. Run claude --version to check.
Understand the difference between CLAUDE.md and Auto Memory:
CLAUDE.md
- You write it.
- It contains specific rules and instructions.
- It loads fully every session.
- Use it for code conventions and architecture.
Auto Memory
- Claude writes it automatically.
- It contains learned lessons and patterns.
- It loads the first 200 lines or 25KB only.
- Use it for debugging notes and personal preferences.
Where does the memory live?
Many people look in the wrong place. Your project has a .claude/ folder. This folder only holds settings.
Auto Memory files live in your home directory: /Users/yourname/.claude/projects/your-project/memory/
The memory path follows your git repo. Subdirectories of the same repo share one memory. This memory stays on your machine. It does not sync to the cloud.
How the system works:
Claude uses a file called MEMORY.md as an index. This index helps Claude track other topic files like debugging.md or api-conventions.md. Claude reads these extra files only when needed. This prevents your context from getting too heavy.
How to manage it:
- Use the /memory command in the UI.
- Ask Claude to remember: "remember: always use pnpm."
- Ask Claude to forget: "forget the rule about pnpm."
- Edit the files manually. They are plain Markdown files.
- Turn it off by setting "autoMemoryEnabled" to false.
Once you stop repeating yourself every session, you will not want to go back.
Optional learning community: https://t.me/GyaanSetuAi