Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

wiki-skill

Claude Code License: MIT

A Claude skill that implements Karpathy's LLM Wiki pattern — a persistent, Claude-maintained knowledge base for any project.

Instead of re-deriving knowledge every session, Claude builds and maintains a structured markdown wiki that grows with every source you add and every question you ask. Cross-referenced. Contradiction-aware. Always in sync with your project.

Based on the LLM Wiki pattern by Andrej Karpathy.


Why this exists

Most people's experience with LLMs and documents is retrieval: you ask, the model searches, it answers. Nothing accumulates. Ask a question that requires synthesizing five sources and the model pieces it together from scratch — every time.

The wiki pattern is different. Claude doesn't just retrieve — it maintains. When you add a source, Claude reads it, extracts key information, and integrates it into an existing wiki: updating entity pages, revising summaries, flagging contradictions. The knowledge is compiled once and kept current, not re-derived on every query.

The wiki is a persistent, compounding artifact. The cross-references are already there. The contradictions have been flagged. The synthesis reflects everything that's been read.


What it does

wiki/
├── index.md          ← catalog of all pages (Claude reads this first)
├── log.md            ← append-only operation log
├── sources/          ← one summary page per ingested document
├── entities/         ← people, projects, products, places
├── concepts/         ← ideas, themes, technical terms
└── queries/          ← saved answers to important questions

raw/
└── inbox/            ← drop new documents here for ingestion

Claude owns the wiki/ directory entirely. You own the curation, exploration, and questions. Claude handles the summarizing, cross-referencing, filing, and consistency maintenance.


Installation

Option 1 — Full install (recommended)

Clones the skill with all reference files and domain templates:

git clone https://github.com/bellins14/wiki-skill ~/.claude/skills/wiki

Option 2 — Minimal install

Copies only SKILL.md. The skill works standalone; reference files add richer behavior:

mkdir -p ~/.claude/skills/wiki
curl -sSL https://raw.githubusercontent.com/bellins14/wiki-skill/main/SKILL.md \
  -o ~/.claude/skills/wiki/SKILL.md

Option 3 — Ask Claude Code to install it

In a Claude Code session:

Install the wiki skill from github.com/bellins14/wiki-skill

Verification

After installation, open a project in Claude Code and run:

/wiki init

Claude will auto-detect your project context and set everything up.


Commands

Command Description
/wiki init Initialize wiki (auto-detects context, minimal questions)
/wiki ingest [doc?] Ingest a document from inline, file path, or raw/inbox/
/wiki query <question> Query the wiki; answer includes wiki citations
/wiki lint Health check: orphans, contradictions, stale pages, gaps
/wiki update Sync wiki with current project state (git log, file changes, decisions)

Note: Only /wiki is registered as a slash command. Subcommands are passed as arguments: /wiki init, /wiki ingest, etc.


Setup behavior

/wiki init is designed to require zero configuration in most projects. Claude reads your existing files (README, CLAUDE.md, package.json, etc.) and infers everything it needs:

  • Project name — from package.json, pyproject.toml, or README
  • Domain — from file structure signals (notebooks → research, chapter files → reading, etc.)
  • Language — from README and existing content

If context is insufficient, Claude asks a single question with a sensible default.

CLAUDE.md integration

The skill appends a wiki configuration block to your project's CLAUDE.md:

  • CLAUDE.md exists → appends at the end
  • CLAUDE.md doesn't exist → runs claude init first, then appends

The block is wrapped in <!-- wiki-skill:begin --> / <!-- wiki-skill:end --> markers so it can be found and updated during re-init without duplication.


How /wiki update works

/wiki update keeps the wiki consistent with your project as it evolves. It:

  1. Reads git log for recent commits (if git is available)
  2. Checks for files modified since the last wiki log entry
  3. Scans recent conversation context for decisions and status changes
  4. Identifies what's changed but not yet reflected in the wiki
  5. Updates affected pages, reports what changed

Run it periodically or after a batch of significant work.


Domains

The skill ships with templates for four project types:

Domain Detected from
research .ipynb, papers/, .bib, notebooks/
reading chapters/, books/, book-like markdown structure
personal journal/, diary/, personal README tone
business Everything else (default)

Each domain pre-configures appropriate entity types, page templates, and wiki structure.


Tips

  • Obsidian pairs well with this wiki — open the wiki/ directory as a vault to get the graph view, backlinks, and Dataview queries over page frontmatter.
  • Obsidian Web Clipper converts web articles to markdown. Drop clipped articles in raw/inbox/ and run /wiki ingest.
  • The wiki/log.md is grep-friendly: grep "^## \[" wiki/log.md | tail -10 returns the last 10 operations.
  • Saved /wiki query answers become first-class wiki pages — your explorations compound just like ingested sources.
  • The wiki/ directory is just a git repo of markdown files. Version history, branching, and collaboration come for free.

Project structure

wiki-skill/
├── SKILL.md                          ← main skill (sufficient for minimal install)
├── references/
│   ├── commands.md                   ← extended command docs and edge cases
│   ├── setup.md                      ← setup flow and CLAUDE.md merge logic
│   ├── claude-md-template.md         ← the wiki block appended to CLAUDE.md
│   └── domains/
│       ├── research.md               ← research wiki templates
│       ├── reading.md                ← reading/book wiki templates
│       ├── personal.md               ← personal knowledge base templates
│       └── business.md              ← business/general wiki templates
├── README.md
└── LICENSE

Credits

This skill is a direct implementation of the LLM Wiki pattern by Andrej Karpathy. The core ideas — persistent wiki over RAG, LLM as maintainer not just retriever, compounding knowledge artifacts — are all his.


License

MIT — see LICENSE.