Claude Code Plugin

llm-wiki — your codebase's
living memory

A Claude Code plugin that maintains docs/wiki/ as a self-healing DAG of LLM-authored pages, automatically kept in sync as your codebase evolves.

What is llm-wiki?

llm-wiki turns your Claude Code sessions into a living documentation engine. Every time you edit a source file, a hook logs the change. When enough changes accumulate, a background agent reconciles them into structured wiki pages — automatically and without interrupting your flow.

✏️
File edit
PostToolUse hook
📋
Pending queue
changes.jsonl
🤖
wiki-maintainer
agent
🕸️
Wiki DAG
docs/wiki/
🔗
Cross-links
bidirectional

The wiki is a directed acyclic graph — each page tracks its raw source files in frontmatter, and all cross-references are bidirectional. Pages are typed: entity, feature, endpoint, story, eis. The graph can be linted, spidered, and reconciled on demand.

Five slash commands

Everything you need to bootstrap, maintain, and explore your wiki.

/init
One-time population of docs/wiki/ from existing codebase sources — Prisma models, API routes, user stories, and EIS documents. Runs phases in parallel and cross-links all results.
/sync
Manually drain .pending/changes.jsonl into wiki pages. Use after a large refactor or when you want to sync changes without waiting for the threshold hook to fire.
/audit
Health-check the entire wiki DAG. Finds orphaned pages, broken links, stale reconciliation dates, contradictions, and asymmetric cross-references. Can fix issues automatically on request.
/explore-feature <feature>
Spider the wiki DAG from any entry point — feature name, entity, or concept — up to a configurable BFS depth. Returns a structured brief of everything the wiki knows about that topic.
/create-feature <description>
Author a new Executable Implementation Spec from a natural-language description. Runs overlap detection against existing EIS documents and feasibility analysis before writing.

What's inside

The plugin ships five agents, five commands, three skills, two hooks, and three shell scripts.

Agents
  • wiki-maintainer
  • wiki-linter
  • wiki-spider
  • eis-author
Commands
  • init
  • sync
  • audit
  • explore-feature
  • create-feature
Hooks
  • log-change.sh
  • threshold-check.sh
  • wiki-graph.sh
Skills
  • doc-guide
  • spec-guide
  • product-map
docs/wiki/
├── index.md          # auto-rebuilt master index
├── log.md            # append-only drain history
├── schema.md         # wiki contract (frontmatter spec, link rules)
├── .pending/
│   └── changes.jsonl # hook-written pending queue
├── entities/         # one page per Prisma model
├── features/         # synthesized feature areas
├── endpoints/        # one page per API route
├── stories/          # user story summaries
└── eis/              # executable implementation specs

Zero-friction auto-sync

llm-wiki uses Claude Code's PostToolUse hook to track every file change without interrupting your flow.

Whenever Claude edits a file in src/, docs/, or prisma/, log-change.sh appends a timestamped JSON entry to docs/wiki/.pending/changes.jsonl. Then threshold-check.sh counts the queue — when it crosses a configurable threshold (default: 10 changes), it automatically spawns the wiki-maintainer agent to drain the queue and update wiki pages.

The drain is idempotent — safe to run at any queue depth. It reads changed raw sources, reconciles them into existing wiki pages, handles contradictions by flagging rather than silently overwriting, and truncates the queue only after full success.

Standing on shoulders

llm-wiki is an extension of Andrej Karpathy's original idea for using language models to maintain living documentation alongside code. The core insight — that LLMs should be first-class authors of a project's knowledge graph, not just consumers of it — comes directly from his work.

Original idea: gist.github.com/karpathy/442a6bf555914893e9891c11519de94f

Install in 30 seconds

Add the plugin to your Claude Code project, bootstrap once, and let the hooks keep it current.

/plugin marketplace add esxr/product-wiki
/plugin install product-wiki@pranav.com.au
/reload-plugins

Then bootstrap from your existing codebase:

/init

Hooks maintain the wiki automatically after that. Run /audit any time to health-check the graph.