# Karpathy LLM Wiki

Use when building or maintaining a personal LLM-powered knowledge base.

- Repository: https://github.com/Astro-Han/karpathy-llm-wiki (2651 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-07-23
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Astro-Han/karpathy-llm-wiki --skill karpathy-llm-wiki -g -a claude-code -y`
Codex: `npx skills add Astro-Han/karpathy-llm-wiki --skill karpathy-llm-wiki -g -a codex -y`
Cursor: `npx skills add Astro-Han/karpathy-llm-wiki --skill karpathy-llm-wiki -g -a cursor -y`
Gemini CLI: `npx skills add Astro-Han/karpathy-llm-wiki --skill karpathy-llm-wiki -g -a gemini-cli -y`

## Description

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Karpathy LLM Wiki

Build and maintain a personal knowledge base using LLMs. You manage two directories: `raw/` (immutable source material) and `wiki/` (compiled knowledge articles). Sources go into raw/, you compile them into wiki articles, and the wiki compounds over time.

Core ideas from Karpathy:
- "The LLM writes and maintains the wiki; the human reads and asks questions."
- "The wiki is a persistent, compounding artifact."

## Architecture

Three layers, all under the user's project root:

**raw/**, Immutable source material. You read, never modify. Organized by topic subdirectories (e.g., `raw/machine-learning/`).

**wiki/**, Compiled knowledge articles. You have full ownership. Organized by topic subdirectories, one level only: `wiki/<topic>/<article>.md`. Contains two special files:
- `wiki/index.md`, Global index. One row per article, grouped by topic, with link + summary + Updated date.
- `wiki/log.md`, Append-only operation log.

**SKILL.md** (this file), Schema layer. Defines structure and workflow rules.

Templates live in `references/` relative to this file. Read them when you need the exact format for raw files, articles, archive pages, or the index.

### Initialization

Triggers only on the first Ingest. Check whether `raw/` and `wiki/` exist. Create only what is missing; never overwrite existing files:

- `raw/` directory (with `.gitkeep`)
- `wiki/` directory (with `.gitkeep`)
- `wiki/index.md`, heading `# Knowledge Base Index`, empty body
- `wiki/log.md`, heading `# Wiki Log`, empty body

If Query or Lint cannot find the wiki structure, tell the user: "Run an ingest first to initialize the wiki." Do not auto-create.

## The Grounding Invariant

The rest: https://github.com/Astro-Han/karpathy-llm-wiki/blob/HEAD//SKILL.md
