zosmaai/pi-llm-wiki/llm-wiki
Claude Code and agent skill by zosmaai/pi-llm-wiki
- community
Checking that the SKILL.md file is still in the repository.
Build and maintain a persistent, interlinked Obsidian-compatible markdown wiki using Karpathy's LLM Wiki pattern. Extension-backed with auto-generated metadata, guardrails, and 14 custom tools (+3 opt-in agent-trajectory tools).
Install
npx vskill@latest install zosmaai/pi-llm-wiki/llm-wikiSKILL.md
LLM Wiki for Pi
You are a disciplined wiki maintainer. The extension handles all mechanical work — you focus on synthesis, reasoning, and knowledge organization.
Architecture (4 Layers)
meta/qmd/is extension-owned, generated, and rebuildable withwiki_reindex. It neverscanswiki/directly — it indexes parser-valid mirrors. Do not edit individual SQLite/WAL/SHMfiles insidemeta/qmd/current/; restore the whole directory or rebuild. Active recall still usesthe legacy heuristic until Phase 3.
Golden Rules
- RAW IS IMMUTABLE. Never edit
raw/. Usewiki_capture_sourceto add sources. - META IS EXTENSION-OWNED. Never edit
meta/directly.events.jsonlis append-only authoritative activity state; other metadata files are generated projections. - YOU OWN THE WIKI. Create, update, and cross-reference everything in
wiki/. - ONE FILE PER THING. Each entity, concept, source gets its own
.mdfile. - CROSS-REFERENCE EVERYTHING. Every page needs at least 2 links. Prefer standard Markdown:
[label](/folder/page.md). Legacy wikilinks[[folder/page]]remain readable. - CITE SOURCES. Every claim links back to its raw source packet.
- FLAG CONTRADICTIONS. When sources disagree, document both sides.
Preservemeta/events.jsonlin full-vault backups.meta/log.mdandwiki/log.mdcannot reconstruct it. Do not place secrets or private machine paths in manual event details.
Agent Working-Memory (Trajectories)
The wiki captures not only what you read (sources) but what you do (trajectories). A completed task is just another kind of source, so it flows through the same pipeline:
Opt-in, off by default (issue #80). The three tools below are only registeredwhenllm-wiki.trajectoriesis enabled. Turn it on with/wiki-trajectories on(off with/wiki-trajectories off); toggling reloads the extension. When off, thetools are absent entirely — no system-prompt cost.
wiki_capture_trajectorywrites the immutable packet + a self-contained summary
(extracted.md), auto-extracting the tool-call sequence from the live session (you usually only pass a title). It does not emit a to-be-fleshed skeleton — capture is a single lightweight call.
wiki_distill_skillsreturns undistilled trajectories so you can generalize them
into reusable skill pages (and optionally case pages) via wiki_ensure_page.
wiki_recall_skillfilters layered recall toskill/casepages —
"have I done something like this before?". Call it at task start.
A skill generalizes across many trajectories ("how I do X"); a case is one concrete past run ("the time I did X for project Y"). Trajectory packets live under raw/** and are therefore immutable under the same guardrail as source packets — edit the case/skill pages, never the packet.
When to use which memory tool
| Tool | Stores | Use for | |
|---|---|---|---|
wiki_capture_trajectory | A structured, replayable tool-call packet (packet.json: tool names + arguments + results + errors) | "How did I mechanically solve this?" — the exact step sequence, to distill into a repeatable skill | |
wiki_retro | A durable prose insight (one markdown file) | "What did I learn?" — a lesson/gotcha worth keeping, not a step list | |
wiki_observe | A timestamped prose observation | Lightweight running notes the extension reminds you to jot during a task |
Why a separate trajectory store and not pi's built-in observational-memory? pi's observational-memory keeps prose for context-compaction survival — it does not persist the structured tool-call sequence (names, arguments, results). The trajectory packet is the only artifact that captures a task as a replayable record, which is what makes skill distillation possible.
How the Extension Helps You
| Task | Before (skill-only) | Now (extension-backed) | |
|---|---|---|---|
| Track ingestion | Manual history.json | Automatic via meta/registry.json | |
| Update INDEX | Manual edit after every page | Auto-rebuilds on turn end | |
| Update LOG | Manual append | Auto-generated from events.jsonl | |
| Find orphans | Shell grep scans | Instant from backlinks.json | |
| Block raw edits | Skill says "don't" | Extension enforces immutability | |
| Create source page | 8 tool calls | wiki_capture_source + LLM synthesis | |
| Recall wiki knowledge | Never happens | Layered search before every turn (personal + project) | |
| Save task insights | Manual capture | wiki_retro — one tool call |
🔄 Wiki Usage
At Start — Call wiki_recall
Call `wiki_recall` at the START of every task to find relevant wiki pages:
This searches both your personal wiki (~/.llm-wiki/) and the project wiki (.llm-wiki/ in the current directory), merging results.
The extension also briefly searches automatically, but explicit calls with task-specific terms get better results.
Two-Stage Recall (links-first for large vaults)
Recall scales with vault size via two-stage retrieval (memex-style):
- Small vaults (page count ≤ threshold): recall returns inline content previews — read them directly, no extra step.
- Large vaults (page count > threshold): recall returns a ranked list of links only —
id,title,type,score, and a 1-line snippet. No full previews are injected, to protect your context window.
The two-step contract for large vaults:
- Stage 1 — scan the links.
wiki_recall(and the auto-injected "Relevant Wiki Knowledge (links-first)" section) gives you ranked[[id]]links with scores and short snippets. Use the scores and snippets to pick the few pages that actually matter. - Stage 2 — expand on demand. Call
read(orwiki_read) on the chosen link paths to pull their full content. Do not assume the snippet is the whole page — open the link before relying on its content.
The gate is the recallLinksThreshold setting (namespaced llm-wiki, default 50 pages). Page count is read from meta/registry.json (O(1), no page-body I/O). Set it to 0 to force links-first always, or a large number to always keep previews inline.
Skills/cases carve-out (recall adherence): distilled skill/case pages (from the opt-in trajectories feature) are meant to be applied immediately, so recall inlines their short body directly instead of a bare link the agent tends to skip. The recallSkillInlineMax setting (namespaced llm-wiki, default 1600 chars, clamped to a non-negative integer) caps how much body is inlined; set it to 0 to disable inlining entirely (skills/cases fall back to pure links-first, and no page body is read at format time). Only relevant when trajectories is enabled.
At End — Save Insights with wiki_retro
After completing any meaningful task, call wiki_retro to save key insights:
- Non-obvious bug fixes or workarounds
- Architectural decisions and their rationale
- Tool/library gotchas you discovered
- Patterns worth remembering for future sessions
Do not wait for the user to ask. Save insights proactively — one atomic insight per call.
Deeper Searches
For thorough research, also use wiki_search to browse the full registry:
Background Model Selection (/wiki-model)
The wiki's background work (ingest synthesis, etc.) runs on a model you can choose. By default it uses the current session model — zero config.
- View / pick interactively: run
/wiki-modelwith no argument to see the active model and pick from the available models. - Set directly (scriptable):
/wiki-model anthropic/claude-haiku(aprovider/idref). - Revert to session model:
/wiki-model session(alsoclear/default/reset).
The choice is persisted to project settings (.pi/settings.json under llm-wiki.taskModel) and shown in the status bar.
Per-call override: heavy tools accept an optional model param (provider/id) that overrides the configured model for that one call. Precedence is override > configured `taskModel` > session model; an unknown ref degrades gracefully to the configured/session model. Example:
Settings Screen (/wiki-settings)
Interactive settings: run /wiki-settings to open a persistent settings screen. It lists every llm-wiki setting with its current value and where it is set (project overrides global; the default is shown when unset). Booleans cycle in place with Enter/Space; numbers, strings, and the model edit inline in a prefilled input. Every change persists immediately to the chosen scope (project or global). Setting the model to session clears llm-wiki.taskModel (back to the session model).
Dashboard Screen (/wiki-dashboard) Read-only vault health: run /wiki-dashboard to open a persistent read-only screen: page counts by type + total size, last page touch + stale (30d+) count, activity by kind last 7 days (observes/retros/syntheses), pending raw-source ingest queue, zero-backlink page count (see /wiki-lint full scan), embedding coverage (emb/ files vs. pages). All values computed from existing on-disk state — no writes, no LLM calls. Esc closes.
Auto-Bootstrap (One-Time)
The extension creates the wiki vault automatically on startup. On the first turn, it injects a directive asking you to infer topic and mode, then call:
This is a one-time step.
Available Tools
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/llm-wiki/SKILL.md
Popularity
- Repository stars
- 599
- Repository forks
- 44
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zosmaai/pi-llm-wiki/llm-wiki)