LLM Wiki Compiler
A Claude Code plugin that compiles scattered markdown knowledge files into a topic-based wiki. Reduce context costs by ~90% and get instant answers from synthesized knowledge.
Inspiration
This plugin implements the LLM Knowledge Base pattern described by Andrej Karpathy:
"Raw data from a given number of sources is collected, then compiled by an LLM into a .md wiki, then operated on by various CLIs by the LLM to do Q&A and to incrementally enhance the wiki, and all of it viewable in Obsidian. You rarely ever write or edit the wiki manually, it's the domain of the LLM."
The key insight: instead of re-reading hundreds of raw files every session, have the LLM compile them into topic-based articles once, then query the synthesized wiki. Knowledge compounds instead of fragmenting.
What It Does
You have 100+ markdown files across meetings, strategy docs, session notes, and research. Every Claude session re-reads them. This plugin compiles them into topic-based articles that synthesize everything known about each subject — with backlinks to sources.
Before: Read 13+ raw files (~3,200 lines) per session
After: Read INDEX + 2 topic articles (~330 lines) per session
Install
From GitHub
# 1. Clone the repo
git clone https://github.com/ussumant/llm-wiki-compiler.git
# 2. Add as a local marketplace
claude plugin marketplace add /path/to/llm-wiki-compiler
# 3. Install the plugin
claude plugin install llm-wiki-compiler
# 4. Restart Claude Code for hooks to register
For a Single Session (no install)
claude --plugin-dir /path/to/llm-wiki-compiler/plugin
Quick Start
# 1. Initialize — auto-detects your markdown directories, creates config
/wiki-init
# 2. Compile — reads all sources, creates topic articles (5-10 min first run)
/wiki-compile
# 3. Browse in Obsidian — open wiki/INDEX.md to see all topics with backlinks
# 4. (Optional) Add the wiki to your AGENTS.md so Claude uses it automatically
# See "Integrating with AGENTS.md" section below
After step 4, Claude naturally reads wiki articles as part of its normal session flow — no special commands needed.
How It Works
Commands
| Command | Purpose |
|---|
/wiki-init | One-time setup -- auto-detects markdown directories, creates config |
/wiki-compile | Compiles source files into topic articles (incremental -- only recompiles changes). Generates schema.md on first run. |
/wiki-lint | Health checks -- finds stale articles, orphan pages, missing cross-references, contradictions, low coverage |
/wiki-query | Optional -- Q&A against the wiki. Can file useful answers back into wiki articles. |
/wiki-upgrade | Update the plugin to the latest version from GitHub |
The primary workflow is: init → compile → add to AGENTS.md → done. After that, Claude reads the wiki automatically. /wiki-query is a convenience for testing or quick lookups.
Staged Adoption (The Key Feature)
The plugin never modifies your existing CLAUDE.md or AGENTS.md. Instead, it injects context via a SessionStart hook with three modes:
| Mode | What Happens | Your Existing Setup |
|---|
| staging (default) | "Wiki available — check it when you need depth" | Completely unchanged |
| recommended | "Check wiki articles before raw files" | Unchanged, but Claude prioritizes wiki |
| primary | "Wiki is your primary knowledge source" | You can optionally simplify startup reads |
Change mode by editing .wiki-compiler.json:
{ "mode": "staging" } → { "mode": "recommended" } → { "mode": "primary" }
What Gets Compiled
Each topic article contains:
- Summary — 2-3 paragraph briefing (standalone understanding)
- Timeline — Key events with dates
- Current State — What's true right now
- Key Decisions — With rationale and source links
- Experiments & Results — Status table
- Gotchas & Known Issues — Topic-specific traps
- Open Questions — Unresolved threads
- Sources — Backlinks to every raw file (Obsidian wikilinks)
Coverage Indicators (Best of Both Worlds)
Every section includes a coverage tag so you (or your AI agent) know when to trust the wiki vs when to read raw sources:
## Summary [coverage: high -- 15 sources]
...trust this, it's well-sourced...
## Experiments & Results [coverage: medium -- 3 sources]
...decent overview, check raw files for details...
## Gotchas [coverage: low -- 1 source]
...read the raw gotchas.md directly...
- high (5+ sources) — trust the wiki section directly
- medium (2-4 sources) — good overview, check raw sources for granular questions
- low (0-1 sources) — read the raw sources listed in that section