Karpathy's LLM Wiki + Claude Code Boosts Coding Agents
Build a self-maintaining knowledge base in Obsidian using Karpathy's LLM Wiki blueprint and Claude Code: feed raw notes/docs into raw/ folder, auto-generate structured wiki/ markdown, query for precise code gen that improves via periodic linting.
LLM Wiki's Three-Layer Architecture Outperforms Static RAG
Karpathy's LLM Wiki creates a persistent, agent-navigable knowledge base superior to basic RAG by handling maintenance automatically. It uses three layers: (1) raw/ folder stores untouched source files like articles, notes, code snippets, screenshots, Figma links, HTML/CSS—your single source of truth; (2) wiki/ generates structured Markdown files with summaries, entities, interlinks, and an index.md for navigation; (3) schema rules dictate organization, updates, consistency checks, and cross-referencing.
Agents like Claude Code point to index.md, drill into relevant pages for context, reducing hallucinations and token waste. Humans explore ideas; LLMs manage tedious linking and upkeep, turning scattered notes into a connected base. Example: Farza Pedia processed 2,500 personal entries (diary, Apple Notes, messages) into hundreds of structured articles on friends, ideas, inspirations—built for agents to pull context for tasks like designing landing pages from past experiences.
Benefits include solving agent memory limits, enabling complex queries (e.g., "build CRM dashboard using referenced Chart.js charts"), and continuous improvement without manual edits. It's 10x more effective than RAG because the wiki self-evolves, spotting contradictions, stale info, missing links, and new connections via a "lint" prompt.
Quick Setup in Obsidian with Claude Code (Under 5 Minutes)
Install Obsidian (visualizes vaults, graph view for links) and Claude Code (e.g., in VS Code). Create a new Obsidian vault directory.
- Open Claude Code in the vault.
- Copy Karpathy's Gist (https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f#llm-wiki) into a file like llm-wiki.md.
- Paste this enhanced prompt into Claude Code: "Build me a complete LLM Wiki system based on this idea from Karpathy. I use Obsidian. Create the folder structure, initial scripts/tools if needed, and give me clear step-by-step instructions on how to ingest data and have you maintain the wiki. Make it practical and ready to run today."
Claude auto-creates raw/ and wiki/ folders, index.md, schema rules, and ingestion scripts. Tailor via description, e.g., "focus on frontend designs, UI inspirations, landing pages, design systems."
Use Obsidian Web Clipper browser extension to dump web content (markdown + images) directly into raw/. No custom code needed—leverages existing tools.
Ingest, Query, and Self-Improve for Production Coding
Ingest data: Drop files into raw/ (e.g., Tailwind docs, color/font notes, screenshots). Prompt Claude: "Compile new raw files into wiki: create summaries, extract concepts, add backlinks to index.md."
Query for code: Agents reference index.md for outputs. Example: Provided raw/ with Chart.js screenshots/HTML, UI snippets; prompted for CRM dashboard—generated app pulling exact components via cross-links, avoiding lazy model behavior or hallucinations.
Self-evolve: Run lint prompt: "Review entire wiki for contradictions, stale info, missing links, new connections. Fix and improve it." LLMs self-review prior work, enrich summaries, resolve issues—runs periodically as you add data. Feed more raw data and lint often for compounding accuracy.
Saves time on specialization, token costs (local images vs. scraping), enables specialized agents (e.g., frontend-focused). Graph view visualizes connections. Works with any coding agent; Claude Code integrates seamlessly for end-to-end workflows.