Karpathy's 'Second Brain' Pattern, Applied to Obsidian and Claude Code
TL;DR
On April 3, 2026, Andrej Karpathy posts an idea that goes massively viral: stop using an AI agent for one-off questions, and point it at a folder of sources so it builds a personal wiki that grows with every addition. The principle holds up, and the real structure goes further than "three folders and a prompt": immutable sources, a generated wiki, an action log, and a periodic verification pass. Budget 5 minutes for an empty vault, 60 to 90 minutes to migrate an existing knowledge base.
The post that started it all
Andrej Karpathy, a founding member of OpenAI and former AI director at Tesla, posted the idea on X: instead of asking an agent to write code or answer a one-off question, point it at a folder and let it build a living knowledge base. The post passed 19 million views and got picked up, tested, and documented across the AI community within weeks.
The principle in one sentence
A note you write yourself captures what you thought you understood at the moment of writing it. A note the agent writes, from a raw source (an article, a transcript, a PDF), captures what the source actually says, and updates itself when a new source completes or contradicts it. The agent doesn't replace your thinking, it keeps the wiki current while you keep feeding it sources.
The real structure
The versions that spread on social media reduce it to three elements: a raw sources folder, a wiki folder, a CLAUDE.md file. The structure documented in detail goes further:
secondbrain/
├── _CLAUDE.md # rules: what goes where, naming, when to ask
├── _index.md # entry point, navigation catalog
├── _log.md # log, one line per agent action
├── sources/ # raw, never edited by hand
├── inbox/ # unsorted ideas
└── wiki/ # generated by the agent, also never edited by hand
Two rules set this system apart from an ordinary notes folder: the sources/ folder stays immutable, which lets you check later what a source originally said. The wiki/ folder is only ever modified by the agent, never by hand: fixing an error means adjusting the instructions or adding a source, not editing the output directly.
The three everyday operations
- Ingest: drop a source into
sources/and ask the agent to integrate it. It reads, identifies the entities it mentions, and updates the relevant wiki pages, typically 5 to 15 pages per source. - Query: ask the knowledge base a question. The agent searches the wiki first, then the raw sources if the wiki falls short, and turns a useful answer into a new wiki entry.
- Verify: a periodic pass that catches contradictions between pages, broken links, orphaned pages, and claims that have gone stale.
The real setup time
Five minutes is enough to get started on an empty vault: create the folders, write the CLAUDE.md, drop in a first source. On a knowledge base already filled with hundreds of files, migration takes longer: the detailed guides count 60 to 90 minutes to scan what exists, propose a filing plan into the new structure, and migrate files one by one. The five-minute number that circulates most only applies to the most favorable starting point.
What changes if you already have a structured knowledge base
A knowledge base that already has a governance file and topic-based indexes covers most of what this pattern proposes. What's structurally missing from a base built before this pattern: a clean separation between raw, never-edited sources and synthesis notes, and a recurring verification pass rather than an occasional one. Both bolt onto an existing structure without rebuilding it from scratch.
How to get started
Create an empty folder, open it in Claude Code, and describe the structure you want instead of building it by hand: name the sources/, inbox/, wiki/ folders, ask for a _CLAUDE.md that documents filing and naming rules, then drop in a first source and ask the agent to ingest it. The second source follows the same move, and the wiki grows from there.