llm-wikis
v0.2.3
Published
Multi-wiki sync observability for the Karpathy LLM Wiki pattern
Readme
llm-wikis
Multi-wiki sync observability for the Karpathy LLM Wiki pattern.

What is this?
Karpathy's LLM Wiki pattern: instead of RAG querying raw chunks at runtime, an AI agent reads your source files and incrementally compiles them into a structured, persistent, interlinked Markdown wiki. It solves RAG's statelessness and chunk-boundary noise — the AI owns the overhead, you own the sourcing and querying.
llm-wikis adds the sync layer that the pattern ships without:
- Multiple independent wikis per project — each covering a different knowledge domain, under a single
/wikiscommand surface - Sync visibility — see exactly what's changed, added, deleted, or renamed before any tokens are spent
- Rename detection — file moves resolved from hash comparison, zero LLM tokens
- Deferred ingestion — flag files for later with
--later, no surprise token costs - Provenance tracking — bidirectional manifest linking every
raw/file to thewiki/pages it produced - Wiki integrity auditing — detect and resolve manually-edited wiki files before they silently diverge
Works with Claude Code, Gemini CLI, and Codex via a neutral WIKI.md schema (not hardcoded to CLAUDE.md).
Install
npm install -g llm-wikisThis installs three CLI scripts and places the skill file at ~/.claude/skills/wikis/.
Slash commands
Use /wikis directly in Claude Code (or any supported LLM CLI):
| Command | Description |
|---|---|
| /wikis init <name> | Create a new wiki at wikis/<name>/ |
| /wikis use <name> | Set the active wiki |
| /wikis list | List all wikis with sync state |
| /wikis status | Show what's changed since last ingest |
| /wikis ingest | Ingest unsynced raw files into wiki pages |
| /wikis ingest --later | Mark files for later — zero token usage |
| /wikis trace <file> | Show bidirectional provenance for any file |
| /wikis report | Generate a filterable HTML provenance report |
| /wikis recover manifest | Restore manifest from backup |
| /wikis rebuild-manifest | Re-derive manifest from disk scan |
| /wikis recover schema | Reset WIKI.md to the default template |
CLI scripts
Three deterministic scripts are available directly (used internally by the skill, but callable standalone):
# List all wikis in a project
wikis scan --list <project-root>
# Show sync status for a wiki
wikis scan --status <wiki-path>
# Record a raw → wiki ingestion in the manifest
wikis record <wiki-path> <raw-file> <wiki-page>
# Generate a static HTML report
wikis report <wiki-path> <output.html>Project structure
Running /wikis init creates:
project/
wikis/
<name>/
raw/ ← drop source files here (PDFs, notes, docs)
wiki/ ← compiled wiki pages live here
WIKI.md ← schema: domain conventions for the LLM
.wiki-manifest.json
.wiki-manifest.backup.json
.wiki-context ← active wiki name (set by /wikis use)Multiple wikis are fully independent — different raw sources, different wiki pages, separate manifests.
Manifest
Each wiki has a bidirectional manifest tracking every raw/ → wiki/ relationship:
{
"version": "1.0",
"wiki_name": "auditor",
"last_ingestion": "2026-05-30T12:00:00Z",
"raw_to_wiki": {
"raw/paper.pdf": {
"hash": "sha256...",
"ingested": 1748600000000,
"deferred": false,
"wiki_pages": ["wiki/concept-a.md"]
}
},
"wiki_to_raw": {
"wiki/concept-a.md": {
"hash": "sha256...",
"sources": ["raw/paper.pdf"]
}
}
}The LLM never writes the manifest directly — only the deterministic scripts do, atomically, with a backup before every write.
License
MIT
