Use when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki",
Installs just this skill. Get the whole plugin for auto-invocation.
โก How it fires
How this skill gets triggered: by you, by Claude, or both.
Fires itselfClaude auto-loads it when your prompt matches the work.
You can call itInvoke it directly when you want it.
Slash command/llm-wiki
๐๏ธ Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki",
๐ Stats
Stars23,062
Forks3,139
LanguagePython
LicenseMIT
๐ฆ Ships with claude-skills
</> SKILL.md
llm-wiki.SKILL.md
---name: llm-wiki
description: Use when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
context: fork
version: 2.9.0
author: claude-code-skills
license: MIT
tags: [knowledge-management, obsidian, second-brain, pkm, rag-alternative, wiki, karpathy, memex]
compatible_tools: [claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli]
---# LLM Wiki โ Second Brain for Claude Code + Obsidian
Inspired by Andrej Karpathy's LLM Wiki pattern ([gist](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)). This skill turns Claude Code (or any agent CLI) into a disciplined wiki maintainer that **incrementally builds and maintains** a persistent, interlinked Obsidian vault as you feed it sources. The knowledge compounds โ cross-references, contradictions, and synthesis are already there when you query.
## Core principle
Most LLM+docs workflows are **RAG**: retrieve fragments at query time, synthesize from scratch, forget. The wiki is **compounding**: sources are read once, integrated into a persistent markdown knowledge base, and kept current. You curate and ask; the LLM reads, files, cross-references, and maintains.
**Do NOT use when:** you need one-shot Q&A over a fixed document (use RAG), you don't plan to add sources over time, or you don't want Obsidian in the loop.
## Architecture (three layers)
```
vault/
โโโ raw/ # Layer 1 โ IMMUTABLE source of truth
โ โโโ <source files> # Articles, papers, PDFs, images, data
โ โโโ assets/ # Downloaded images from clipped articles
โโโ wiki/ # Layer 2 โ LLM-owned knowledge base
โ โโโ index.md # Content catalog (LLM updates every ingest)
โโโ AGENTS.md # Same content, for Codex/Cursor/Antigravity
```
- **Layer 1 (raw/)** โ you own. LLM only reads; never writes.
- **Layer 2 (wiki/)** โ LLM owns. It creates, updates, and cross-references pages. You read it.
- **Layer 3 (CLAUDE.md / AGENTS.md)** โ the *schema*. Conventions, workflows, frontmatter rules. Co-evolved by you and the LLM.
## Three core operations
1. **Ingest** โ LLM reads a source, discusses takeaways with you, writes a source summary, updates 10-15 relevant pages, updates index, appends to log. See `references/ingest-workflow.md`.
2. **Query** โ LLM reads `index.md` first, drills into relevant pages, synthesizes with citations. Good answers get **filed back into the wiki** so explorations compound. See `references/query-workflow.md`.
3. **Lint** โ Health check: contradictions, stale claims, orphan pages, missing cross-refs, concepts mentioned but lacking their own page, data gaps to fill with web search. See `references/lint-workflow.md`.
## Quick start
```bash
# 1. Initialize a vault (in Obsidian's vault directory)
| `export_marp.py` | Render a wiki page (or subtree) to a Marp slide deck |
## Cross-tool compatibility
The vault's **schema** lives in CLAUDE.md (Claude Code) or AGENTS.md (Codex/Cursor/Antigravity/OpenCode). The same content works in both. This plugin ships both templates. For per-tool setup instructions see `references/cross-tool-setup.md`.
- **Git** โ the vault is a plain markdown repo; version it
Full setup walkthrough: `references/obsidian-setup.md`
## Why this works (vs plain RAG)
| Plain RAG | LLM Wiki |
|---|---|
| Rediscover knowledge each query | Knowledge accumulates |
| Cross-references re-computed every time | Cross-references pre-written and maintained |
| Contradictions surface only if you ask | Contradictions flagged during ingest |
| Exploration disappears into chat history | Good answers re-filed as new pages |
| Scales by embeddings infrastructure | Scales by markdown + `index.md` + optional local search |
At ~100 sources / hundreds of pages, `index.md` + filesystem search is enough. Past that, layer in a local search tool like [qmd](https://github.com/tobi/qmd) or use `scripts/wiki_search.py`.
## Related skills (chains via `context: fork`)
This skill is marked `context: fork` so other skills can chain into it:
- **`para-memory-files`** โ PARA-method memory; complementary as long-term personal memory that feeds sources into the wiki
- **`obsidian-vault`** (mattpocock) โ lightweight Obsidian note helper; this skill is the maintained-wiki layer on top
- **`rag-design`** โ when wiki outgrows ~500 pages, use rag-design to bolt on a retrieval layer
- **`mcp-design`** โ expose the wiki as an MCP tool
- **`agent-communication`** โ for multi-agent wiki maintenance (ingestor + linter + librarian)
## Reference docs
- `references/wiki-schema.md` โ full vault layout, page frontmatter, naming conventions
- `example-vault/` โ small worked example you can study or copy
## Iron rule
**The LLM never edits files in `raw/`.** Ever. Sources are immutable. All LLM writes go to `wiki/`. If you need to correct a source, do it in `raw/` yourself โ then re-ingest.