Claude's 5 Memory Layers Explained: How to Build Persistent Memory That Actually Works
The Problem: Claude Forgets Everything
I kept starting fresh with every Claude session. I’d explain my project, my preferences, my decisions—only to repeat the same explanations next time.
Session 1: "Use functional components, not class components"Session 2: Claude creates class componentsMe: "I said functional components last time"Claude: "I don't have context from previous sessions"
Session 3: I explain everything again...Session 4: Same problem, different dayI wanted Claude to remember my to-do list persistently—not just within a chat. I wanted a “second brain” that knew what I decided last Tuesday, what I was working on Thursday, and what I need to follow up on today.
Then I discovered something in a Reddit thread that changed everything: Claude has 5 memory layers, not just one. Most people only use CLAUDE.md and miss the other four entirely.
The Solution: Understanding All 5 Memory Layers
One commenter shared real usage data after 25+ days of daily use:
371.6M tokens processed92% cache hit rate$259 actual cost38 of 72 sessions had 7x more tool calls than messages sentThe key insight: “Context beats prompts. I don’t write clever prompts—I just keep my vault current, and Claude already knows what happened last Tuesday, what decision I made on Thursday.”
Here are the 5 layers, from most to least obvious:
Layer 1: CLAUDE.md (Project Instructions)
This is the layer most people know about. It’s a markdown file in your project root (or ~/.claude/ for global rules) that Claude reads at the start of every session.
# Project Context
## My RoleProduct Manager at Acme, reporting to Sarah
## Current Priorities1. Launch Q2 feature by April 152. Onboard new team member3. Resolve customer escalations
## How I Work- Prefer bullet points over paragraphs- Need explicit deadlines- Morning planning, evening wrap-up
## Memory Instructions- Track all decisions in decisions.md- Flag items unreplied > 2 days- Remind me of calendar prep 1 hour beforeCLAUDE.md is static context. It doesn’t change during sessions—it’s the baseline Claude starts with every time.
Layer 2: Auto-Generated Memory Files
Claude can create and maintain memory files during sessions. These capture decisions, patterns, and learnings that emerge from your work.
.claude/ memory/ decisions.md # Key decisions made patterns.md # Patterns discovered learnings.md # Things learned followups.md # Items to trackUnlike CLAUDE.md, these files grow and evolve. Claude writes to them, reads them back, and maintains continuity across sessions.
Layer 3: Knowledge Base (Vault/Obsidian)
This is where the “second brain” concept really takes shape. Your existing notes—Obsidian vault, Notion workspace, or markdown files—become context Claude can query.
{ "mcpServers": { "obsidian": { "command": "node", "args": ["obsidian-mcp/build/index.js"], "env": { "OBSIDIAN_VAULT_PATH": "/Users/you/Obsidian/MainVault" } } }}With MCP (Model Context Protocol), Claude can read your meeting notes, project documentation, and personal knowledge base. This is dynamic context that grows organically as you work.
Layer 4: Auto Dream (Background Consolidation)
This is Anthropic’s background process that runs between sessions. It consolidates learnings, identifies patterns, and prepares context for your next interaction.
Session ends │ ▼Auto Dream runs in background: - Consolidates session learnings - Identifies patterns across sessions - Prepares relevant context │ ▼Next session starts with richer contextYou don’t control this directly, but it’s why continuity improves over time. The more you use Claude with proper memory setup, the better it gets at surfacing relevant context.
Layer 5: Session Cache
The cache layer provides significant cost savings and speed improvements.
Without cache: - Every message sends full context - Full token cost each time - Slower responses
With cache: - Repeated context is cached - 92% hit rate achievable - 90% cost reduction on cached tokens - Faster responsesThe trick is maintaining consistent context across messages within a session. When context is stable, the cache hits. When you drastically change what’s included, the cache misses.
Why This Matters for ADHD Brains
For users with ADHD, memory externalization isn’t a nice-to-have—it’s critical. Proper memory setup means Claude can:
- Remember what you decided last week (even when you forgot)
- Track follow-ups you dropped
- Surface relevant context automatically
- Reduce the cognitive load of “remembering everything”
BEFORE (only CLAUDE.md): - Start every session explaining context - Claude doesn't know about Tuesday's decision - Repeatedly tell Claude the same things - High friction, low continuity
AFTER (all 5 layers): - Claude reads vault, knows what happened - Decisions tracked in memory files - Cache makes long context affordable - Auto Dream surfaces relevant patterns - Low friction, high continuityCommon Mistakes
| Mistake | Why It Fails | How to Fix |
|---|---|---|
| Only using CLAUDE.md | Missing 4 other layers | Add memory files, vault access, optimize cache |
| Not maintaining vault | Knowledge base becomes stale | Regular vault updates as part of workflow |
| Starting fresh chats | Breaks continuity | Continue projects within same context |
| Ignoring cache optimization | Higher costs, slower responses | Keep context stable within sessions |
| No memory maintenance routine | Memory files become outdated | Evening wrap-up skill to update files |
Putting It All Together: A Memory Maintenance Workflow
The power comes from combining all layers:
## Daily Memory Sync
1. Review today's decisions2. Update memory files with new learnings3. Archive completed tasks4. Flag items needing follow-up tomorrow5. Sync vault with session contextThis 5-minute routine keeps your memory layers current. The next session, Claude already knows what happened and what’s pending.
Summary
In this post, I explained Claude’s 5-layer memory architecture and how to use it for true persistent memory. The layers work together:
- CLAUDE.md: Static project instructions, baseline context
- Memory Files: Dynamic, session-evolved context
- Vault/Knowledge Base: Your existing notes and documentation
- Auto Dream: Background consolidation between sessions
- Session Cache: Cost optimization for repeated context
The Reddit commenter who shared this insight was right: most people only use CLAUDE.md and wonder why Claude doesn’t remember. But combining all 5 layers transforms Claude from a chatbot into a second brain.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
- 👨💻 Claude Has 5 Memory Layers - Product Peak
- 👨💻 Your AI Still Has No Memory - Product Peak
- 👨💻 Claude Code Documentation
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments