
Claude Code Memory: A Custom Brain for Every Project
Claude's 1M context window sounds infinite. It isn't. Every session starts empty, every token costs money, and 'lost in the middle' kills quality on huge contexts. This guide shows the three-layer memory system that stops Claude from forgetting your business every Monday.
What's Inside
Free · 7 min readClaude Has No Memory Between Sessions
Every restart is amnesia. Every long session burns tokens for things it re-reads. External memory is how you make Claude remember — cheaply, at scale, and on your terms.
Fresh every restart
Close the window, open it tomorrow — Claude doesn't know your business anymore. You spend the first 20 minutes re-explaining stack, prices, rules.
Tokens cost money
Input tokens are billed on every turn. A 500k-token session costs roughly 10x more than a 50k-token session — for the same questions.
1M isn't enough
Three years of transcripts, client files, stack decisions — no way it fits in the window. And 'lost in the middle' means bigger context isn't better context.
Three Layers, One Working Brain
Each layer solves a different tradeoff. Identity stays tiny and always-loaded. Curated knowledge stays in a graph you walk. Massive archives stay searchable by meaning.
CLAUDE.md — The Project Passport
A short Markdown file at the root of your project. Claude Code loads it automatically at the top of every session — it's always in context, always billed on every turn. Anthropic officially recommends keeping it under 200 lines. It survives auto-compact because it's re-injected from disk.
When to use:
Project identity, hard rules ('never use heroicons'), stack, commands, and pointers to deeper files. Never your full pricing table — that belongs in the vault.
Obsidian RAG — The Connected Brain
A folder of Markdown files with links between them. Claude reads an index file (a Map of Content) first, then follows exactly one or two links to answer the question. Index-first retrieval is the single trick that makes a 200-file vault cost ~5,000 tokens per answer instead of ~80,000.
When to use:
Pricing logic, stack decisions, client files, reusable patterns, vendor evaluations. The 'middle' knowledge — curated, edited, human-readable, linked.
Pinecone — The Vector Memory
A managed vector database. Text becomes embeddings (long lists of numbers that capture meaning); similar meanings get similar numbers. You query with a question, get back the top 5–10 chunks closest in meaning. Scale: millions of vectors. Weakness: it can't reason about structure, only similarity.
When to use:
Years of meeting transcripts, support tickets, research papers, email archives. Content too big to curate — but you still want to ask semantic questions.
Which Layer Does This Belong In?
The map you'll consult every week. When you're adding new knowledge, these five questions tell you where it goes.
| Layer | CLAUDE.md | Obsidian RAG | Pinecone |
|---|---|---|---|
| What it holds | Small, static identity. Anthropic recommends under ~200 lines. Loaded at the top of every session. | Living, linked graph of knowledge. Tens to hundreds of pages. Claude reads the index, then follows links. | Massive flat archive. Thousands or millions of chunks. Queried by similarity. |
| Why it works | No search needed — it's just there. But every word costs tokens on every turn — so keep it short. | More knowledge than fits in context. Claude can reason over explicit relationships and add links as it learns. | Infinite scale, returns exact text — but it's similarity-only. Cannot reason about structure. |
| Scales to | Under 200 lines. Hard ceiling. | Sweet spot: ~100 sources, hundreds of pages. | Millions or billions of vectors. |
| Write access | Rarely — you curate it yourself. | Yes — continuously, as Claude works. | Writes happen at ingest. On query — read only. |
| Best for | Identity. Voice rules. Read-first instructions. | Active projects. Decision logs. Idea gardens. Anywhere structure matters. | Transcripts. Research archives. Books. Anywhere precise recall matters. |
The full course spends a module on each layer and shows how to route every question to the right one.
The Cascade: One Question, The Right Layer
The power isn't in having all three — it's in routing each question to the layer built for it. Ninety percent of real questions stop at layer 1 or 2.
01Question arrives
A client DM, a new task, a decision to scope.
02CLAUDE.md is already loaded
Identity and rules set Claude's voice and behavior for the turn.
03Read the MOC
The Obsidian index file — ~150 lines that route Claude to the right place.
04One vault file, maybe two
Claude opens exactly the files the MOC pointed to. Stops reading when the answer is found.
05Pinecone only if needed
For semantic questions about archives (transcripts, history) not covered in the vault.
06Answer in your voice
Using your numbers, your patterns, your decisions — not a hallucination.
From Zero to Working Memory in 6 Steps
A taste of what the full course teaches — the shape of the work, without the full depth.
01.Write a 150-line CLAUDE.md
Identity in one sentence. Stack. Commands. Hard rules ('never use heroicons'). Pointers to the vault. Under 200 lines — Anthropic's own guidance.
The full course walks through each step in detail, with real examples, templates, and three modules on the decision matrix above.
What changes when it works
A new client message gets a scoped, voice-matched reply in 30 seconds. New team members read the vault instead of a wiki. Every past project feeds the next one. You stop being the bottleneck — the memory becomes the business.
Your Learning Path
Three courses that compound. Start with the tool, master the memory, then scale to everything else.
Master Claude Code first
The foundation. Context management, skills, slash commands — everything the memory system builds on.
Open the Claude Code courseBuild permanent memory
This course in full: CLAUDE.md depth, Obsidian RAG, Pinecone integration, final project on your own business.
Open the Memory courseAutomate the rest
With memory set, scale into AI sales, team workflows, content automation. All included in the lifetime bundle.
See all coursesOne payment — everything unlocks
All 10 courses are independent. Pay once ($39.90), get lifetime access to every course, guide, and future update.
Give Claude a Real Memory
The guide gave you the map. The course gives you the whole route: three modules, 23 lessons, a final project that deploys permanent memory for your business. Lifetime access, every future course included.