Build Your Own Second Brain for Claude Code
August 12, 2026
Most "second brain" setups are just someone else's workspace in disguise — copy them and they fit like a borrowed suit. This one is different. Below are five principles and five paste-ready prompts that hand the work to Claude Code: it studies your files, your folders, your memory, and builds a second brain shaped around how you work.
The one thing to hold onto
Every workspace is different. The way your files, folders, and memory are organized is not the way mine are — so a copy-paste system fits badly. What transfers are the principles. Give these to your agent, let it study your workspace, and let it build your version.
What you need
- Claude Code, doing the heavy lifting.
- A workspace with some history in it — notes, projects, memory files. The brain needs something to organize.
- An hour or two of letting the agent work, checking in between steps.
How this works
Five principles, each with a starter prompt you can paste as-is. The prompts deliberately ask the agent to interview you before building — answering its questions is where your workspace's shape gets in.
1. Research before you build
Don't start from your guesses. Have the agent pull what's working for people right now, then read your workspace, and only then plan. The combination of current best practice plus how your files look is what makes the plan fit.
Starter prompt:
2. Stand on proven shoulders
Four open-source memory projects are worth studying before building — not to copy, but to steal the right ideas from:
- Karpathy's LLM wiki — the foundation: plain markdown the agent writes itself, one small index read first.
- qmd (Tobi Lütke, Shopify's founder) — search by meaning, not just keywords.
- gbrain (Garry Tan, YC's CEO) — answers cite their sources; the brain cleans itself.
- Graphify (YC-funded) — your notes already form a graph; use the links.
Link or screenshot them into your prompt and ask the agent to judge what fits and what to skip.
Starter prompt:
3. Deterministic code before the model
This is where the savings come from. Most of a memory lookup needs zero intelligence — so it should be plain code, not model calls. The ladder the system climbs for every question:
- Strip the question down to its keywords — filler words get discarded.
- Score every possible source without opening any of them — using the index and file names alone.
- Open only the top-scoring file — not three, not "just in case." One.
- Read only the section that answers — not the whole document.
- If that section just points somewhere else, follow the pointer once.
- Only then does the model see anything — it gets the question plus the evidence, and answers in one go.
All of that runs in milliseconds because it's code, not model turns. The model is invoked exactly once, at the end.
Starter prompt:
4. Keep a small index of everything
The scoring trick above only works because the workspace keeps indexes and reference maps — one small catalogue file where every memory has a one-line entry, and a map of which big doc owns which topic. That's what lets code judge "where would this answer live?" without reading anything.
If you build one habit, build this one: every new fact gets a file and a line in the catalogue, every time. An index that's always true is what keeps retrieval cheap forever.
Starter prompt:
5. Make it prove itself
Don't take the system's word for it — make the agent test its own build. Run the same questions through a fresh default session and through the second brain, then compare with /context (it shows exactly how many tokens the session burned) and a clock. If the brain isn't clearly cheaper, the instruction is simple: keep optimizing until it is.
One honest thing the tests will teach you: for facts that already sit in your always-loaded index, default retrieval is instantly fast — that's your index doing its job. The brain wins on the deep stuff: facts buried inside files, questions that need more than one file, and saving new memories.
Starter prompt:
The /goal trick — make the agent check its own speed
The tip that made the biggest difference to quality: give the agent a /goal with a hard pass-fail line and permission to keep working until it's met. It will test its own build, catch its own lag, and iterate without you babysitting. Use this for the interactive parts — anything you click, drag, or reload.
Sample /goal prompt:
Start here
Pick principle one, paste the first prompt, and answer the agent's questions honestly — that's the whole trick. Build it once, and every session after starts smarter. Hit a wall? Book a working session and we'll get it running.

