Karpathy Wiki
A Claude Code skill for auto-maintained LLM wikis — based on Andrej Karpathy's LLM Wiki pattern.
Instead of re-deriving answers from raw documents every time (RAG), the LLM incrementally builds and maintains a wiki — a structured, interlinked collection of markdown files. The wiki compounds with every source you add and every question you ask.
What it does
As you work with Claude Code, any durable knowledge — research findings, resolved confusions, validated patterns, gotchas, architectural decisions — gets written as a small capture file and processed by a detached background worker into a persistent wiki. The wiki is git-versioned. Your flow is never interrupted.
User commands:
wiki status — health report (categories, page counts, depth-violation count, soft-ceiling indicator, quality rollup, last ingest, drift). Implemented.
wiki doctor — deep lint + smartest-model re-rate of quality blocks. Not yet implemented (stub returns "not implemented" exit 1). Deferred to a future ship; tracked in TODO.md.
Everything else is automatic. One skill handles both a main knowledge base (~/wiki/) and per-project wikis (<project>/wiki/), with the same conventions. Note: per-project wiki auto-resolution is not fully wired — captures from project sessions currently flow into the main ~/wiki/ even when a project-local ./wiki/ would be more appropriate. This is a known v2.4 gap; see TODO.md.
Install
Clone the repo and the user CLI symlink:
git clone https://github.com/toolboxmd/karpathy-wiki ~/dev/karpathy-wiki
ln -s ~/dev/karpathy-wiki/bin/wiki ~/.local/bin/wiki # or anywhere on PATH
Then register the plugin with Claude Code by adding two entries to ~/.claude/settings.json — the marketplace pointer and the enabled-plugins flag:
{
"extraKnownMarketplaces": {
"karpathy-wiki-local": {
"source": {
"source": "directory",
"path": "/Users/<you>/dev/karpathy-wiki"
}
}
},
"enabledPlugins": {
"karpathy-wiki@karpathy-wiki-local": true
}
}
Replace /Users/<you>/dev/karpathy-wiki with your actual repo path. Then run /reload-plugins in any Claude Code session. Hooks, commands, and the SKILL are auto-discovered from the plugin manifest — no manual hook wiring required.
Note on local install: Claude Code's plugin system requires plugins to come from a registered marketplace, even for local-directory sources. The extraKnownMarketplaces entry above declares this repo IS a (single-plugin) marketplace; marketplace.json at the repo root makes that real. A bare ~/.claude/plugins/karpathy-wiki symlink is NOT enough — Claude Code won't load slash commands from it.
How it works
A single skill (skills/karpathy-wiki/SKILL.md) defines triggers, orientation protocol, and iron laws. Two hooks live at repo level:
hooks/session-start — drains pending captures on session start (drift detection in raw/, stale-lock reclaim, detached ingester spawn)
hooks/stop — session-end stub (transcript sweep is post-MVP)
Captures land as tiny markdown files in <wiki>/.wiki-pending/. The spawner atomically claims each capture (exclusive hard-link rename) and launches a detached claude -p ingester that reads the capture, does the orientation protocol, edits wiki pages under per-page locks, and auto-commits.
Design doc: docs/planning/karpathy-wiki-v2-design.md. Implementation plan: docs/planning/2026-04-22-karpathy-wiki-v2.md.
Status
v0.2.3 — work in progress. Claude Code only. Active development on a single-user wiki; not yet packaged for general consumption.
What works today (v2.3):
- Auto-capture + detached background ingest into a git-versioned wiki.
- Discovery-driven categories: any top-level
mkdir <name>/ at the wiki root creates a category. No code changes required.
- Per-directory
_index.md tree (recursive); root index.md is a small MOC.
- Validator enforces
type: <plural-category> matching path.parts[0] and rejects pages at depth ≥5.
wiki status health report.
- Tier-1 lint at every ingest: required frontmatter fields, link resolution, source existence, quality block ranges, type/path consistency.