How I built my second AI brain with Obsidian and Claude Code
A simple method for your AI to stop forgetting and remember everything you teach it, thanks to Obsidian and Claude Code.

Daryl Ngako
You use your AI like a search engine that forgets everything between two sentences. You explain your project, your technical choices, your way of working. It follows perfectly. And the next day? Blank page. You start from scratch, over and over again.
The reflex is to blame one's memory. But the real problem is not there: it's not a memory problem, it's a system problem. Your AI has nowhere to store what it learns. Then everything evaporates when the window closes.
Ready-made solutions don't change anything. The memory of ChatGPT, the Claude Projects, the custom GPTs: for each question, they quickly reread your documents and improvise an answer, instead of remembering for good.
In this article, I show you how to break this cycle. You will build a second brain with Obsidian and Claude Code: a space where your AI stores what it learns in the form of cards, keeps it for good, and connects each idea to the others. The more you use it, the smarter it becomes, the exact opposite of a throwaway conversation.
What is this “second brain” thing?
A second brain is simply a folder on your computer where your AI stores its knowledge in the form of small files. Each entry talks about a subject, and the entries are linked together, like Wikipedia pages.
The idea comes from Andrej Karpathy, co-founder of OpenAI and former director of AI at Tesla. At the beginning of April 2026, he published the recipe for his system on X (a simple gist in Markdown) and there was immediate excitement. His strong argument: his own research wiki, written and maintained by the AI, reached a hundred articles and 400,000 words (longer than most doctoral theses) without him writing a single line himself.
The important word is keep. Usually, you chat with an AI and everything goes into the trash as soon as you close the window. Here, it's the opposite. Each thing you teach him stays, adds to the others, and enriches everything.
The thing to remember: your AI no longer just responds, it builds a real memory that belongs to you.
Why current tools forget everything
NotebookLM, Claude Projects, custom GPTs: they all work a bit the same. This is the principle of RAG: we cut your documents into small pieces, and for each question the AI fishes out a few to create an answer on the spot. Then she forgets.
The problem is this division. As Karpathy summarizes, these pieces “lose the context that surrounds them”: the AI rediscovers your subject from scratch with each question, from fragments.
- Nothing accumulates: you can throw 500 PDFs at her, she still doesn't really understand your subject.
- You do the same work again: the next day, same questions, same answers to rebuild.
- Links disappear: she never remembers that one topic is linked to another.
The second brain does the opposite. The AI writes its files once (complete summaries, not fragments) and keeps them. For the next question, she rereads her own cards instead of starting all over again. It's the difference between rereading an entire book for every question and looking at your notes.
The anatomy of the second brain
The system consists of three layers which do not play the same role. It is this separation that makes it strong.
| Layer | What's inside | What AI does |
|---|---|---|
| 1. raw/ | Your raw sources: articles, PDFs, transcripts | She reads, but never edits |
| 2. wiki/ | The generated files, linked together | She is the sole author |
| 3. CLAUDE.md | The scheme and rules of the system | She follows it every session |
The raw/ layer is your immutable source of truth. You place everything there in bulk (by hand or via the Web Clipper, which stores its captures in Clippings/), and the AI only reads: it is not allowed to touch it. The images go into raw/assets/.
The wiki/ layer is the brain. This is where the AI writes, and only it. This is what the real tree structure of my trunk looks like:
├── CLAUDE.md ← the schema, loaded in every session
├── raw/ ← sources brutes, IMMUABLES
│ └── assets/ ← images locales
└── wiki/
├── index.md ← le catalogue de tout le wiki
├── log.md ← le journal chronologique (append-only)
├── apercu.md ← the living overview of the whole vault
├── _templates/ ← page templates
├── sources/ ← one summary per ingested source
├── entites/ ← personnes, organisations, produits…
├── concepts/ ← ideas, theories, and methods
└── sujets/ ← cross-cutting topics (multi-source syntheses)The wiki/ is not a pile of loose notes: each card has a type. A source summarizes a specific document, an entité describes a person or tool, a concept captures an idea, and a sujet synthesizes several sources. The _templates/ ensure that cards of the same type share the same structure, while three registers keep the whole system coherent:
- index.md: the catalog of all pages, one line per record. This is what the AI reads first to respond to, before opening anything.
- log.md: the log of everything that happened (ingestion, request, maintenance), append-only: we never delete an entry.
- apercu.md: the overview, the current state of thinking on the entire trunk.
The CLAUDE.md layer, finally, is the instructions for AI. It defines who does what (you decide and read, the AI writes), how to name the files, what frontmatter to put according to the type, and golden rules: never invent, always cite your sources, enrich a file rather than overwrite it, and link generously. The files cite each other with wikilinks [[Titre de la page]], this is what weaves the network visible in the graph view.
Why Obsidian and not something else?
Obsidian is both a Markdown editor and a personal knowledge base application that allows you to take notes and connect them together to create that “second brain”.
| Traditional tool | Obsidian |
|---|---|
| Siled Notes (Word, Google Docs) | Notes connected with links [[ ]] |
| Data in the cloud | Local files .md (you keep control) |
| Keyword search | Navigation by connections + graph view |
| Proprietary format | Universal Markdown (portable, durable) |
Concretely, three things make it perfect for our case.
1. Everything stays with you. Local files, not a cloud that can close. Your brain is yours.
2. It draws a map of your ideas. The graph view connects your notes together and you see your knowledge take shape.
3. Claude loves this format. Markdown is a simple text format that Claude masters to perfection.
Installation, step by step
It works on both Windows and Mac. Follow the guide.
Step 1: Install Obsidian and create your space
Go to the official Obsidian website, download it, install it, launch it.

