Who this is for
People using Obsidian but finding that organization can't keep up with input. Those who installed Claude Code but only use it for coding, not for managing notes. Or those who saw Karpathy's Wiki Gist but found it too abstract and didn't know how to implement it.
Main text
A few days ago, Karpathy announced on X that he officially joined Anthropic.
He's on the Claude pre-training team, working under Nick Joseph. At the same time, he's starting a new team to study how to use Claude to accelerate pre-training research itself — in other words, letting Claude help Anthropic improve Claude.
When that news came out, I remembered a Gist he published back in April, titled LLM Wiki. It talked about how to get a large language model to continuously maintain a structured Wiki for you after you give it raw documents — he calls this pattern the LLM-maintained Wiki.
The one line from that Gist that stuck with me the most:
Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.
After the Anthropic news, I dug up that Gist and read it again.
He himself says the document is "deliberately abstract, describing the pattern rather than a specific implementation" and suggests throwing it at your own LLM to build a version that works for you.
So let's build one.
This is a minimal implementation I put together following his approach, using Claude Code. Every step has been tested — just copy it and it'll work.
How is this different from RAG?
First, why not just use RAG.
With RAG, every time you ask a question, the LLM searches the raw documents on the fly, stitches together an answer, and then forgets it. The next time you ask something similar, the whole retrieval and concatenation process repeats.
Karpathy's idea: after you provide the raw documents, have the LLM edit the key points into a continuously maintained Wiki. The next time you ask, the LLM reads the Wiki first, instead of re-retrieving from scratch.
Knowledge accumulates in the Wiki, not consumed with every query.
The whole system has three layers and three operations.
Three layers
- Raw sources: your original documents — LLM only reads, never writes
- The wiki: markdown files generated and maintained by the LLM
- The schema: config file that tells the LLM the rules. In Claude Code, that's CLAUDE.md
Three operations
- Ingest: bring in new documents
- Query: ask the Wiki questions
- Lint: periodic health checks — find contradictions, outdated info, orphaned pages
Now let's walk through it step by step.
Step 1 · Set up the vault structure
Create a new Obsidian vault with this three-layer structure:
If you're already using Obsidian and inside a vault, click the vault name in the bottom left and select "Manage vaults" to go back to the creation screen.
If it's your first time opening Obsidian, you'll land on the start page. Click "Create" next to "New vault".
Fill in the vault name (I used karpathy-wiki-demo), pick a location with "Browse", then click "Create".
Inside the new vault, you'll see two buttons at the top left: "New file" and "New folder". Use them to create:
- A new folder →
raw/(for raw materials) - A new folder →
wiki/(for AI-organized notes) - A new file →
CLAUDE.md(write rules to tell Claude Code how to process material)
After that, the left file tree will look like this:
karpathy-wiki-demo/
├── raw/
├── wiki/
└── CLAUDE.mdraw/holds the sources you'll feed into the Wiki: article markdown saved from the browser, papers, podcast transcripts, your own scattered notes.wiki/is empty for now — the LLM will fill it.CLAUDE.mdmust be in the vault root — Claude Code reads it automatically when it starts.
Step 2 · Write the CLAUDE.md
CLAUDE.md is the soul of the whole system. It tells Claude three things: what this vault is, how to process new sources, and how to search when answering questions.
Here's the minimal version I wrote — you can copy it directly:
(This code block intentionally left empty in the original. Fill in your own rules following the description.)
This file will evolve as you use it. Karpathy specifically emphasized in the Gist that this is something you and the LLM co-evolve — don't aim for perfection on day one. Start with 10 rules or fewer, run for a week, then see which rules aren't being used and which scenarios are missing rules, then adjust. Too many rules and Claude will take forever to check each time and may miss some.
Step 3 · Start Claude Code in the vault directory
In Finder, right-click the vault folder (karpathy-wiki-demo) → "Services" → "New Terminal at Folder". iTerm2 users can choose "New iTerm2 Window Here". The terminal will open directly in the vault root.
In the new terminal, run:
claudeFirst, have Claude confirm it understands the rules. Just ask:
Can you describe the schema of this vault?
If Claude's answer recites the steps for ingest, mentions index.md and log.md, then the schema is activated.
At this point, the IDE and the programmer have shaken hands.
Step 4 · First Ingest
Pick a document you've read recently as a seed, save it as markdown, and drop it into raw/.
I used the tutorial you're reading right now — letting the Wiki ingest itself has a meta feel to it, and this article is the origin document for this vault anyway.
Tell Claude Code:
Ingest the new document in raw/
Claude will follow the steps in CLAUDE.md and you'll see it sequentially Write a bunch of files:
wiki/sources/<document-name>.md(summary page)wiki/entities/karpathy.md,anthropic.md,obsidian.md,claude-code.md(entities from the document)wiki/concepts/llm-maintained-wiki.md,wiki-vs-rag.md,three-layer-architecture.md,ingest-query-lint.md,claude-md-schema.md(concepts covered)wiki/index.md(created or updated)wiki/log.mdgets a new line: `
[YYYY-MM-DD] ingest | <document-name>`
On the first run, there's a minor friction: Claude Code will ask for confirmation before creating each new file. It looks like:
Do you want to create index.md?
› 1. Yes
2. Yes, allow all edits during this session (shift+tab)
3. NoJust pick 1, or pick 2 to let it through for the whole session, so you don't have to press every time. After confirming a dozen files, the ingest finishes.
Once it's done, go back to Obsidian and look at the wiki/ directory. It can be surprising — a moment ago it was empty, now there's a whole set of sources/, entities/, concepts/ subfolders. index.md has already registered all new pages in the format specified in CLAUDE.md, each with a one-line description.
Step 5 · Query
This isn't RAG-style "re-retrieve" — it's "read existing notes and answer" based on the wiki.
Tell Claude Code:
Query: [your question]
Claude will first open wiki/index.md, find the relevant concept pages, read them, and give you an answer. The key difference: every judgment will include [[wiki-vs-rag]], [[llm-maintained-wiki]] style wiki internal references — you can click into them to see which original source page they came from.
Karpathy suggested a usage in the Gist: good query answers can be filed back into the wiki as new pages. That way your exploration accumulates, instead of being thrown away after each question.
After Claude answers, I add this:
File this answer back into the wiki as a new page in explorations/
After archiving, go back to Obsidian and look in wiki/explorations/ — there'll be a new page. At the top it says the origin (which day's query, what the original question was), then a one-sentence answer, expansion, and references. Any time later you want to revisit this query, you can find it from this page; references like [[wiki-vs-rag]] are clickable to check the source.
Also check wiki/log.md. Every ingest and file-back is appended there in the format `
[YYYY-MM-DD] <action> | <topic>` as specified in CLAUDE.md, with dates as reverse-chronological anchors. Later, if you want to see how the wiki grew step by step, this file is all you need.
Every time you do this, the wiki grows.
Step 6 · Lint
After a few ingests, the wiki starts accumulating "dirty data": conflicting statements between sources, pages nobody links to, important concepts missing.
Tell Claude Code:
Lint the wiki for inconsistencies, outdated info, and orphan pages.
Claude will scan the wiki and give you a report. The one I ran looked something like:
- Conflict: source A says X, source B says Y
- Orphaned page: wiki/concepts/old-concept.md has no incoming links
- Missing entity: "Claude Code" is mentioned in three sources but has no entry in entities/
- Outdated info: wiki/concepts/rag.md references an older version of the systemLint doesn't make changes directly — you review the report and decide which items to fix. Fixing is easy: tell Claude to edit according to the report item by item.
A few observations from using it
Graph View is more intuitive than index.md
Open the Obsidian graph view — click the icon in the left sidebar, or use the command palette (Cmd+P / Ctrl+P) and search "Open graph view". There's no default shortcut; if you use it often, set one in Settings → Hotkeys. Once open, you can see the shape of the wiki: which pages are hubs (linked by many others), which are orphans (no one links to them), and where the gaps are.
The first time you see your wiki as this living network, Karpathy's line "Obsidian is the IDE, the LLM is the programmer" really clicks — you barely typed anything, but the vault is full of active notes.
Web Clipper makes filling raw/ fast
If you want to keep feeding web articles into raw/, install the Obsidian Web Clipper browser extension. Find a good article, click it, and it auto-saves as markdown into raw/. Then just tell Claude to ingest — done.
Git init the vault
Since it's essentially a markdown repository, do git init after setup. After every ingest, commit. That way you can roll back if you regret something, and the history shows how the wiki grew step by step.