From learning-loop
Updates retracted beliefs across vault, auto-memory, and episodic history. Searches hits, analyzes impacts via correction-analyser, executes approved changes, records supersessions.
npx claudepluginhub robinslange/learning-loop --plugin learning-loopThis skill uses the workspace's default tool permissions.
When a belief turns out to be wrong (or refined), the wrong version sits in three places: the vault as durable notes, the auto-memory as preferences/feedback, and the episodic history as past conversations the LLM may resurface. This skill edits all three coherently.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Processes PDFs: extracts text/tables/images, merges/splits/rotates pages, adds watermarks, creates/fills forms, encrypts/decrypts, OCRs scans. Activates on PDF mentions or output requests.
Share bugs, ideas, or general feedback.
When a belief turns out to be wrong (or refined), the wrong version sits in three places: the vault as durable notes, the auto-memory as preferences/feedback, and the episodic history as past conversations the LLM may resurface. This skill edits all three coherently.
The Katsuno-Mendelzon split:
/learning-loop:rewrite "old pattern" "new pattern": full form, with reason inferred/learning-loop:rewrite "old pattern" "new pattern" "reason": explicit reason for the supersession record/learning-loop:rewrite: no args, infer the change from recent conversation contextIf args are provided, parse old_pattern, new_pattern, optional reason.
If no args, read the conversation. The user just learned something that contradicts a prior belief. Identify:
If you cannot find a clear correction in the conversation, tell the user and stop. Ask them to provide old and new explicitly.
Confirm the framing in one line before proceeding:
Rewriting: "<old>" → "<new>" (reason: <reason>)
Search every store for the OLD pattern. Run all four searches in parallel (single message, multiple Bash calls):
Vault: semantic + keyword:
node PLUGIN/scripts/vault-search.mjs search "<old pattern>" --rerank
Vault: wiki-link/title hits:
Use Glob for filename matches: **/*<key-noun>*.md in {{VAULT}}/
Auto-memory:
Grep the project's ~/.claude/projects/*/memory/ directory for substrings of the old pattern. Read MEMORY.md and any matching files.
Episodic memory:
Call mcp__plugin_episodic-memory_episodic-memory__search with the old pattern. The post-search-tracking hook will already annotate the result if a supersession exists: do not pre-create one yet.
For every vault note hit from Phase 2, identify the primary note that codifies the old belief (or notes: there may be more than one). For each primary note, dispatch the learning-loop:correction-analyser agent:
subagent_type: learning-loop:correction-analyser
prompt: |
note_path: <vault-relative path>
change_type: <retraction|update|weakening>
new_claim: <new pattern, if change_type is update>
Produce the impact map per your spec.
The agent traces the justification index for sole-justification dependents and classifies each by attack type. Run agents in parallel if there are multiple primary notes.
Show the user a single consolidated triage map:
# Rewrite Plan: <old> → <new>
## Vault notes (N hits)
- `path/to/primary.md`: primary belief codification
- Suggested: REWRITE (replace old claim with new)
- Downstream impact: 3 critical, 1 high, 0 medium (from correction-analyser)
- `path/to/related.md`: references the old belief
- Suggested: AMEND (update the wiki-link surrounding text)
## Auto-memory (N hits)
- `feedback_<name>.md`: captures the old guidance
- Suggested: REWRITE
## Episodic memory (N matches)
- N past conversations contain the pattern
- Suggested: SUPERSESSION RECORD (no edits: annotation only)
## Downstream cascade (from correction-analyser)
- `path/dependent-a.md`: CRITICAL (sole-dependent rebuttal)
- `path/dependent-b.md`: HIGH (sole-dependent undercutting)
- ...
Total proposed actions: <N>
Then ask the user, exactly once, in plain English:
Approve the plan? You can say
yes,no, or list specific items to skip (e.g. "skip auto-memory, skip dependent-b").
Wait for confirmation. Do not proceed until the user has answered. If they say no, stop and report nothing changed.
Run the approved actions. Use the right tool per store.
Vault rewrites/amends:
Edit for surgical changes (preferred: preserves frontmatter, links)Read the file immediately before each Edit, even if you read it during Phase 2. The triage map can grow stale between rendering and execution if other tools touched the file in the meantime. The fresh read also lets you verify the surrounding text still matches what you'll pass to Edit.node PLUGIN/scripts/edges-cli.mjs list <archived-note> and capture the outgoing array from the JSON response. Each entry has from_path, to_path, edge_type, confidence, and direction_flipped._archive/ (create the dir if missing).Superseded: see [[<replacement>]]. The stub Write fires the post-write hook chain, which calls removeOutgoingEdges. With the v1.14.1 fix, that query now skips source_graph='archived' rows: but we have not added any yet, so this pass correctly wipes the live edges as intended.source_graph='archived'. For each edge in the dumped outgoing array, run:
node PLUGIN/scripts/edges-cli.mjs add <from_path> <to_path> <edge_type> \
--confidence <high|medium> \
--source-graph archived \
--direction-flipped <0|1>
Vault transition note (mandatory if any vault notes were touched):
Write a new note to 0-inbox/ capturing the correction itself:
<new pattern phrased as a claim>[rewrite-transition]Auto-memory rewrites:
Edit on the relevant feedback_*.md or project_*.md fileMEMORY.md only if the description line changedSupersession record (mandatory): Always write the supersession, regardless of which other actions ran:
node PLUGIN/scripts/edges-cli.mjs super-add "<old pattern>" \
--replacement "<vault path of transition note or primary rewritten note>" \
--reason "<reason>"
This is what makes future episodic searches surface the correction inline.
Show one final block:
# Rewrite Complete
- Vault: <N rewrites>, <N amends>, <N archives>
- Auto-memory: <N rewrites>
- Transition note: <path>
- Supersession recorded: id <N>, pattern "<old>"
Future episodic searches matching "<old>" will be annotated automatically.
source_graph='archived' marker. The dump-and-re-insert sequence in Phase 5 keeps the historical justification graph intact. Downstream queries surface them; removeOutgoingEdges will not wipe them on subsequent stub writes./learning-loop:deepen: strengthens a single note in place (no cross-store coordination)/learning-loop:reflect: end-of-session consolidation (different intent: capture, not retract)learning-loop:correction-analyser (agent, not skill): the edge-traversal subroutine this skill calls