Claude Code Guide
Using Claude Code to Setup a "Second Brain" aka LLM Wiki
A practical guide to building a personal AI-maintained knowledge base with Obsidian, Claude Code, and plain-text markdown files.
Part 1
Your first brain thinks. It does not store.
The brain in your skull is brilliant at thinking and terrible at storage. You forget most of what you read within a week. That is not a personal failure. That is the default human operating system.
So we reach for notes, bookmarks, apps, folders, read-it-later lists, and half-finished systems. But the real problem was never saving things. The problem was maintaining them.
A good second brain needs a librarian. It needs something that reads what you save, files it in the right place, connects it to what you already know, and keeps the whole thing tidy.
That librarian now exists. It is an AI agent.
Part 2
Obsidian is the IDE. Claude Code is the maintainer.
Andrej Karpathy described the pattern cleanly: Obsidian is the IDE, the LLM is the programmer, and the wiki is the codebase.
- Obsidian is the window you use to browse your notes.
- Claude Code is the AI worker that reads files, writes files, and keeps things linked.
- The wiki is the growing library of connected pages.
Your job is not to become a full-time note organizer. Your job is to feed the system useful material and ask useful questions. The AI handles the filing, linking, summaries, citations, bookkeeping, and cleanup.
Part 3
The folder structure is the product.
Keep the structure simple. The two tools never need to talk to each other directly. They just share a folder of markdown files.
your-vault/
CLAUDE.md
Raw/
Inbox/
Wiki/
Index.md
Log.md
Entities/
Concepts/
Summaries/- Raw stores original sources. These files are immutable.
- Inbox stores quick captures and daily digests waiting to be processed.
- Wiki stores maintained pages that Claude Code can update.
- CLAUDE.md is the rulebook Claude Code reads before it works.
Do not build thirty nested folders. Use flat folders, clear filenames, wikilinks, and an index. The folders are layers. The topics live in the links.
Part 4
Two commands run the whole system.
Ingest: eat this and file it
- Save the original source in Raw.
- Write a summary page in Wiki/Summaries.
- Ripple the source through every relevant Entity and Concept page.
- Update Wiki/Index.md.
- Append the work to Wiki/Log.md.
Ripple is the important step. One article should not create one summary and stop. It should improve every relevant page the story touches.
Query: answer from my notes with receipts
Claude reads the index first, opens only the relevant pages, and answers from your wiki with citations. It should separate what the wiki knows from what the model adds from general knowledge.
Part 5
Build it in one afternoon.
- Install Obsidian from obsidian.md.
- Install Claude Code from Anthropic.
- Create the vault folders shown above.
- Create CLAUDE.md at the root.
- Open Claude Code in the vault and feed it ten useful sources.
Around ten sources, the graph starts to feel different. It stops being isolated dots and becomes a web. That is when you have a second brain instead of a pile of notes.
Copy Paste
Starter prompt for Claude Code
You are setting up an LLM Wiki second brain using Karpathy's pattern:
Obsidian is the IDE, the LLM is the programmer, and the wiki is the codebase.
1. Create this structure in the current folder:
Raw/
Inbox/
Wiki/Entities/
Wiki/Concepts/
Wiki/Summaries/
Wiki/Index.md
Wiki/Log.md
2. Create CLAUDE.md at the root using the starter rulebook I will paste next.
3. Confirm the tree back to me, then wait.
After that, when I say "ingest <url>", follow the ingest recipe in CLAUDE.md.
My focus areas are: [DESCRIBE WHAT YOU WANT A SECOND BRAIN ABOUT].Copy Paste
Starter CLAUDE.md
# My Second Brain - Maintainer Rules
You are the maintainer of this Obsidian vault, not a generic chatbot.
This vault follows Karpathy's LLM Wiki pattern: I curate sources and ask questions; you do everything else, including summarizing, cross-referencing, keeping the wiki consistent, and bookkeeping.
My focus is: [TOPIC].
## Vault map
- Raw/ is for immutable sources. Never edit Raw files after creation.
- Inbox/ is for quick captures waiting to be processed.
- Wiki/ is the maintained wiki. You own this layer.
- Wiki/Index.md is the catalog of every page. Read it first on any query.
- Wiki/Log.md is the append-only operation log.
- Wiki/Entities/ is for companies, people, products, and organizations.
- Wiki/Concepts/ is for ideas, frameworks, and recurring themes.
- Wiki/Summaries/ is for one source summary per ingested source.
## Conventions
- Use wikilinks everywhere.
- Every company, person, product, organization, or concept with a page gets a wikilink on first mention.
- Every note starts with YAML frontmatter: type, created date, updated date, tags.
- Use absolute dates, like 2026-07-13. Never write "yesterday" or "last week" without the date.
- Claims in wiki pages cite the relevant summary page.
- Entity and concept pages use plain names, like OpenAI.md.
- Summary pages start with S - .
- Raw source pages start with R - .
- Never invent facts. If something is not supported by a source, mark it unverified.
## Operation: ingest <url or file>
1. If this is a URL, fetch it and save the full text to Raw/R - <Title>.md with a source-url field.
2. If it is already in Raw/ or Inbox/, start there.
3. Write Wiki/Summaries/S - <Title>.md with key claims, numbers, quotes, and why this matters to me.
4. Ripple the source through every Entity and Concept page it touches. A good source usually updates 5 to 15 pages.
5. Create missing Entity and Concept pages when needed.
6. Add backlinks and citations to the summary page.
7. Update Wiki/Index.md.
8. Append to Wiki/Log.md with the date, operation, source title, and pages touched.
## Operation: query <question>
1. Read Wiki/Index.md first.
2. Open only the relevant pages.
3. Answer from the wiki with citations.
4. Clearly separate what the wiki knows from what you add from general knowledge.
5. If the synthesis is valuable, offer to save it as a new Concept page.
6. Append the query to Wiki/Log.md.
## Operation: lint
Health-check the wiki for contradictions, stale claims, orphan pages, missing cross-references, entities mentioned three or more times with no page, and summaries missing from the index.
Report findings. Fix mechanical issues. Ask before rewriting major pages.
## Operation: daily digest
Search the web for the most significant [TOPIC] news from the last 24 hours.
Write Inbox/Digest <DATE>.md with 5 to 8 items. Each item gets a one-line summary and likely wikilinks.
Do not auto-ingest. I choose what enters the wiki.
## Boundaries
- Never modify Raw files after creation.
- Never delete a wiki page without asking.
- Deprecate and link forward instead of deleting.
- Never invent facts.
- Mark anything unverified when it lacks a source.Appendix
Plain-English glossary
| Second brain | A place outside your head where you keep what you learn. |
|---|---|
| LLM | A model like Claude or ChatGPT that reads and writes language. |
| Agent | An AI that does tasks, reads files, writes files, and takes actions. |
| Wiki | Pages that link to each other, like Wikipedia. |
| Vault | Obsidian's word for your folder of notes. |
| Local-first | Your files live on your computer. |
| Markdown | Plain text with lightweight formatting. |
| Graph view | A map of your notes where dots are pages and lines are links. |
| Ingest | The process where the AI reads a source and files it into the wiki. |
| Frontmatter | The metadata block at the top of a note. |
| Dataview | An Obsidian plugin that turns note metadata into tables. |
| Kanban | A board with columns like Ideas, Doing, and Done. |
| RAG | Searching documents at question time. |
| Compounding | Your previous knowledge makes future learning easier and more useful. |
| Doctrine | Playbooks written from your own data. |
| Memex | Vannevar Bush's 1945 idea for a personal connected knowledge machine. |