Sandbox
@6eanut/llm-wiki

Claude Code skill for a persistent wiki

LLM Wiki is a Claude Code skill that ingests source documents into a linked wiki, then keeps that wiki available for future questions. It uses `CLAUDE.md`, session hooks, slash commands, and generated wiki pages to make knowledge retrieval part of the normal Claude Code flow.

44 stars10 forksShellUpdated 4mo ago
Who it's for

Builders who use Claude Code and want a reusable knowledge base that stays in sync with source documents.

What it delivers

You can ask Claude to use the wiki first, so answers come from compiled pages instead of re-reading the same sources every time.

What it does

Two-phase ingest

`/wiki-ingest` first writes an analysis file, then generates wiki pages after review.

Auto-generated index

`wiki/.llm-wiki/index.md` is regenerated on change so Claude can find relevant pages quickly.

Session hooks

`session-start.sh` and `session-stop.sh` add wiki stats at startup and carry context into the next session.

Persistent synthesis pages

`/wiki-save` stores answers as `synthesis` pages with query, sources, and confidence.

Lint and review commands

`/wiki-lint` and `/wiki-review` check links, structure, and pending review items.

Bilingual wiki support

Page schema and aliasing support English, Chinese, and bilingual pages.

How to get it

  1. 1Run
    git clone https://github.com/6eanut/llm-wiki
    cd llm-wiki
    ./quickstart.sh
  2. 2After setup, start Claude Code and run
    /wiki-ingest .raw/greek-olympians.md
  3. 3Run
    ./quickstart.sh --with-hooks
  4. 4Prefer manual control? Here's the three-step version
    ./llm-wiki/install.sh --force                                           # 1. Install skill
    ~/.claude/skills/llm-wiki/scripts/setup-project.sh ./wiki --with-hooks  # 2. Init wiki
    # 3. Drop source files in .raw/ and run /wiki-ingest

README

LLM Wiki — Compounding Knowledge Base for Claude Code

License: MIT CI PRs Welcome

A Claude Code skill that builds and maintains a persistent, interlinked wiki from your source documents. Based on Andrej Karpathy's LLM Wiki pattern.

Knowledge is compiled once and kept current, not re-derived on every query.

image

Quick Start

One Command

git clone https://github.com/6eanut/llm-wiki
cd llm-wiki
./quickstart.sh

That's it. The script installs the skill, initializes the wiki, and drops in demo source files (Greek mythology — optional, use --no-demo to skip).

After setup, start Claude Code and run:

/wiki-ingest .raw/greek-olympians.md

Then ask anything about the content — Claude checks the wiki automatically.

With Session Hooks (Recommended)

./quickstart.sh --with-hooks

This enables:

  • Dynamic wiki stats at startup — page count, recent changes, pending reviews injected at the start of every session
  • Hot-cache for session continuity — context from your last session is bridged forward so you don't lose state between sessions

Manual Setup

Prefer manual control? Here's the three-step version:

./llm-wiki/install.sh --force                                           # 1. Install skill
~/.claude/skills/llm-wiki/scripts/setup-project.sh ./wiki --with-hooks  # 2. Init wiki
# 3. Drop source files in .raw/ and run /wiki-ingest

More Options

See the Quick Start Guide on the wiki for troubleshooting and advanced configuration.

What to Expect

After setup, start Claude Code in your project and ask a question:

You: "What is the relationship between Zeus and Athena?"

Claude: [reads ./wiki/.llm-wiki/index.md automatically]
        [finds relevant pages]
        [synthesizes answer with citations]

        ## Answer
        Athena is Zeus's daughter, born from his head...

        ## Evidence
        | Source Page | Key Point | Confidence |
        |-------------|-----------|------------|
        | [[athena]] | emerged from Zeus's forehead | high |
        | [[zeus]] | Father of Athena | high |

You don't need to type /wiki-query for routine questions. Claude reads CLAUDE.md at startup and follows the rule: "check the wiki before answering."

If the wiki doesn't have relevant knowledge, Claude will tell you and suggest adding source files to .raw/.

Adding Your Own Knowledge

  1. Drop source files (markdown, text) into ./.raw/
  2. Run /wiki-ingest .raw/your-file.md
  3. The file is analyzed, concepts extracted, and interlinked pages created


Architecture

How Proactive Wiki Works

Session starts
    ↓
Claude reads CLAUDE.md → "Check the wiki before answering"
    ↓
SessionStart hook runs → wiki stats, topics, pending items
    ↓
Slash commands auto-discovered from ~/.claude/commands/
    ↓
Skill auto-registered as "wiki" from ~/.claude/skills/llm-wiki/
    ↓
User asks any question
    ↓
Claude reads index.md → finds relevant pages → answers with citations

Key Architectural Decisions

