Keeping an LLM wiki in a git repo

Note-taking apps like Joplin and Obsidian never stuck for me. Writing a note is quick, but keeping notes current and linked to each other is ongoing work, and Andrej Karpathy’s LLM wiki gist says that upkeep is why people abandon their wikis. What has lasted is letting a coding agent (Claude Code) write my research notes as markdown docs in a git repo and maintain them. I wrote a bit about this recently before I knew Karpathy had named the pattern an LLM wiki.

The agent maintains a wiki for you. It condenses your source material into linked pages of facts, you change the pages by asking it rather than editing them yourself, and each new session reads them for context instead of starting from scratch. The sources themselves stay untouched (mine are web pages the docs link to and measurements from my own setup).

A session can’t reread hundreds of pages of source material every time, and models get worse as their input grows (Chroma’s context rot study), so it reads the condensed pages instead. A note app only stores notes, while the agent can answer questions from them, act on what they say, and ask me about what’s missing.

The agent reads an instructions file at the start of every session (AGENTS.md in the repo root). These lines from mine, shortened, tell a new session where the docs are and how to write them:

Decision docs live under `research/`, listed in `research/README.md`.

## Docs

- Each fact has one home. A new fact joins the doc that already covers its
  topic; start a new doc only when I ask for one.
- Add each fact as soon as you learn it, and reread the whole doc before
  committing.
- Say where each claim comes from. It was measured here, comes from a source
  you opened and link, or is marked untested.
- Drop history. State the current reality and its reasons; git keeps the rest.

The gist also keeps an index.md listing every page and a log.md of what changed. That README stands in for the index, and git log for the log.

He also has the agent lint the pages periodically for contradictions and orphans (pages nothing links to). I don’t schedule that, and rely on the reread after each change, which only covers the doc being edited.