How to Build an AI Second Brain With Claude Code
Everyone is building a notes second brain right now. Here is the agentic version: a real knowledge graph, a memory layer, and a decision ledger my AI team reads before it acts.
My feed has turned into one long loop lately. Someone opens Obsidian, wires it into Claude Code, and calls the result their second brain. I have watched five of these videos in two weeks. They are all doing a good trick. It just is not the whole trick.
I run two AI companies day to day, both built inside a mountain of code, docs, and decisions no single person could hold in their head. So a while back I built the real second brain: a system my AI team queries before it acts. That is the part nobody is filming yet.
The short version, if you just want the answer: an AI second brain is a system your AI queries before it acts, built in three layers. A knowledge graph gives it recall, a memory and lessons file gives it judgment, and a decision ledger gives it accountability. A notes app only does the first job, and only when you go looking. This one gets consulted automatically. The rest of this guide is how I built each layer, and how you can start today with one file.
Everyone Is Suddenly Building an AI Second Brain
The notes version is genuinely useful, and it is not new. Tiago Forte built the PARA method (Projects, Areas, Resources, Archives) years before anyone hooked an LLM up to it, and it still holds up as a way to sort what you keep. Bolt an AI on top so it can search your vault and answer questions, and you have a real upgrade on how you find your own notes.
Here is the part that trips people up. A second brain that holds your notes is a filing cabinet with a search bar. A second brain that runs your business has to do something a filing cabinet never does: get consulted before a decision, not just looked up after one. Mine gets asked things like which file to touch, what we already tried, and what we decided last time. Then it answers, and the answer changes what happens next.
How to Build a Second Brain With AI: Three Layers, Not One Note
My setup breaks into three layers. Each one answers a different question, and none of them work alone.
Three layers, one system. Each answers a different question, and none of them works alone.
- Layer 1Knowledge graph (recall)A real graph of every file, function, and decision doc. The agent queries it before it acts, so a guess turns into a lookup. Going to the graph first runs about five times cheaper than blind search, in my own token cost.
- Layer 2Memory and lessons (judgment)One line per mistake, written the day it happens, never deleted. Mine holds 57 so far, and the AI reads them before it repeats one.
- Layer 3Decision ledger (accountability)Every real decision, logged the moment it is made, with a class, a status, a ruling, and a confidence score. Mine has 446 entries and counting.
Layer One: The Knowledge Graph (Recall)
The first layer is a knowledge graph of the real code and company, not a folder of markdown files. I run a tool called graphify that maps every file, every function, every decision doc into nodes and edges, so an AI agent can ask what touches this or where this data comes from and get a real answer instead of a guess. Before my agents write a line of code or answer a real question, the rule is simple: query the graph first, search blind second. I measured it myself. Going to the graph first runs about five times cheaper than blind searching through the code. That is not a marketing number. It is what it costs me in tokens, every day, on real work.
Layer Two: Memory and Lessons (Judgment)
A graph tells you what exists. It does not tell you what went wrong the last time you touched it. That is the second layer: a running file of lessons, one line per mistake, written the same day it happens. Right now mine holds 57 of them. Nothing ever gets deleted, only added to. Some are embarrassing to reread. One says, in plain terms, that a passing test proved nothing because the test was checking the wrong thing the whole time. I keep that one near the top on purpose.
Layer Three: The Decision Ledger (Accountability)
Nobody talks about the third layer as much, but it is the one that makes everything else accountable: a ledger of every real decision, logged the moment it gets made. Mine has 446 entries right now. Each one carries a class, a status, a ruling, and a confidence score from one to ten. So six months later I can ask my AI what we decided and how sure we were, and get an answer from the record instead of my own fuzzy memory.
Every entry in the ledger follows the same shape: an id, a date, a class like pricing or brand naming, a status such as decided, pending, or superseded, a ruling such as approve, edit, decline, or direction, and a confidence score from 1 to 10. That structure is what makes it queryable later instead of just a diary.
A Knowledge Graph Example From My Own Setup
Concrete beats abstract, so here is what my graph looks like today. It holds 16,980 nodes and 21,657 edges, clustered into 1,441 communities so an agent is not drowning in the whole system at once. Of those nodes, 10,771 are documents, 6,206 are code, and a small strange bucket, just 3 files, is pure reasoning: notes that exist only to explain why a decision was made, not what the code does.
- 16,980 nodes: every file, function, and decision doc the graph knows about
- 21,657 edges: the connections between them, drawn from how the system references itself rather than from folder names
- 1,441 communities: the graph's own clustering, so a question about one corner does not drag in the whole system
- Six subsystems roll it all up: the live product, the AI agents and skills, the operations and decisions layer, public assets, docs and specs, and root config
- The single busiest connection between any two of those clusters carries a weight of 105, out of edges that range as low as 1
None of that is there to impress you. It is there so my AI agents can answer what happens if I change this before they touch it, and catch the break in advance. That is the whole point of the recall layer: it turns a guess into a lookup.
The Claude Code Second Brain Difference
A notes vault gets read by you. An agentic brain gets read by your AI, constantly, before it does anything on your behalf. That is the real difference between a Claude Code second brain and a second brain that is just Claude Code pointed at your Obsidian folder. One makes you faster at finding your own notes. The other makes your AI team faster and more careful at doing your real work, because it checks memory and precedent first, then acts.
Same two words, a different job. Who reads it is the whole difference.
Honestly, the lessons file exists because I got tired of my AI agents making the same dumb call I had already caught a previous version of them making. Now it is in writing, dated, and specific, and writing does not forget the way I do at eleven at night.
Your 10-Minute First Win
You do not need a graph with 17,000 nodes to start. You need one file. Here is the fastest real version of this you can build today, and the trick is you are not the one writing it.
The 10-minute first win: one file, and your AI is the one that writes it.
- 1Open your AI toolClaude Code, or just Claude in a browser tab. Whatever you already use.
- 2Say what you wantA memory file for how you work, in your own words, that it reads back before it helps you again.
- 3Give it raw materialA few real mistakes, a decision you keep re-explaining, a rule you always forget until it costs you.
- 4Have the AI write itOne line per lesson: what happened, what you learned, what to do differently next time.
- 5Save where your AI readsOpen it again next session. That is the memory layer, day one, done.
- Open whatever AI coding tool or chat assistant you already use. Claude Code works, or just Claude in a browser tab.
- Tell it plainly what you want: a memory file for how you work, written in your own words, that it can read back before it helps you again.
- Give it the raw material. Paste in a few real examples: a mistake you made and what you would do differently, a decision you keep having to re-explain, a rule you always forget until it costs you.
- Have the AI write the file, not you. Ask it to format each entry as one line: what happened, what you learned, what to do differently next time.
- Save it somewhere your AI reads before you start a new session, and open it again next time you talk to it. That is the memory layer, day one, done.
Try this almost word for word: Read back everything I just told you about how I work and the mistakes I have made. Write me a memory file: one short line per lesson, dated, honest, never deleted, only added to. Format it so you can read it back at the start of every future conversation with me.
That one file will not build you a 16,980-node graph. It does something more useful on day one: it can keep your AI from repeating a mistake it already made. The graph, the ledger, the full three-layer setup, you build those once that habit is already paying rent.
Common Questions About Building an AI Second Brain
What is an AI second brain?
An AI second brain is a system your AI consults while it works. Think of the notes version as a filing cabinet with a search bar, something you open when you go looking. Mine is built to run in three layers: a knowledge graph for recall, a memory and lessons file for judgment, and a decision ledger for accountability. My agents pull it up before they make a call, and what it tells them shapes the next step.
How is this different from a notes app like Obsidian?
The difference is who does the reading. A notes app like Obsidian is built for you to open and search. This is built for your AI to query on its own, every time, before it touches your work. Obsidian plus an LLM makes you quicker at finding your notes. The three-layer setup makes your AI team check what already went wrong and what you already decided, so it repeats fewer of your mistakes.
Do I need a knowledge graph to start?
No. Start with one memory file, written by your AI in your own words, that it reads back before it helps you again. The graph, the ledger, and the full three-layer setup come later, once the habit is already saving you from repeat mistakes. A 16,980-node graph is where this ends up after months of real use. Day one is just the file.
Does the AI write the second brain, or do I?
The AI writes it. You hand it the raw material, a few real mistakes, the decisions you keep re-explaining, and the rules you always forget, and you ask it to format each one as a single dated line it can read back later. Having the AI do the writing is what makes the habit stick, since it is the one that has to use the file at the start of the next session.
Common questions
What is an AI second brain?
It is a system your AI reads before it acts. It holds what you know in a way your AI can look up on its own. A notes app stores things for you to find later. A second brain gets checked automatically, every time your AI does work.
How is it different from a notes app like Obsidian or Notion?
A notes app only helps when you go looking. It waits for you. A second brain works the other way. Your AI reads it first, on its own, so what you know shapes the answer before the work even starts.
Do I need to know how to code to build one?
No. You can start with one plain text file. Write down what you know, the rules you follow, and the choices you have made. Point your AI at that file and tell it to read it first. That is a working first version.
What are the three layers of an AI second brain?
Recall, judgment, and accountability. A knowledge graph gives recall, so your AI can find how things connect. A lessons file gives judgment, so it learns from past mistakes. A decision ledger gives accountability, so it remembers what you decided and why.
How do I start today?
Open one file and write ten lines about your work. Add the rules you never break. Add three choices you made this month and why. Tell your AI to read it before every task. Grow it one line at a time, and never delete a lesson.
Want to see the whole living graph, not just the numbers?
See the interactive second brainResearched and written by the AI content system that runs this build, from the real work log. Machine-drafted, quality-gated in code.