Then create a chest (a vault in Obsidian), this is just the folder that will contain your notes. For example, call it veille-ia and choose where to store it. Little advice: switch to dark mode, it's more relaxing for the eyes.
Step 2: Connect your safe to Claude Code
Open a terminal in your trunk folder, then launch Claude Code. This is important: Claude must start right in this folder, otherwise he will not be able to read or write your files.
cd ~/chemin/vers/ma-veille
claudeStep 3: Let Claude build everything
Go find the starting structure in the Andrej Karpathy gist, copy it, and paste it into Claude with an instruction like this:
From this structure, you are now my second brain agent. Create the rules file CLAUDE.md, prepare the index file and log, tidy up the folders, and show me how to add my first source.
Claude will create the basic folders and files on his own. You don't have to code anything. You can adjust the rules file later to suit your needs.
Create your shortcuts (slash commands)
This is where it really comes in handy. You will create four small shortcuts that you trigger with a slash. Their content is copied from my GitHub repo (folder .claude/commands/).
- /ingest: Claude takes a source and creates files from it. If there is already a file on the subject, it completes it instead of creating a new one.
- /query: you ask your brain a question, and Claude answers from your cards.
- /lint: Claude cleans up and spots errors or information that contradicts each other.
- /save: you keep a correct answer permanently in your brain.
Fill your brain easily with Web Clipper
To avoid copying and pasting articles by hand, install the Obsidian Web Clipper extension (on Chrome or Firefox).

Did you come across a good article? One click, and the extension transforms it into a clean file, stored directly in Obsidian. Put these captures in your catch-all folder (raw/), and let Claude sort it afterwards.

How does it happen on a daily basis
Once everything is in place, your routine can be completed in three steps.
1. You drop sources into your catch-all folder, by hand or with the Web Clipper.
2. You run /ingest. Claude reads your sources and creates files. The coolest thing: it checks what already exists and links new information to old information, instead of duplicating everything.
3. You ask your questions with /query. For example: “Summarize for me what we saw on a given subject.” Claude responds from your brain, and each exchange can further enrich it.
From time to time, a little /lint to check that everything is in order, and that's it. The brain almost maintains itself.
See your brain come to life
This is the satisfying moment. Open the graph view in Obsidian and take a look.

Each card is a point, connected to nearby subjects by wires. You see how everything connects: a tool linked to its creator, a subject linked to another, your summaries which bring together several sources. The more knowledge you add, the more the map grows and the more links appear.
To remember
Here is the essential in short version:
- Classic tools (NotebookLM, Projects, custom GPTs) forget and start again for each question. Your second brain keeps everything.
- It is organized into three layers: sources (raw/), files (wiki/), rules (CLAUDE.md).
- Obsidian stores and displays your notes, Claude Code writes them for you.
- Four shortcuts are enough: /ingest, /query, /lint, /save.
- The more you use it, the more it grows and becomes intelligent on its own.
To finish
What makes this method great is that it transforms an everyday hassle (AI that forgets) into something that increases in value over time. Instead of starting from scratch each time, you build something that grows day after day.
You have everything to get started. Start small: a chest, two or three items, all four shortcuts. Then let it grow. In a month, you won't be able to do without it.
Sources and links
- Video source: How I built myself a second AI brain (Obsidian + Claude Code) by Ben BK
- Original gist from Andrej Karpathy: karpathy/442a6bf555914893e9891c11519de94f
- Project GitHub repo: lyrad9/knowdlege-darylngako
- Obsidian (free notes software): obsidian.md
- Obsidian Web Clipper: obsidian.md/clipper
- Claude Code (Anthropic): claude.com/product/claude-code
