In April 2026, Andrej Karpathy —co-founder of OpenAI, former director of AI at Tesla— published a short document that blew up (over 16 million views): the "LLM Wiki" pattern. The idea is brilliant in its simplicity: instead of your AI forgetting and you repeating everything each time, have IT build and maintain a markdown wiki — a knowledge base that GROWS with every conversation and that you can read. In this guide I'll walk you through his exact method, in plain English, why it works so well, and how to set it up with a ready-to-paste prompt. It's the natural next step after the CLAUDE.md file.
Every time you work with your AI, you explain things, you explore ideas together, you reach conclusions… and all of it evaporates the moment you close the chat. Next time, the AI remembers nothing and you explain the same thing all over again. Karpathy frames it like this: the knowledge doesn't accumulate — every conversation starts from scratch.
His idea for breaking that is brilliant in its simplicity: have the AI write and maintain its own wiki — a knowledge base that grows with every conversation, instead of evaporating.
The AI incrementally builds a wiki: a collection of markdown files linked to one another, living between you and your sources (your documents, notes, repos). You read it; the AI writes it and maintains it. Everything you learn together gets recorded and connected — so, over time, that wiki becomes more valuable than scattered notes.
Why does it work, when we humans always abandon our wikis? Karpathy gives the exact answer: "the tedious part of maintaining a knowledge base isn't the reading or the thinking — it's the office work (the bookkeeping)... Humans abandon wikis because maintenance grows faster than value. LLMs don't get bored, they don't forget to update a cross-reference, and they can touch 15 files in a single pass."
Karpathy organizes the system into three layers. Understanding them means understanding the whole method:
The method has three actions, with the names Karpathy gave them:
Ingest. You hand it a new source (an article, a repo). The AI reads it, talks the key points over with you, writes a summary page into the wiki, and updates the index. A single source can touch 10-15 wiki pages, connecting them together.
Query. You ask it something. And here's the good part: good answers get filed back into the wiki as new pages. That way your own explorations accumulate in the knowledge base, just like the sources you ingest.
Lint. You ask the AI to run a health check on the wiki: it looks for contradictions between pages, outdated claims, orphan pages (with no links reaching them). It keeps the wiki healthy on its own.
index.md (the catalog of the whole wiki, organized by content) and a log.md (a chronological, append-only record). His tip: if each log entry starts with a consistent prefix like ## [2026-04-02] ingest | Title, you can search it with simple tools.Paste this into your agent (Claude Code, Codex, etc.) to kick off your own wiki following Karpathy's pattern. It's designed so the AI asks you the questions and builds the structure with you.
Let's set up an "LLM Wiki" following Andrej Karpathy's pattern: a markdown knowledge base that you (the AI) build and maintain, and that I can read. STRUCTURE (3 layers): 1. raw/ — my raw sources (articles, repos, notes). You READ them but NEVER modify them. 2. wiki/ — markdown pages that YOU generate and maintain, linked to one another. You own this layer. 3. The schema — update my CLAUDE.md (or AGENTS.md) explaining how the wiki is organized, so you maintain it with discipline. Special files: create an index.md (catalog by topic) and a log.md (chronological, append-only; each entry starts with "## [DATE] operation | Title"). OPERATIONS you'll know how to do: - INGEST: when I hand you a source, read it, tell me the key points, write a summary page into wiki/, link it, and update index.md and log.md. - QUERY: when I ask you something, answer AND if the answer is valuable, file it as a new page in the wiki. - LINT: when I ask you to, review the wiki: contradictions, stale data, orphan pages, and propose fixes. Start by asking me the questions you need about what my wiki will be about, then create the initial structure (folders, index.md, log.md, and the schema section in my CLAUDE.md).
CLAUDE.md and want to take it to the next level.All of this comes from the document Karpathy published himself. I recommend reading the whole thing — it's short and worth its weight in gold.
Join 4,200+ builders. No credit card. Build your first app with AI in minutes.