DecisionRationale
CLAUDE.md for rulesAlways-loaded, no tool call needed. Tells Claude WHEN to use the wiki.
SessionStart hook for stateDynamic wiki stats (pages, topics, pending items) injected each session.
LLM is the runtimeAll content work done by Claude. No external language runtime needed.
Bash for determinism onlySHA-256 hashing, file listing, grep — correctness-critical operations only.
Markdown workflow filesEach command has a workflows/*.md procedure. Documentation = executable instructions.
Two-phase ingestPhase 1 (analysis) writes a reviewable analysis before Phase 2 (generation) creates pages.
Auto-generated indexindex.md regenerated on every change. Enables O(1) lookup of relevant pages.
SHA-256 incremental caching.done sentinel files prevent re-ingestion. Safe to re-drop sources.

Three-Layer Data Architecture

.raw/ (sources)    →    wiki/ (pages)    →    skill (schema + workflows)
  (immutable)            (LLM-generated)       (conventions)

Wiki Directory Structure

wiki/
├── .llm-wiki/
│   ├── schema.md                   Copy of WIKI_SCHEMA.md
│   ├── config.md                   User preferences
│   ├── index.md                    ★ AUTO-GENERATED — never edit by hand ★
│   ├── review.json                 {pending: [...], resolved: [...]}
│   ├── cache/
│   │   ├── hot-cache.md            Multi-session context bridge
│   │   ├── source-manifest.json    SHA-256 → source metadata
│   │   ├── state-hash.txt          Detects external modifications
│   │   └── ingests/{sha256}.done   Sentinel files (idempotent ingestion)
│   └── inbox/{sha256}-analysis.md  Phase 1 ingest analyses
├── transformer.md                  Concept page
├── 2026-04-28-weekly-notes.md      Article page
├── alan-turing.md                  Person page
└── synth-2026-04-28-riscv.md       Synthesis page

Page Types

concept — Define a term, idea, methodology, tool

type: concept
language: en | zh | bilingual

Body: Definition → Key Properties → Examples → Related

article — Notes, blog drafts, imported documents

type: article

File: YYYY-MM-DD-{slug}.md

person — Author, researcher, notable individual

type: person

synthesis — Saved query answer (the compounding mechanism)

type: synthesis
query, based_on[], confidence: high | medium | low

File: synth-YYYY-MM-DD-{slug}.md


Bilingual Support

  • Auto-detection: CJK character ratio determines zh / en / bilingual
  • Page titles: "English / 中文" format for bilingual pages
  • Cross-language wikilinks: aliases field provides translations for link resolution
  • Query matching: Prefers same-language pages, falls back across languages

Skill File Map

llm-wiki/
├── SKILL.md                         Skill manifest with proactive usage rules
├── WIKI.md                          CLAUDE.md template (copied to project root)
├── WIKI_SCHEMA.md                   Page type definitions & conventions
├── install.sh                       Global installation (one-time)
├── commands/                        Auto-discovered slash commands
│   ├── wiki-ingest.md               /wiki-ingest
│   ├── wiki-query.md                /wiki-query
│   ├── wiki-lint.md                 /wiki-lint
│   ├── wiki-save.md                 /wiki-save
│   ├── wiki-graph.md                /wiki-graph
│   └── wiki-review.md               /wiki-review
├── templates/                       Page templates (article, concept, person, synthesis)
├── scripts/                         Deterministic bash operations
│   ├── setup-project.sh             ★ One-stop project setup
│   ├── init-wiki.sh                 Bootstrap new wiki directory
│   ├── hash-files.sh                SHA-256 hash source files
│   ├── check-stale.sh               Index freshness check
│   ├── find-orphans.sh              Pages with zero incoming links
│   ├── validate-frontmatter.sh      Required field validation
│   └── find-broken-links.sh         Dead wikilink detection
├── workflows/                       Deep workflow procedures (read by the skill)
│   ├── ingest.md                    Two-phase source ingestion
│   ├── query.md                     Index-first knowledge retrieval
│   ├── lint.md                      Structural + semantic health check
│   ├── save-synthesis.md            Persist answers as synthesis pages
│   ├── graph.md                     D3.js knowledge graph generation
│   └── review.md                    Review queue processing
└── hooks/                           Session lifecycle
    ├── session-start.sh             Wiki stats + PROACTIVE WIKI RULE
    └── session-stop.sh              Write hot-cache for next session

Compared to RAG

Typical RAGLLM Wiki
Knowledge stateRe-derived per queryPersisted, compounding
Cross-referencesNoneBidirectional [[wikilinks]]
ContradictionsUndetectedFlagged with callout blocks
ConfidenceOpaqueExplicit per-page ratings
Audit trailNonebased_on provenance chain
Query costEvery query reads source chunksIndex-first: only 3-5 pages read
ProactiveNo — must be invokedYes — CLAUDE.md + hook drives behavior

Note: Advanced RAG implementations can include some of these features, but they're not standard. LLM Wiki provides them by design.


Design Principles

PrincipleImplementation
LLM is the runtimeAll content work done by Claude. No external language runtime needed.
Bash for determinismSHA-256, grep, file listing — correctness-critical operations only.
Auto-generated indexRegenerated on every change. Never hand-edited.
Incremental cachingSHA-256 sentinel files prevent re-work.
Two-phase ingestHuman checkpoint between analysis and generation.
Hot cacheMulti-session context bridge via SessionStop/SessionStart hooks.
True bilinguallanguage field, CJK detection, cross-language aliases.
Lint separationQuick (bash, free) vs Full (LLM, thorough) — pay only when needed.

Community


Credits

License

MIT — see LICENSE for full text.

Files in the repo

Repository payload20 top-level entries
  • .githooks
  • .github
  • .raw
  • llm-wiki
  • scripts
  • .editorconfig
  • .gitignore
  • .markdownlint-cli2.jsonc
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • FAQ.md
  • LICENSE
  • llm-wiki.md
  • package.json
  • quickstart.sh
  • README.md
  • SECURITY.md
  • SUPPORT.md
  • uninstall.sh

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

117k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k