Skip to content

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.

The Session Amnesia Cycle
Session 1: "Use functional components, not class components"
Session 2: Claude creates class components
Me: "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 day

I 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:

Real Usage Stats
371.6M tokens processed
92% cache hit rate
$259 actual cost
38 of 72 sessions had 7x more tool calls than messages sent

The 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.

CLAUDE.md Example
# Project Context
## My Role
Product Manager at Acme, reporting to Sarah
## Current Priorities
1. Launch Q2 feature by April 15
2. Onboard new team member
3. 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 before

CLAUDE.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.

Memory File Structure
.claude/
memory/
decisions.md # Key decisions made
patterns.md # Patterns discovered
learnings.md # Things learned
followups.md # Items to track

Unlike 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.

MCP Configuration for Obsidian Access
{
"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.

Auto Dream Concept
Session ends
Auto Dream runs in background:
- Consolidates session learnings
- Identifies patterns across sessions
- Prepares relevant context
Next session starts with richer context

You 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.

Cache Impact
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 responses

The 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 vs After Memory Layers
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 continuity

Common Mistakes

MistakeWhy It FailsHow to Fix
Only using CLAUDE.mdMissing 4 other layersAdd memory files, vault access, optimize cache
Not maintaining vaultKnowledge base becomes staleRegular vault updates as part of workflow
Starting fresh chatsBreaks continuityContinue projects within same context
Ignoring cache optimizationHigher costs, slower responsesKeep context stable within sessions
No memory maintenance routineMemory files become outdatedEvening wrap-up skill to update files

Putting It All Together: A Memory Maintenance Workflow

The power comes from combining all layers:

Evening Wrap-Up Routine
## Daily Memory Sync
1. Review today's decisions
2. Update memory files with new learnings
3. Archive completed tasks
4. Flag items needing follow-up tomorrow
5. Sync vault with session context

This 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:

  1. CLAUDE.md: Static project instructions, baseline context
  2. Memory Files: Dynamic, session-evolved context
  3. Vault/Knowledge Base: Your existing notes and documentation
  4. Auto Dream: Background consolidation between sessions
  5. 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:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments