4.4 KiB
| name | description | allowed-tools | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| llm-wiki | Karpathy-pattern LLM knowledge base. Builds and maintains a persistent wiki of structured, interlinked markdown files using Claude Code — fundamentally different from RAG. Instead of re-deriving answers from raw documents at query time, the LLM incrementally builds the wiki: reading sources, extracting concepts, updating entity pages, and flagging contradictions. Uses Obsidian as the visual frontend. Trigger when user says: - "set up my wiki" / "create a knowledge base" / "build a second brain" - "set up an LLM wiki about [topic]" - "ingest this article / URL / transcript / video" - "add this to my wiki" - "query my wiki" / "what does my wiki say about" - "lint the wiki" / "health check my wiki" - "connect my notes on [topic]" - "Karpathy wiki" / "LLM wiki" |
|
LLM Wiki — Karpathy Pattern
A persistent, compounding knowledge base maintained entirely by Claude Code. Obsidian is the IDE. Claude is the programmer. The wiki is the codebase.
Core Concept
RAG re-derives knowledge on every query. The LLM has to find and piece together fragments each time. Nothing accumulates.
This wiki pre-compiles knowledge. When a source is ingested, Claude reads it, extracts key information, and integrates it into the existing wiki — updating entity pages, noting contradictions, adding cross-references. Ask a question later and the synthesis is already there.
The wiki is a persistent, compounding artifact. It gets richer with every source ingested and every question asked.
Three-Layer Architecture
raw/ ← immutable source documents (user controls, LLM reads only)
wiki/ ← LLM-generated markdown (LLM owns, user reads)
CLAUDE.md ← schema (tells Claude how to behave in this wiki)
Operations
Read the phase files for full protocol:
| Operation | Trigger | Phase File |
|---|---|---|
| Setup | "set up a wiki about X" | phases/setup.md |
| Ingest | "ingest this", "add this article" | phases/ingest.md |
| Query | "what does my wiki say about X" | phases/query.md |
| Lint | "lint the wiki", "health check" | phases/lint.md |
Setup (Quick Reference)
When asked to set up a new wiki:
# 1. Create vault structure
mkdir -p ~/wikis/<topic>/{raw/assets,wiki/{sources,concepts,entities},tools}
cd ~/wikis/<topic>
git init
printf ".obsidian/workspace.json\n.DS_Store\n.firecrawl/\n" >> .gitignore
Then write these files (use templates):
CLAUDE.md— from templates/CLAUDE.md.templatewiki/index.md— from templates/index.md.templatewiki/log.md— from templates/log.md.templatewiki/overview.md— from templates/overview.md.template
Then open the vault:
obsidian ~/wikis/<topic>
Ingest (Quick Reference)
When asked to ingest a source:
# If URL: scrape it first
firecrawl scrape "<url>" -o raw/<slug>.md
# If file already in raw/: proceed directly
Then:
- Read
wiki/index.mdto find related existing pages - Write
wiki/sources/<slug>.md— structured summary - Update up to 15 related concept/entity pages
- Update
wiki/index.md— add new entry - Append to
wiki/log.md
Query (Quick Reference)
When asked a question about wiki content:
- Read
wiki/index.md— identify relevant pages by scanning summaries - Read 3-7 most relevant pages (parallel
Readcalls) - Synthesize answer with
[[WikiLink]]citations - Offer to file answer as
wiki/queries/<slug>.md
Log Format
Always use this prefix for log entries (enables grep parsing):
## [YYYY-MM-DD] ingest | Source Title
## [YYYY-MM-DD] query | Question asked
## [YYYY-MM-DD] lint | Health check pass N
Quick log inspection:
grep "^## \[" wiki/log.md | tail -10
grep "ingest" wiki/log.md | wc -l
Search (when wiki grows large)
# Simple grep-based search
bash tools/search.sh "transformer architecture"
# Or use qmd for semantic search (install if needed)
# npm install -g qmd
# qmd search "transformer architecture" wiki/