Karpathy LLM persistent-memory method
Inspired by Andrej Karpathy’s Obsidian vault workflow for LLM context continuity.
Goal
Every Claude session resumes with full project context. No re-explaining. Knowledge grows monotonically across sessions.
Structure
.wiki/
index.md ← catalog, read FIRST every session
log.md ← chronological history, append on every working session
sources/ ← raw source docs (paste-in artifacts)
pages/
entities/ ← people, projects, systems, repos
concepts/ ← decisions, architecture, rules
summaries/ ← per-source distilled summaries
synthesis/ ← cross-source reasoning + cross-vault sync
Naming + linking
- File names:
kebab-case.md - Cross-refs:
[[../entities/r-goto]]Obsidian-style wikilinks - Front-matter YAML:
title,type,tags
Lifecycle per session
- Boot — read
index.md, tail 10 entries oflog.md, MemorySearch - Work — answer user
- Persist — append
log.md, update touched pages, refreshindex.mdif pages added - Mirror — sync changes to sibling vault when applicable
Ops vocabulary (log.md)
| op | meaning |
|---|---|
| ingest | new info captured from conversation |
| query | user asked, answered from vault |
| lint | audit / cleanup / drift fix |
| update | existing page edited |
| decision | rule / policy / pref established |
| incident | bug, outage, post-mortem |
See session-start-protocol for boot enforcement.