Every session you start, Claude forgets you. Here's how to stop losing everything you taught it.
Be honest. How many times have you explained the same thing to Claude?
Your folder layout. Your naming rules. "No, not like that, like THIS." You fix it on Monday. On Tuesday you open a new session and it's gone. You fix it again. And again.
That isn't a bug. It's how it works: every Claude Code session starts with a fresh context window. Everything you said in chat, every correction, every "remember this" you never wrote down, disappears the moment the session ends.
You're not building anything. You're re-teaching the same intern every morning, and paying for the tokens every time.
The viral "second brain" guide tried to fix this. It got one thing right: you don't need Obsidian, Notion or another $20/month app. Plain Markdown files and one map file.
But it stopped at layer one. And two of its key lines are wrong.
Claude Code has four memory layers. Most people use one, stuff it until Claude stops listening, and then decide "AI memory doesn't work."
It works. You just set up a quarter of it.
Reading time: 6 minutes. Setup: about 10. After that you never explain the same thing twice.
Bookmark it now. The copy-paste setup prompt is near the end, and you'll want it open when you build.
The Short Answer
A second brain in Claude Code is four layers, each loading at a different moment:
1. CLAUDE.md, the map. You write it. Loads every session. For rules and facts Claude needs every single time.
1. .claude/rules/, the reflexes. You write them. Load only when Claude touches matching files. For rules about one folder or one file type.
1. Skills, the playbooks. You write them. Load only when invoked or relevant. For multi-step procedures.
1. Auto memory, the diary. Claude writes it. Loads every session (first 200 lines / 25KB). For your corrections and preferences, learned automatically.
The golden rule: put each piece of knowledge in the layer that loads only when it's needed. That's how your brain stays big while Claude's context stays small.
What You Need
- Claude Code. Some features below need a recent version; the version is noted where it matters.
- A folder. Any folder. Plain .md files.
- 10 minutes. You fill the rest in as you go.
No installs, no plugins, no database.
First, the 2 Myths From the Viral Guide
That guide has 13 million views. Which means a lot of people built their setup on these two lines, and are now wondering why Claude still ignores them.
Myth 1: "CLAUDE.md is loaded into the system prompt." The docs say: "CLAUDE.md content is delivered as a user message after the system prompt, not as part of the system prompt itself." Claude reads it and tries to follow it, but there's no guarantee of strict compliance, especially for vague or conflicting instructions.
Myth 2: "If the info isn't there, the agent reports a failure instead of hallucinating." Nothing in the docs promises that. Anthropic is explicit: Claude treats memory files "as context, not enforced configuration." If something must never happen, don't write a polite sentence in CLAUDE.md. Use a PreToolUse hook, which runs as a shell command and applies no matter what Claude decides.
Translation: if your "never do this" lives only in CLAUDE.md, you're hoping, not protected.
Now let's build it properly.
The Skeleton
Layer 4 (auto memory) you don't create. Claude does. Open it any time with /memory.
The one-topic-per-file discipline from the viral guide still stands: tax-policy.md, not notes.md. ivan-petrov.md, not note-12.md. Lowercase, hyphens.
Layer 1: CLAUDE.md, the Map (Under 200 Lines)
This is where everyone overdoes it. You get burned once, so you add a rule. Then another. Six months later your CLAUDE.md is a 600-line wall, and Claude follows less of it than when it was 50.
That's not paranoia, that's the docs. Their target: under 200 lines per CLAUDE.md. Longer files "consume more context and reduce adherence." In plain words: the bigger your map, the worse Claude follows it.
So the map holds only what Claude needs in every session: where things live, naming rules, how to answer.
Three tricks hiding in that example:
1. HTML comments cost zero tokens. Block-level <!-- ... --> comments are stripped before CLAUDE.md is injected into context. Leave notes for yourself or your team for free.
1. Imports organize, they don’t save. The import line in that example pulls projects/now.md into context, and imports can chain up to 4 hops deep. But the docs are clear: imports “don’t reduce its context cost.” Everything you import loads every session. Import only what truly must always be in focus.
1. Backticks turn an import off. Wrap the path in backticks and Claude reads it as plain text. Leave it bare after the @ sign and Claude imports the file.
Don't want to write it from scratch? Run /init and Claude drafts a starter CLAUDE.md. Set CLAUDE_CODE_NEW_INIT=1 first and /init turns interactive: it asks whether to set up CLAUDE.md, skills and hooks, explores with a subagent, and shows you a proposal before writing anything.
Personal layer: CLAUDE.local.md sits next to CLAUDE.md, loads the same way, and is meant for you only. Add it to .gitignore. Global layer: ~/.claude/CLAUDE.md applies to every project on your machine.
Layer 2: Rules That Load Themselves
If all your rules live in CLAUDE.md, every one of them gets shoved into every single session. Your writing rules load when you ask about taxes. Your people rules load when you're fixing a typo. You pay for all of it, every time.
This layer ends that.
Put Markdown files in .claude/rules/. Add a paths: field and the rule loads only when Claude reads, writes or edits a matching file. The rest of the time it costs nothing.
.claude/rules/people.md:
.claude/rules/writing.md:
Ask about your dentist and the people rules switch on. Ask about your draft and the writing rules switch on. Ask about taxes and neither one loads.
Rules without paths load at launch, like CLAUDE.md. Personal rules in ~/.claude/rules/ apply to every project you open.
Layer 3: Skills, the Playbooks
CLAUDE.md is for facts. Anything that is a procedure ("every Friday, do these 6 steps") belongs in a skill. The docs: skills "only load when you invoke them or when Claude determines they're relevant to your prompt."
.claude/skills/weekly-review/SKILL.md:
Now "do my weekly review" runs the whole routine, and the other 6 days of the week those steps take zero context.
Layer 4: Auto Memory, the Brain That Writes Itself
This is the part the viral guide never mentions, and the one that hurts most to miss.
Think about every time you corrected Claude and it said "got it." Without auto memory, "got it" lasted until the session closed. Every one of those corrections is gone. You taught it, and you lost it.
Claude Code keeps auto memory: notes Claude writes itself, based on your corrections and preferences. It loads every session (the first 200 lines or 25KB), it's per repository and shared across worktrees, and it's all plain Markdown you can read, edit or delete.
How to feed it:
- Say "remember that I always want sources under every claim" → Claude saves it to auto memory.
- Say "add this to CLAUDE.md" → it goes into your map instead.
- Run /memory → see every memory file, toggle auto memory on or off, open the auto memory folder.
Rule of thumb: you write the map, Claude writes the diary.
Quick pause. If you just realized half your corrections never got saved, follow @mojeskoqq. I break down Claude Code features like this one, checked against the official docs and explained in plain words.
The One-Prompt Setup
Too lazy to build it by hand? Open Claude Code in an empty folder and paste this:
Then run /context and check that CLAUDE.md shows up under "Memory files".
How Claude Actually Loads All This
Knowing the load order is what separates a second brain from a junk drawer.
1. At launch: every CLAUDE.md and CLAUDE.local.md from your working folder and every folder above it, ordered from the top of the drive down. Within each folder, CLAUDE.local.md comes after CLAUDE.md. Files are concatenated, not overridden.
1. Also at launch: rules without paths, plus your auto memory.
1. On demand: a CLAUDE.md inside a subfolder loads the first time Claude touches a file in that subfolder. Path-scoped rules load the same way.
1. After /compact: your project-root CLAUDE.md is re-read from disk and comes back. Instructions you only typed in chat do not. That rule you spent 20 minutes explaining an hour ago? Compacted away. If it matters, write it down.
One limit to know: on-demand files over a per-file size limit get cut (40,000 characters on a 200K context window). Claude gets the start plus a note to read the rest.
The 5 Commands That Keep It Healthy
1. /init: drafts a starter CLAUDE.md (interactive with CLAUDE_CODE_NEW_INIT=1).
1. /memory: lists and opens every memory file, toggles auto memory.
1. /context: shows what actually loaded, under "Memory files".
1. /doctor prompt-audit: finds outdated, broken or contradicting instructions and changes nothing until you approve (v2.1.283+).
1. "remember …": saves a preference straight into auto memory.
Run /context once after setup. If a file isn't listed under Memory files, Claude can't see it.
Common Pitfalls
- A huge CLAUDE.md. Less adherence, more context burned every session. → Keep it under 200 lines, move the rest to rules and skills.
- Importing everything with @. Imports load every time, no savings. → Import only the always-on core.
- Two files that disagree. Claude "may pick one arbitrarily." → Run /doctor prompt-audit.
- "Never do X" written in CLAUDE.md. It's context, not enforcement. → Use a PreToolUse hook.
- An important rule typed only in chat. Gone after /compact. → Put it in CLAUDE.md.
- One giant notes.md. Claude can't find anything. → One topic per file.
The 60-Second Audit: How Much Are You Losing Right Now?
Don't build anything yet. Open your current project and answer five questions. Every "no" is something leaking out of every session you run.
1. Does Claude even see your CLAUDE.md? Run /context and look under "Memory files". Not listed? Then every rule you wrote in there has never reached Claude. Not once.
1. Is it under 200 lines? Count. If it's longer, you're paying every session for a map Claude follows worse with every line you add.
1. Is anything in your auto memory? Run /memory and open the auto memory folder. Empty, or switched off? Then every "no, do it like this" you've ever typed is gone.
1. Where does your most important "never" live? If it's a sentence in CLAUDE.md, it's a wish. Docs: context, not enforcement. A PreToolUse hook is the only version that can't be ignored.
1. Do your files contradict each other? Run /doctor prompt-audit (v2.1.283+). If two files disagree, Claude "may pick one arbitrarily", and you'll never know which one it picked.
Three or more "no"? You don't have a second brain. You have a notes folder Claude glances at.
Two Versions of Tomorrow Morning
Without it: you open a new session. Claude doesn't know your folders, your naming, your "never do this". You type the same three paragraphs you typed yesterday. It makes the mistake you corrected last week. You correct it again. The tokens you spent teaching it last time? Gone with the session.
With it: you open a new session and just ask. Claude already knows where things live, which rules apply to the file it's touching, and every correction you ever made. The playbook runs when you say its name. Nothing you taught it is lost.
Same Claude. Same price per token. The only difference is the 10 minutes you spend tonight.
Paste the One-Prompt Setup before you close this tab. Then do three things:
- Bookmark this. In a month you'll want to run the audit again.
- Follow @mojeskoqq for more Claude Code setups like this, tested and explained in plain words.
- Repost it for the friend who still re-explains their folder layout to Claude every morning.
And reply with your audit score. How many "no" did you get?











