/llm-wiki:llm-wiki <setup|ingest|query|prune|lint|status|import> [args]from LLM Wiki for Logseq and Obsidian
Maintains a persistent LLM wiki in Logseq or Obsidian with L1/L2 cache architecture. Supports setup, ingest, query, prune, lint, status, and import subcommands for structured knowledge management.
Ships in LLM Wiki for Logseq and Obsidian. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Persistent knowledge management powered by Claude Code. Maintains a structured wiki in Logseq or Obsidian using the L1/L2 cache architecture.
Architecture: L1/L2 Cache Model
Two cache mechanisms keep L2 precise as it grows:
### Index of routing lines (one per child: [[link]] -- description #tags). query
becomes two-stage: read the cheap hub indexes -> pick the 3 most relevant pages by description ->
read only those full pages. This is the wiki's "page table / TLB" — no more grep-over-everything.query logs every page hit; prune evicts cold pages (no access in N months) from
the live index. Eviction != deletion: the file stays (marked archived::), still greppable as an L3
fallback, all [[links]] intact. Access-frequency eviction — the missing CPU-cache mechanism.One mechanism keeps L1 honest:
asserts-current-behavior: true (a path, command, flag, version,
quirk — can silently go stale) or false (a decision, preference, identity — never stale), plus
verified: <date> for behavior claims. lint reports claims past l1_verify_days; prune --l1 checks
them against read-only evidence and lets the user re-verify, demote to L2, or delete./llm-wiki ingest <source> Process source, create/update wiki pages
/llm-wiki query <question> Search wiki (two-stage via hub index), synthesize answer
/llm-wiki prune [--months N] LRU-Demote: evict cold pages from the live index (default 6 months)
/llm-wiki prune --l1 [--batch N] [--days N]
L1-Verification: classify L1 rules, check due claims, re-verify/demote/delete
/llm-wiki lint [--fix] Health check: orphans, stale, broken refs, index drift
/llm-wiki status Wiki metrics and health overview (incl. hot/cold profile)
/llm-wiki import Import existing notes into wiki format
/llm-wiki setup One-time: create the wiki skeleton and llm-wiki.yml in the wiki root
Wiki root: ${user_config.wiki_path}
The wiki root above is set by the plugin's "Wiki root" option, or written in by hand for a copied skill. If it is not a filesystem path but an unexpanded placeholder (it starts with a dollar sign and a brace), stop and tell the user: "Wiki root is not configured. Set it in the llm-wiki plugin settings, or replace the placeholder in a copied skill (see README)." Never guess a wiki root.
Read llm-wiki.yml from the wiki root FIRST (every command except setup, which creates it). If the
file is missing, stop with: "llm-wiki.yml not found in . Run /llm-wiki setup to create one." If its wiki_path
names a different directory than the wiki root above, warn once, naming both paths, and continue
with the wiki root above. The config determines:
tool: logseq or obsidianwiki_path: path to the graph/vaultpages_dir: where pages live (relative to wiki_path)memory_path: L1 memory directory (optional; without it, L1 features are skipped)l1_verify_days: days until an L1 behavior claim is due for re-verification (optional, default 90;
invalid value -> warn and use 90)namespaces: configured top-level namespaces- (outliner format)property:: value syntax on first lines (NO YAML frontmatter)Wiki___Tech___Strapi.md)pages/ directory- - ## Heading- prefix required)---\ntype: knowledge\n---)Wiki/Tech/Strapi.md)## Heading syntax[[Wiki/Namespace/Page]] syntaxWiki/Schema (or Wiki___Schema.md) for conventionsPhase 1 - Source Analysis:
Phase 2 - Wiki Scan:
Phase 3 - Page Operations (target: 5-15 page touches):
History
child (newest first). Never append "Status : ..." sentences to running prose### Index
section, set/update the routing line — [[Wiki/NS/Page]] -- <one-sentence description, <=120 chars> #tag #tag.
New page -> append a line; refocused page -> refresh the description. The description is the routing
key for query Phase 0 — keep it terse, distinctive, no filler ("Notes about ...").## Change log)Phase 4 - Quality Gate:
### Index? (else it is unroutable)Phase 5 - Report:
Phase 0 - Routing (Stage 1, cheap index read):
### Index (title -- description #tags) against the questionPhase 1 - Targeted Read (Stage 2, only the chosen pages):
Phase 1b - Access Logging (LRU signal + routing transparency):
- <ISO-date> -- [[Wiki/NS/Page]] -- query -- matched: "<reason>"matched: reason = the "and why" of the routing (loading transparency): on index routing
(Phase 0) the hub ### Index routing description / #tag that matched the question; on the L3 fallback
the grep term that found the page. Keep it short (<= 60 chars), in quotes. The log then shows not just
WHICH page loaded but WHY it was picked for this question — surfaced via /llm-wiki status cache profile.archived:: set) — a re-hit on an evicted page: offer to
re-promote it — move its routing line back into the hub ### Index, drop the archived:: propertyPhase 2 - Synthesize:
Phase 3 - Optional Write-Back:
Phase 4 - Output:
Purpose: evict cold pages from the live hub index so two-stage routing stays precise as the wiki grows. Demotion != deletion — the file stays, only its routing line leaves the live index. Cache analogy: eviction from the index/TLB; data remains in the backing store (greppable as L3). Meant as a periodic run (default cadence N = 6 months) — wire it via your scheduler; the command does NOT self-schedule.
Phase 1 - Access Profile:
Phase 2 - Demote Candidates:
### Index VERBATIM into the hub's ### Archive section
(move, not delete)Phase 3 - Report + Commit:
Purpose: find L1 rules that make claims about current behavior and check them against evidence before
they keep steering sessions. Separate from L2 eviction: prune --l1 never evicts L2 pages, plain prune
never touches L1. L1 is NOT git-tracked — there is no undo, so every write needs confirmation.
Phase 1 - Scope:
memory_path -> "memory_path not configured — L1 mode unavailable." and abort--batch N); window = l1_verify_days (--days N overrides)asserts-current-behavior and verified from the frontmatter top level OR a metadata: blockPhase 2 - Classify (up to one batch of unclassified files — no asserts-current-behavior key):
verified while classifying — a new behavior claim stays due until evidence is checkedPhase 3 - Gather Evidence (up to one batch of due rules; never-verified first, then oldest verified):
asserts-current-behavior: true AND (verified missing OR older than the window)--version / --help. NEVER run commands with side effects, write, deploy, or
touch remote state. NEVER fetch remote contentsupports / contradicts / inconclusive, with what
was checked and what was foundexecuted (read-only command), source (read the implementing code, not run),
or file (existence/content). Behavior observable only with side effects -> source or inconclusiveinconclusive,
"not locally verifiable"Phase 4 - Act (per rule, user chooses):
verified: <today>. On contradicts, offer it ONLY together with a corrected rule
text; write both together. Correct every place the claim appears: body, frontmatter description
(loaded via the index), and the rule's index linesource:: l1-demotion, date) to the most
relevant wiki page found via hub-index routing — or create a page via the ingest path. ONLY after the
wiki write succeeds: delete the L1 file. Credential rules are NEVER demoted (only re-verify or delete)name). Demote -> rewrite them to the wiki page; delete -> list them and fix on confirmation. Remove
only this file's pointer from the index; if the index line points to several files, show it before/afterPhase 5 - Report + Commit:
Out of scope: warning at the moment a due rule is about to justify an action. Claude Code loads L1, not llm-wiki — there is no hook to enforce that gate, so do not claim one.
Phase 1 - Scan:
Phase 2 - Check Rules (from Schema):
### Index with no matching page (orphaned), OR an active
(non-archived) page with no routing line in its namespace hub (unroutable -> only findable via L3 grep)-- separatorarchived:: set) still in ### Index instead of ### Archive (unclean prune)History / Change log
blocks — code blocks, tables and the Access-Log page don't count -> "split into state + history"updated:: value (page or section) that is more than an ISO datememory_path is set; skip the L1 index file):
asserts-current-behavior: true and verified missing or older than
l1_verify_days — report file name, verified date (or "never"), age in daysasserts-current-behavior key)asserts-current-behavior: false is never flagged, regardless of age/llm-wiki prune --l1Phase 3 - Report:
Phase 4 - Auto-Fix (only with --fix flag):
### Index (bootstraps old hubs that only carry bare link lists)### Index
to ### Archiveupdated:: notes out (Block Bloat): cut the value to the date, move the rest verbatim (one line
per date, newest first) into the page's collapsed ## Change log. Do NOT auto-restructure oversized
blocks — deciding what the current state is needs judgmentPhase 5 - Dashboard Update:
Phase 1 - Metrics:
Phase 2 - Health:
Phase 2b - Cache Profile (from the Access-Log page):
### Index) vs. archive-index sizematched: reasons per hot page from recent log
lines — shows not just WHICH pages are hot but WHY (which index description / grep term pulls them).
Surfaces mis-routing: a page always hit via the same grep term instead of its index line signals a
weak/missing routing description in its hub ### IndexPhase 3 - Activity:
Phase 4 - Output:
One-time. Creates the wiki skeleton in the wiki root: Schema, Dashboard, one hub page per namespace,
the Access-Log page and llm-wiki.yml. You render the bundled templates and write the files
yourself with the Read and Write tools; git runs through Bash. Create nothing besides the files
listed in Phase 3, and never overwrite an existing file. Do not write a script or an inline
program (python3 -c, heredoc) to do this; use the tools step by step.
Phase 1 - Check:
llm-wiki.yml exists in the wiki root: report that the wiki is already set up, show its
tool and namespaces, and stop without changing anything. Only if the user then asks to add
missing pages, continue with the values from the existing config; Phase 3 skips every file
that already exists.${CLAUDE_PLUGIN_ROOT}/templates/logseq/ and
${CLAUDE_PLUGIN_ROOT}/templates/obsidian/. If that path still starts with a dollar sign and a
brace, stop and tell the user: "This is a copied skill and the clone path is not filled in.
Replace the CLAUDE_PLUGIN_ROOT placeholder in the copied file with the path of your llm-wiki
clone (see the README)."Phase 2 - Ask the user, in one message:
logseq/ directory suggest Logseq, if it
contains .obsidian/ suggest Obsidian.Business Tech Content Projects People Learning Reference, or their own
space-separated list.~/.claude/projects/<project>/memory/).Validate before writing anything, and ask again on an invalid answer:
^[A-Za-z][A-Za-z0-9-]*$; name the invalid ones.Schema.md, Dashboard.md, Hub.md,
Access-Log.md). If one cannot be read, stop with the path you tried.~ in the memory path to the home directory. Do not check that it exists.git --version. Without
git, warn that the git steps are skipped and continue.Phase 3 - Create:
Run date +%Y-%m-%d once. This is DATE for every file.
mkdir -p "<wiki root>". Use the absolute root without a trailing slash from here on.
Targets, in this order. <ns> stands for each namespace in the order the user gave.
| Page | Logseq (pages_dir: pages) | Obsidian (pages_dir: empty) | Template |
|---|---|---|---|
| Schema | pages/Wiki___Schema.md | Wiki/Schema.md | Schema.md |
| Dashboard | pages/Wiki___Dashboard.md | Wiki/Dashboard.md | Dashboard.md |
| Hub per namespace | pages/Wiki___<ns>.md | Wiki/<ns>/_index.md | Hub.md |
| Access-Log | pages/Wiki___Reference___Access-Log.md | Wiki/Reference/Access-Log.md | Access-Log.md |
| Config | llm-wiki.yml | llm-wiki.yml | (below) |
The Access-Log page is created even when Reference is not one of the namespaces.
Check which targets exist with one Bash call (test -e per path, relative to the root).
Existing targets are skipped, whatever their content. Do not rely on the Write tool to refuse.
Git init, only if the user agreed and the root has no .git: git -C "<root>" init. Then, if
there is no .gitignore, write one with these lines (each followed by a newline):
logseq/bak/, logseq/.recycle/, .DS_Store, .logseq/.obsidian/workspace.json, .obsidian/workspace-mobile.json, .DS_Store, .trash/Write each page that does not exist: the template text with these placeholders replaced, and nothing else changed. Keep every character, tab, line break and the final newline of the template. Do not reformat, translate, shorten or extend it.
{{DATE}}: DATE{{NAMESPACES}} (Schema): Wiki/<ns> for each namespace, joined by a comma and a space,
for example Wiki/Tech, Wiki/Content{{NAMESPACE_LINKS}} (Dashboard): one line per namespace, joined by a single newline, with
no newline after the last one. Logseq line: a tab character, then - [[Wiki/<ns>]].
Obsidian line: - [[Wiki/<ns>]].{{NAMESPACE}} (Hub): the namespace of that hub pageWrite llm-wiki.yml last, if it does not exist. Exactly these lines, each followed by a
newline. An empty value is written as the key and colon with nothing after it (pages_dir:):
# llm-wiki configuration
# Generated by llm-wiki on <DATE>
tool: <logseq|obsidian>
wiki_path: <absolute wiki root>
pages_dir: <pages, or empty for Obsidian>
memory_path: <memory path, or empty>
namespaces:
- <first namespace>
- <next namespace, one line each>
After each target, print Created: <label> or Skipped (already exists): <label>. Label:
Wiki/<page> for Logseq pages (Wiki/Reference/Access-Log), the relative path for Obsidian
pages, llm-wiki.yml for the config, .gitignore for the ignore file.
Commit, only if the root is a git repository and this run created at least one file. Stage
exactly the created files by path, never anything else:
git -C "<root>" add -- <created paths>, then commit with this message (N = number of
namespaces):
wiki: initial setup via llm-wiki
Schema, Dashboard, and hub pages for <N> namespaces.
Tool: <logseq|obsidian>
Generated by https://github.com/MehmetGoekce/llm-wiki
If the commit fails, warn and leave the files uncommitted; do not stop.
Phase 4 - Report:
llm-wiki.yml/llm-wiki ingest "<a first source>", then
/llm-wiki status.claude/commands/wiki.md: tell the user that an older copied
/wiki skill is installed as well and that deleting that file avoids running two versions.
Do not delete it yourself.Phase 1 - Inventory:
Phase 2 - Conversion:
Phase 3 - Create Pages:
Phase 4 - Verification:
Every hub page (type hub) carries two sections that query Phase 0 reads and ingest/prune maintain.
A routing line is [[link]] -- description #tags, one per child page.
Logseq (outliner):
- ## Tech
- ### Index
- [[Wiki/Tech/Strapi]] -- Strapi 5 CMS, ports, deploy + migration gotchas #strapi #deploy
- [[Wiki/Tech/PM2]] -- PM2 process management on the VPS, cwd/reload bug #pm2 #deploy
- ### Archive
- [[Wiki/Tech/Legacy-Foo]] -- (demoted 2026-06-07) old Foo stack, replaced by Bar #archived
Obsidian (flat markdown):
## Tech
### Index
- [[Wiki/Tech/Strapi]] -- Strapi 5 CMS, ports, deploy + migration gotchas #strapi #deploy
- [[Wiki/Tech/PM2]] -- PM2 process management on the VPS, cwd/reload bug #pm2 #deploy
### Archive
- [[Wiki/Tech/Legacy-Foo]] -- (demoted 2026-06-07) old Foo stack, replaced by Bar #archived
Rules:
### Index = live (routable). ### Archive = evicted (only L3 grep finds the page)Page: Wiki/Reference/Access-Log (Wiki___Reference___Access-Log.md / Wiki/Reference/Access-Log.md)
— an append-only LRU signal + routing transparency, one line per page read:
Logseq:
- access-log:: true
- type:: reference
- ## Log (append-only, newest at bottom)
- 2026-06-07 -- [[Wiki/Tech/Strapi]] -- query -- matched: "Strapi 5 -- ports, deploy, migration"
- 2026-06-07 -- [[Wiki/Projects/GEO]] -- query -- matched: "L3-grep: geo strategy"
Obsidian:
---
access-log: true
type: reference
---
## Log (append-only, newest at bottom)
- 2026-06-07 -- [[Wiki/Tech/Strapi]] -- query -- matched: "Strapi 5 -- ports, deploy, migration"
- 2026-06-07 -- [[Wiki/Projects/GEO]] -- query -- matched: "L3-grep: geo strategy"
Rules:
matched: field (routing transparency) = why the page was picked for this question: the matched hub
### Index routing description / #tag (index routing) or the grep term (L3 fallback), <= 60 chars, in
quotes. Makes loading auditable — not just WHAT loaded but WHY. Legacy lines without matched: stay
valid (the field is additive, optional-backward)[[page]] from fixed positions (split on --); the matched: suffix is
irrelevant to LRU aggregation and does not affect parsingA block that changes over time (a task, a decision, a host's status) shows the current state on top and, collapsed below it, how it got there.
Logseq:
- 🔴 Decommission staging VM — due [[2026-09-29]]
status:: open
ticket:: OPS-195
decision:: run benchmark B1 first, then delete (2026-09-12)
- **Next step:** run B1, otherwise default A (check volumes, delete)
- Cost: trial credit until 09-30, ~$1/day after
- History
collapsed:: true
- 2026-09-12 decided B1 only; host unchanged
- 2026-09-07 fact check: trial ends 09-30, VM is empty
Obsidian:
### 🔴 Decommission staging VM — due 2026-09-29
status: open · ticket: OPS-195 · decision: run benchmark B1 first, then delete (2026-09-12)
**Next step:** run B1, otherwise default A (check volumes, delete)
> [!note]- History
> - 2026-09-12 decided B1 only; host unchanged
> - 2026-09-07 fact check: trial ends 09-30, VM is empty
Rules:
History = last child, collapsed (Logseq collapsed:: true, Obsidian folded callout [!note]-),
one line per date, newest first(superseded)updated:: holds the date only; change notes live as lines in a collapsed ## Change log
section (one sub-block per hub section), newest firstL1 memory files keep their existing frontmatter; llm-wiki adds two optional keys. Top level:
---
name: pm2-reload-npm-start
description: PM2 reload breaks when the app was started via npm start
asserts-current-behavior: true
verified: 2026-06-15
---
Or inside an existing metadata: block (write where the file already keeps its metadata):
---
name: no-ai-attribution
description: No AI attribution in commits or published content
metadata:
type: feedback
asserts-current-behavior: false
---
Rules:
true = claim about a system's current state; false = decision / preference / identity / rationaleverified only on true rules, ISO date, set only by re-verify in prune --l1What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
knowledge-management, wiki, logseq, obsidian, lru-cache, knowledge-base
npx claudepluginhub mehmetgoekce/llm-wiki --plugin llm-wikiOther plugins' skills for the same job