# karpathy-llm-wiki

> A reusable Agent Skills-compatible skill for building Karpathy-style LLM wikis with Claude Code, Cursor, Codex, and other coding agents.

karpathy-llm-wiki packages Andrej Karpathy's LLM Wiki idea into a single installable Agent Skills skill, letting coding agents like Claude Code, Cursor, and Codex maintain a structured knowledge base from raw sources. Released under the MIT license by Yuhan Lei (GitHub: Astro-Han), the project is an unofficial community implementation of the workflow described in Karpathy's public gist. The repository reports 1,788 stars and 209 forks as of mid-2026.

## What It Is

karpathy-llm-wiki is an open-source skill that turns a coding agent into a knowledge-base maintainer. Instead of re-searching raw documents on every question (as in RAG), the agent compiles ingested sources into durable, curated markdown wiki pages that compound over time. The skill defines three core operations — **Ingest**, **Query**, and **Lint** — and works with any tool that supports the agentskills.io open standard.

## How the Workflow Works

The project follows a clear directory convention:

- `raw/` — immutable source material (web pages, papers, PDFs, markdown, pasted text)
- `wiki/` — compiled knowledge pages maintained by the LLM, organized by topic
- `wiki/index.md` — global table of contents
- `wiki/log.md` — append-only operation log

When a new source arrives, the agent stores it in `raw/`, then creates or updates the relevant wiki articles, strengthens cross-references, and records contradictions. Queries search the wiki and return grounded answers with citations linking back to markdown pages. The lint operation checks index integrity, broken links, and stale cross-references, applying auto-fixes where possible.

## LLM Wiki vs RAG

The README draws a direct contrast with retrieval-augmented generation:

| Approach | Knowledge lives in | Synthesis happens |
|---|---|---|
| RAG | Raw chunks and embeddings | At query time |
| LLM Wiki | Curated markdown pages | During ingest and maintenance |

The wiki model is optimized for compounding knowledge — summaries and cross-links improve with each new source rather than being re-derived on every query. The README notes that at 50K–100K tokens of curated wiki, grep and file reads are more reliable than vector or graph search, and recommends adding search tooling only when recall measurably degrades.

## Tool Compatibility and Installation

The skill installs via a single `npx add-skill Astro-Han/karpathy-llm-wiki` command and is compatible with Claude Code, Cursor, Codex CLI, and OpenCode. For tools without native Agent Skills support, the `SKILL.md`, `references/`, and `scripts/` directories can be copied manually into the tool's skill directory.

## Design Boundaries

The README documents deliberate non-features informed by three months of production logs and a survey of the ecosystem:

- No source-hash freshness tracking (raw/ is immutable)
- No persisted line-number citations (whole-file grep catches observed fidelity errors)
- No numeric confidence scores (described as false precision without calibration)
- No automatic hooks or scheduled runs (those belong to the agent harness)
- No MCP servers, UIs, or output subsystems (outside the scope of a tool-agnostic skill)
- No vector or graph search at current wiki scale

## Current Status

The repository was created in April 2026 and last pushed in July 2026. The README reports a production knowledge base maintained daily since April 2026 with 94 wiki articles across 13 topic directories and 99 ingested sources. The project tracks Google's Open Knowledge Format draft for potential future compatibility.

## Features
- Ingest sources (URLs, files, PDFs, pasted text) into immutable raw/ directory
- Compile and update curated markdown wiki pages from ingested sources
- Query wiki with grounded answers and citations linking to markdown pages
- Lint wiki for broken links, missing index entries, and stale cross-references with auto-fixes
- Append-only operation log for audit trail
- Global table of contents (index.md) maintained automatically
- Cross-reference and contradiction tracking across wiki pages
- Compatible with Claude Code, Cursor, Codex CLI, and OpenCode via agentskills.io standard
- Single-command install via npx add-skill
- MIT licensed and fully open source

## Integrations
Claude Code, Cursor, Codex CLI, OpenCode, agentskills.io

## Platforms
CLI, API

## Pricing
Open Source

## Version
main

## Links
- Website: https://github.com/Astro-Han/karpathy-llm-wiki
- Repository: https://github.com/Astro-Han/karpathy-llm-wiki
- EveryDev.ai: https://www.everydev.ai/tools/karpathy-llm-wiki
