Back

April 14, 2026

Building a second brain with Obsidian and Claude Code

I take a lot of notes. Class notes, project notes, random thoughts I don't want to lose, quotes from books, half-formed ideas from the shower. For years this was scattered across Apple Notes, random text files, and the graveyard of browser tabs I kept open as "I'll come back to this." None of it was ever retrievable. A thought I had in October might as well have never happened by December.

Tiago Forte calls this the second brain problem. You collect information but you can't do anything with it. The files exist but the knowledge doesn't. A few months ago I finally fixed this by combining Obsidian for storage and Claude Code for querying. The setup is embarrassingly simple but it has genuinely changed how I think and study.

The stack

Obsidian is just a folder of markdown files on your disk. That matters. It means nothing is locked inside a proprietary format, nothing needs to sync through someone else's servers, and every file is plain text that any tool can read. I use iCloud to sync my vault across devices and that's the entire infrastructure.

Claude Code runs locally in my terminal. When I open it inside my Obsidian vault, it can read every note, search across them, follow links between files, and answer questions using the whole vault as context. No RAG pipeline. No vector database. No chunking. Just a CLI tool reading files.

This feels almost illegal given how much ink has been spilled on building production RAG systems. But for a personal knowledge base, the simple approach is better. My whole vault is a few hundred markdown files. Claude can scan the directory structure, grep for keywords, and read the files that matter. It does the retrieval itself using the tools it has.

Why prompt caching changes everything

The reason this works economically is prompt caching. When I ask Claude a question about my notes, the first response is expensive. It has to read directory structures, open several files, and hold the context. But Anthropic caches the prompt prefix for five minutes. My second question in the same session hits the cache and costs a fraction of the first.

This maps almost perfectly onto how I actually think. I don't ask one question and leave. I ask a question, read the answer, ask a follow-up, pull on a thread, circle back to something from two messages ago. Every one of those follow-ups is cheap because the vault context is already warm in the cache.

The result is that a thirty-minute session with my notes costs less than the first query. Without prompt caching, this wouldn't be feasible for a student budget. With it, I can treat my vault like a thinking partner I can interrupt whenever I want.

Token optimization without trying

The biggest token optimization move is also the simplest. Don't dump everything into context. Let Claude fetch only what it needs.

In a naive setup you'd shove your whole vault into the system prompt and hope for the best. That burns tokens on every turn and hits context limits fast. The tool-use approach flips this. Claude starts with nothing. It reads the directory tree to see what's available, then opens only the files that look relevant to the question. For a note about distributed systems, it might pull three or four files. For a question spanning multiple topics, maybe ten. Never the whole vault.

I keep my vault structure tidy enough that Claude can navigate it without me holding its hand. Folders named by topic. Consistent filename patterns. Internal Obsidian links like [[this]] between related notes. The structure itself is a retrieval hint.

The other trick is writing notes in a style that's friendly to future-me and future-Claude. Short paragraphs. Bullet points for lists of facts. Bolding key terms so keyword search finds them. I stopped writing elegant prose in notes and started writing scannable structure. Both I and Claude retrieve faster from it.

What this actually unlocks

The concrete thing that changed is that my notes became compounding instead of disposable. I write something once and it stays retrievable forever. Questions I would have answered by re-Googling or re-reading a paper, I now answer by asking my vault. And because the vault contains my own takes, my own summaries, and my own confusions, the answers are in my voice and at my level.

Studying for midterms looks different. Instead of flipping back through PDFs, I ask Claude to quiz me using my class notes. It pulls the relevant files, generates questions in the style of what I wrote, and we go back and forth. I stopped using flashcard apps. My vault became the flashcard app.

Writing is different too. I'll be drafting something and think I remember making a point about a topic months ago. I ask Claude to find it. It surfaces the note in seconds, sometimes with the exact phrasing I was reaching for. My past self becomes a collaborator.

The quiet lesson

Every time I get hyped about a new tool I try to ask what principle it proves. For this setup the principle is that leverage comes from stacking simple components that compose well. Obsidian is a folder of files. Claude Code is a CLI that reads files. Prompt caching is a pricing mechanism. None of these are novel on their own. Together they give you a personal second brain that would have been science fiction two years ago.

You don't need a custom RAG pipeline. You don't need a vector database. You need plain files, a good model, and a small amount of discipline about how you write notes. That's the whole setup. It's taken me embarrassingly long to realize how much mileage is in it.