/learning-loop:healthfrom learning-loop
Vault health dashboard that surfaces hygiene issues: ghost duplicates, near-duplicate pairs, orphan notes, stale inbox entries, embedding gaps, and broken wikilinks. Supports light, deep, auto-fix, provenance, and librarian modes.
Ships in learning-loop. 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.
Read when SKILL.md points to them.
Quick-check command that surfaces vault hygiene issues: ghost duplicates, near-duplicate pairs, orphan notes, stale inbox entries, embedding gaps, and broken wikilinks. Fast by default, deep on demand, with optional auto-fix for safe operations.
/health or /health --light: quick vault status check (default)/health --deep: full diagnostic with note-scorer analysis/health --auto: auto-fix safe issues (combinable with either mode)/reflect sessions/inbox to see what needs attention| Input | Mode | Auto-fix |
|---|---|---|
/health | light | no |
/health --light | light | no |
/health --deep | deep | no |
/health --auto | light | yes |
/health --deep --auto | deep | yes |
/health --provenance | provenance | no |
/health --librarian | librarian | no |
No arguments (/health):
Run light mode immediately (fast, no prompting needed: it's the default and completes in seconds). Teach the other modes through results, not upfront prompting.
But after presenting results, if issues were found, mention available modes:
Found N issues. Options:
/health --deep: full analysis with note scoring/health --auto: auto-fix safe issues (ghost dupes, broken links)/health --provenance: pipeline observability (fabrication rates, agent stats)/health --deep --auto: both
This teaches the modes through use rather than upfront prompting.
--provenance / --librarian)If one of these flags is present, skip all vault health checks and execute the matching mode file, then stop (do not proceed to Step 1):
${CLAUDE_PLUGIN_ROOT}/skills/health/modes/provenance.md and execute it.${CLAUDE_PLUGIN_ROOT}/skills/health/modes/librarian.md and execute it.Collect the raw data needed for all checks. Run these in parallel:
Glob pattern *.md in {{VAULT}}/0-inbox/Glob pattern *.md in {{VAULT}}/1-fleeting/Glob pattern *.md in {{VAULT}}/3-permanent/Glob pattern *.md in {{VAULT}}/2-literature/Glob pattern *.md in {{VAULT}}/_system/ll-run vault-search.mjs cluster --threshold 0.85ll-run vault-search.mjs listll-run check-deps.mjsll-search binary via node -e "import(process.argv[1]+'/scripts/lib/binary.mjs').then(m => console.log(m.binaryVersion()))" "$(ll-paths PLUGIN)" -- returns version string or nullParse the check-deps output from Step 1. Each entry has a required boolean — partition into required vs optional, render separately, and use it to set urgency.
For each dependency:
versionConstraint, install commandversionConstraint, install commandThis check runs in both light and deep modes -- there's no deeper analysis needed.
Compare inbox filenames against filenames in 1-fleeting/ and 3-permanent/. A ghost duplicate exists when the same filename appears in inbox AND a promoted folder.
Light: List each ghost duplicate with its promoted location. Deep: Read both versions of each ghost duplicate. If content is identical or the inbox version is a subset, confirm as true duplicate. If content has diverged, flag as "diverged copy: review before deleting".
Parse the cluster output from Step 1. Filter to pairs with similarity > 0.85 that are NOT ghost duplicates (same filename in different folders: already caught in Step 2).
Light: List each pair with similarity score. Deep: Read both notes in each pair. Compare content. Recommend which to keep (prefer the more mature version) or merge.
For each note across all content folders (0-inbox, 1-fleeting, 3-permanent), grep for \[\[ outgoing wikilinks. Notes with zero outgoing links are orphans. Exclude _system/ and 2-literature/ from orphan checks (system docs and literature notes don't need outlinks).
Light: List orphan filenames with their folder.
Deep: For each orphan, run ll-run vault-search.mjs similar "<note-path>" --top 3 to suggest link targets.
Check all inbox notes in one pass (single process for the whole folder, never one per note):
node -e "const fs=require('fs'),p=process.argv[1],now=Date.now();for(const f of fs.readdirSync(p)){if(!f.endsWith('.md'))continue;const d=Math.floor((now-fs.statSync(p+'/'+f).mtimeMs)/86400000);if(d>14)console.log(d+'d\t'+f)}" "{{VAULT}}/0-inbox"
Each output line is a stale note with its age in days.
Light: List stale notes with age in days.
Deep: Launch note-scorer agent(s) with stale note paths. Report maturity tier and recommend action: promote (if deep/medium), /deepen (if shallow but promising), or delete candidate (if shallow and empty).
Batching: If > 10 stale notes, split into batches of ~10 and launch parallel note-scorer agents.
Compare the full vault file list (all .md files in content folders) against the output of vault-search.mjs list. Notes present in the vault but missing from the embedding index are stale.
Light and Deep: List missing notes. No difference between modes: there's nothing deeper to analyze.
Grep all \[\[...\]\] wikilink references across all vault notes. For each unique link target, check if a matching .md file exists anywhere in the vault (case-insensitive filename match). Broken links are references to non-existent notes.
Light: List each broken link with the source note that contains it. Deep: For each broken link, find the closest matching vault filename using fuzzy/substring match and suggest it as a correction.
Run ll-run edges-cli.mjs cycles. The output lists cycles of notes whose typed edges dispute each other in a loop (at least one challenges_* edge per cycle), with every parallel contradiction edge under contradictions.
Light: Report the count and each cycle as a -> b -> a.
Deep: For each cycle, read the notes on it and say which claim the contradiction turns on; suggest /learning-loop:gaps "<topic>" for the ones worth resolving.
Skip silently when edges.db does not exist yet.
Read PLUGIN_DATA/librarian/queue.jsonl (where PLUGIN_DATA = CLAUDE_PLUGIN_DATA env; if absent, resolve via ll-run resolve-paths.mjs PLUGIN_DATA; never hardcode a fallback path). Parse each line as JSON. Filter to items where status === 'pending'. Also read PLUGIN_DATA/librarian/state.json: the number of keys in its checked map is how many notes the librarian has checked.
If the queue file doesn't exist or is empty, skip this step silently.
Group pending items by task field:
link_suggestion: link suggestions (orphan notes that should be linked)tag_suggestion: tag suggestions (under-tagged notes with proposed vocabulary tags)voice_flag: voice flags (topic-style titles)duplicate_flag: duplicate flags (notes that make the same claim as a near-neighbour)staleness_suspect: staleness suspects (Claude investigates)Add to the dashboard output:
Librarian: N pending observations (checked M/T notes)
Link suggestions: N (X high, Y review)
Tag suggestions: N
Voice flags: N
Duplicate flags: N
Staleness suspects: N (for Claude to investigate)
Queue: P% full (N/CAP cap)
Where CAP is read from config.json's librarian.queue_cap (default 200).
If the queue has pending items, add recommendation:
Run
/health --librarianto review and act on librarian suggestions.
Run:
ll-run retrieval-report.mjs --usage --json
Parse the JSON. Two candidate lists plus one coverage list:
surfaced_never_used: notes surfaced repeatedly AND explicitly judged unused (ignored_events >= min_ignored) by /reflect. These are deepen-or-archive candidates — either the note isn't earning its retrieval rank (sharpen//deepen it) or it's noise crowding out better hits (archive it).surfaced_unevaluated: surfaced just as often, but no /reflect session ever judged them. This is a telemetry gap, NOT a candidate list — report it as coverage ("N notes surfaced repeatedly have never been evaluated; run /reflect to close the loop") and never recommend archiving from it.never_surfaced: content notes (0-inbox, 1-fleeting, 2-literature, 3-permanent) never retrieved by search in the window. These are candidates for archiving, but only when injection coverage is ruled out — do NOT recommend archiving based on never_surfaced alone, since the injected channel under-records (bursts pruned before a ledger sync are lost). Say "never retrieved by search" not "never seen".Honest framing — carry these caveats into the output verbatim, do not soften them:
note-usage events from /reflect Step 4.7, in two kinds: used_engaged_events (read/edited/linked) and used_informed_events (the note's content reached the session's output untouched, with evidence). Report both — a used-rate resting mostly on informed rests on model self-report, auditable but softer than an edit.surfaced_unevaluated, not in the candidate list. Never describe them as "never used".unevidenced_informed_events is above zero, say so: that many informed claims arrived with no evidence field and were discarded as unauditable — counted as neither use nor non-use.coverage_limited is true, the logs span fewer days than the window: report "never retrieved in coverage_daysd of logs", not "in window_daysd".never_surfaced measures retrieval-only. Do not frame these as "never seen" or recommend archiving without asking the user to confirm the note was not recently injected.If coverage_days is null (no surfacing telemetry yet), skip this step silently.
Light: counts + top 5 of each list.
Deep: full surfaced_never_used list with surfaced counts and explicit-ignore counts; surfaced_unevaluated count + top 5; never_surfaced count + first 20 paths.
Count the notes that carry the one supersession key retrieval reads:
node -e "import(process.argv[1]+'/scripts/lib/health-checks/full.mjs').then(m => console.log(m.collectInvalidatedAdoption(process.argv[2]).invalidated))" "$(ll-paths PLUGIN)" "$(ll-paths VAULT)"
Report it as one line, N notes carry invalidated:, in both modes. This is
adoption, not health: a low number means supersessions are still being
recorded somewhere retrieval cannot see (a stub, a moved file, prose in a fix
plan) rather than through supersede-note.mjs. /doctor --full reports the
same count as the invalidated-adoption check.
Run a dry run of the repairer, which writes nothing:
ll-run normalise-frontmatter.mjs
It covers the folders the atomic-note contract covers (0-inbox, 1-fleeting, 2-literature, 3-permanent) and ends with N scanned, M would be repaired, K need a human, followed by one line per note it cannot repair and why. Report M and K in both modes. In deep mode, also list the notes that need a human. If it exits non-zero it scanned nothing: report what it printed in place of the counts, and skip the frontmatter fix in Step 9.
A note first committed together with 99 or more others (a merged vault, a restored backup, a batch sync) and without a valid date: is one it cannot repair: that commit says when the notes arrived, not when they were written, so the repairer never guesses. Say so rather than suggesting a date.
Skip silently unless PLUGIN_DATA/federation/config.json or
PLUGIN_DATA/vaults.json exists. For each configured vault profile:
ll-search status --config-dir <config_dir>
Report one line per profile, and only when it has something to say — a healthy federation adds no row. The four that matter here:
sync-state.json — configured, never completed a cycle. A failure,
not an unknown.hub holds: nothing — the hub has no index for this vault; the next sync
re-uploads.STALE — the last successful sync is more than seven days old.BLOCKED — ll-search sync will refuse this config.A last sync error naming a hub the hub: line above it does not name is
none of these: it is a cycle that ran before the config changed, and the
watcher acts on the change at its next federation tick. Report it as that.
Do not offer a fix here. /learning-loop:doctor carries the full federation
section, including ll-search link list and what each verdict means; point at
it and stop.
Output the summary dashboard:
Vault Health: YYYY-MM-DD
Binary: ll-search vX.Y.Z (installed) | not installed
Dependencies: N satisfied, M missing
Ghost dupes: N inbox notes already promoted
Near-dupes: N pairs (>0.85 similarity)
Orphans: N notes with no outlinks
Stale inbox: N notes older than 14 days
Embeddings: N notes not indexed
Broken links: N dead [[wikilinks]]
Contradictions: N cycles of mutually disputing notes
Frontmatter: M notes repairable, K need a human
Retrieval usage: N surfaced-then-ignored, U unevaluated, M never retrieved by search in Kd of logs
Federation: <one line per profile with a verdict, omitted entirely when healthy or unconfigured>
Status: [total] issues [run /health --deep for full analysis]
Omit the contradictions line when Step 7.4 was skipped or found none. Omit the frontmatter line when M and K are both 0. M and K are not added to the Status total: one note can be in both, and M includes notes that only need their keys reordered. Omit the federation line when Step 7.7 was skipped or every profile is healthy. Omit the retrieval-usage line when Step 7.6 was skipped for lack of telemetry. "Surfaced-then-ignored" means /reflect explicitly judged the note unused; "unevaluated" means no session ever judged it — see the Step 7.6 caveats.
The "run --deep" hint only appears in light mode. In deep mode, replace with a summary of findings.
Then output per-category details:
If --auto flag is set:
Bash: rm {{VAULT}}/0-inbox/<filename>[[ and ]] brackets from broken wikilinks using Edit tool, leaving the display text as plain text (e.g., [[missing-note]] becomes missing-note, [[missing|displayed]] becomes displayed)If --auto flag is NOT set:
--auto too, and only when M > 0): Ask "Repair frontmatter on M notes? (y/n)": wait for approval, then run ll-run normalise-frontmatter.mjs --apply and report its summary line. The K notes that need a human stay listed; never date one by hand from a guess/inbox, /verify, /deepen, or "re-index in Obsidian")/deepen "<note>" for surfaced-then-ignored notes worth sharpening, and archival (move to _archive/, ask first) for persistently-ignored notes. Never recommend anything from surfaced_unevaluated — the fix there is running /reflect, not touching the notes. For never_surfaced notes, do NOT recommend archiving based on retrieval telemetry alone — the injected channel under-records, so absence from search logs does not mean absence from sessions. Ask the user whether the note feels useful before suggesting archival.Output a one-line summary of actions taken:
Fixed: N ghost dupes removed, N broken links cleaned, N frontmatter blocks repaired. Remaining: N issues: see recommendations above.
If nothing was fixed (no --auto, user declined, or nothing fixable):
No fixes applied. N issues found: see recommendations above.
Reuses the note-scorer agent. Only invoked for stale inbox notes in --deep mode.
Launch pattern:
Spawn note-scorer subagent(s) (dispatch: skills-shared/dispatch.md) with this prompt:
Score these notes for inbox staleness assessment.
notes: <file-path-1>, <file-path-2>, ...
vault_path: {{VAULT}}/
scope: stale inbox triage (health --deep)
Return per-note: dimension scores + maturity tier (shallow/medium/deep) + specific issues found.
Batching: One agent per ~10 notes. Parallel for larger sets.
Output contract: Each agent returns a list of objects:
- file: <path>
tier: shallow | medium | deep
issues: [<string>, ...]
gate: N/6
claim_specificity: 0-2
source_grounded: 0-2
Mapping gate pass count to summary labels (for dashboard display):
--deep, give them the full picture. Use note-scorer, read content, diff duplicates.--auto only touches ghost dupes (inbox copy of promoted note) and broken links (references to nothing). Never auto-merge, auto-delete non-duplicate notes, or auto-promote./verify, /inbox, or /deepen. Recommend the right tool for each issue.0-inbox/ without asking. Broken link fixes edit the source note, which may be in any folder: always ask unless --auto.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub robinslange/learning-loop --plugin learning-loop24 skills in this plugin
/deepenStrengthen a single vault note with research. Usage: /learning-loop:deepen "note name" or /learning-loop:deepen (picks shallowest inbox note). Assesses maturity, researches gaps, rewrites in vault voice, promotes when ready./diagramGenerate an Excalidraw diagram for the vault. Usage: /learning-loop:diagram "concept or mechanism" or /learning-loop:diagram (infers from context). Produces .excalidraw.md in vault Excalidraw/ folder./discoveryExplore a topic interactively with web research and vault context. Usage: /learning-loop:discovery "topic" [--style guided|branch|checkpoint] [--tone academic|conversational|persona] [--surf]. --surf skips note creation./doctorDiagnose your learning-loop installation. Runs health checks, presents issues, offers per-fix remediation, re-runs each check after the fix to confirm. Safe to run anytime; only makes changes you approve. Pass --redact to scan plugin data files for leaked credentials instead./dreamConsolidate auto-memory between sessions. Usage: /learning-loop:dream (no args). Four-phase cycle: Orient, Gather Signal, Consolidate, Prune Index. Seven operators: MERGE, RESOLVE, ABSTRACT, COMPRESS, PRUNE, LINK, DATE NORMALIZE. Rebuilds MEMORY.md./dream-evalmeasure whether a /dream pass helps, hurts, or ties against no consolidation. usage: /learning-loop:dream-eval --mode={single|control|repeated} [--passes=N] [--mine]. single scores pre/post on the live corpus; control forks two clones and dreams one; repeated dreams a clone N times and plots the drift + content-survival curve.Other plugins' skills for the same job