/lorekit-memory:lorekit-memory [read|write] [scope-hint or lesson]from lorekit-memory
Provides shared persistent memory for coding agents via LoreKit MCP server. Reads scoped lessons at task start or when navigating unfamiliar code, and writes lessons on failures, gotchas, or wrong assumptions.
Ships in lorekit-memory. 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.
Give every agent a shared, persistent memory. Lessons live in LoreKit (a Supabase-backed MCP server), so what one agent learns on one machine — or in CI — is available to every agent, everywhere, in the next session.
This skill has two jobs, mirroring the read-on-start / write-on-failure loop
of the aw autonomous-workflow agent:
Both jobs run through LoreKit's memory.* MCP tools.
If those tools are not connected, this skill is a no-op — say so once and
continue the task; never block work because memory is unavailable.
Wiring a loop into your own skill? This skill does the runtime read/write. To set up a self-improvement loop for a skill, workflow, or agent — so it reads its own lessons on every run and promotes proven ones into permanent rules — use the
lorekit-setupskill, the authoring counterpart to this one.
Modes. Memory has a controllable backend (
lorekit doctorshows the resolved one):remote(the hosted LoreKit server — the default),local(markdown files in two tiers — a per-user home tier at~/.lorekit/and an opt-in per-repo project tier at<repo>/.lorekit/), oroff(disabled).localmeans not on the hosted website — local lessons stay on disk and never sync to the LoreKit dashboard.globallessons go to home;repo/branchlessons go to the project tier once you create<repo>/.lorekit/(commit it to share with your team, or gitignore it to keep it private), else home. See the@lorekit/cliREADME for the control model, the two-tier merge, and precedence/deny rules.
Read at the moments where prior lessons change what you do:
Follow rules/intake.md.
The short version: resolve the current scope, list lessons narrow-to-broad,
and treat matches as considerations, not commands. When a run is about to
change code, intake step 6 reads the standard shared codebase-knowledge
bucket — the cross-loop hotspot::<path> / knowledge::<symbol>@<path> record
for the files this run will touch, matched by symbol@path. A run that verifies
a structural fact contributes it back, so the layer compounds across every
LoreKit loop in the repo (contract in the lorekit-setup skill).
Write when a run produces a durable observation worth carrying forward. The trigger is friction, not success. Ask the 30-second question:
Was there a stuck loop, a repeated failure, a surprise, a near-miss, or a guess that paid off — something a future run would benefit from knowing?
If yes, write it. If the answer is genuinely nothing, write nothing — empty retrospectives are skipped entirely.
Follow rules/retrospective.md.
The short version: phrase the lesson as an observation, pick the narrowest
scope that fits, check for a near-duplicate first, then memory.write.
Lessons are partitioned by a canonical scope string (:: is the only separator):
global universal principles
project::{name} monorepo-wide
repo::{owner}/{repo} this repository's codebase
branch::{owner}/{repo}::{branch} short-lived, this branch only
Read narrow-to-broad and merge; write to the narrowest scope that correctly describes where the lesson applies. Full resolution rules: references/scope-resolution.md.
| Tool | Use | Token |
|---|---|---|
memory.list | List lessons for one scope (newest first, tag filter). scope is optional — omit it to list across every scope you can see | read |
memory.search | Full-text search across scopes (supports repo::owner/*) | read |
memory.read | Read one lesson by key (scope optional — see below) — or several at once via refs: ["scope::key", …] (one round trip, up to 32) | read |
memory.write | Store or update a lesson (same scope+key updates in place) | read+write |
Write tools need write permission (lk_rw_* or lk_wo_*); read tools need read
permission (lk_rw_* or lk_ro_*). A read-only token cannot write and a
write-only token cannot read — if a call fails with an authorization error,
report it and move on; do not retry.
Holding only a bare key, with no scope? Call memory.read { key } without a
scope. It resolves across every scope you can see, preferring the most
specific — project, then branch, then repo, then global — and the
response's scope field names the one that answered. If the key also exists
elsewhere, other_scopes lists those: that is your cue to pass an explicit
scope next time, because only you know which one you meant. An omitted scope
does NOT mean global. The same applies to memory.list and
memory.list_archived, which simply list across everything instead of
resolving to one winner.
Already know the exact scope::key refs you need — from a prior memory.list
or memory.search, or from citations another lesson names — and need more than
one? Pass them all as memory.read's refs array instead of one call per
lesson. Each ref resolves independently: an unresolved one lands in the
response's missing list rather than failing the whole call, and matching is
against the verbatim stored scope (no case-folding), unlike a single
scope/key read.
Every lesson this skill writes carries the tag skill::lorekit-memory plus a
source::<trigger> tag (for example source::stuck-loop) so lessons are
easy to find and audit later.
Install the skill and configure the MCP endpoint with the LoreKit CLI:
npx @lorekit/cli install
npx @lorekit/cli doctor
install scaffolds this skill into .claude/skills/ and adds the LoreKit
server to .mcp.json.
doctor verifies connectivity, token permission, and scope detection.
See the CLI's own README for flags and troubleshooting.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
persistent-memory, shared-memory, lessons, retrospective, self-improvement, mcp
4 skills in this plugin
/lorekit-groomGrooms and maintains an accumulated LoreKit memory store — the cleanup counterpart to lorekit-memory (which reads and records single lessons). It finds and merges near-duplicate lessons, lints out low-quality ones, sets expiry (TTL) on time-bound lessons, and prunes or archives obsolete ones, ALWAYS analysing read-only and proposing a plan before any change (nothing is deleted or merged without confirmation, and archive is preferred over hard-delete). Reach for this whenever a lesson/memory store has grown noisy, large, or stale and needs tidying — not for reading or writing one lesson. Triggers on "groom my memories", "clean up my lessons", "dedupe the memory store", "merge duplicate lessons", "too many memories", "my lorekit is a mess", "consolidate lessons", "add expiry dates to old lessons", "prune stale branch lessons", "lint my memories", "/lorekit-groom".
/lorekit-self-hostGuided runbook for deploying your OWN LoreKit backend instead of using the hosted service — full self-host (your Supabase project runs everything) or self-host + BYOD (memory rows live in a second Supabase project you control). Walks Supabase link → migrate → secrets → deploy-all-functions → dashboard/token → connect-your-agent → write/read round-trip, each step a gate: do the thing, verify it, stop and diagnose if the verification fails. Links out to docs/install.md and docs/byod.md rather than duplicating their commands. Slash-only — not installed by `lorekit install`. Its only memory call is Step 9's throwaway `self-host-test` write/read/delete round-trip. Use when deploying your own LoreKit instance, not for everyday read/write (see lorekit-memory) or store maintenance (see lorekit-groom). Triggers ONLY on explicit invocation: "/lorekit-self-host".
/lorekit-setupTurns a skill, workflow, agent, or CI job into one that gets better across runs and can PROVE it. Walks a six-step lifecycle — Find where a loop pays off, Wire it from a ready-made recipe card, Seed it so it delivers on run one, Prove it improved something, Maintain it so it does not rot, and Scale it to a team — with a 15-minute quickstart that ends in a loop firing once, live. Under the hood it is a LoreKit lessons loop: a fast episodic tier of advisory lessons read at the start of every run and written on failure; a slow procedural tier that promotes a recurring lesson into a permanent rule; and, for the rare judgement-free case, a third rung that compiles a lesson into a mechanically-checked CI invariant. Also covers the non-LLM case (durable JSON state records for a deterministic job) and the guards that stop a learning loop from reinforcing its own mistakes. Runtime reading and writing of lessons is the lorekit-memory skill; this is the authoring counterpart. Use when giving a host durable cross-run memory or wiring a lessons loop. Triggers on "set up memory for my skill", "add a self-improvement loop", "give my workflow memory", "make this learn from its mistakes", "where should I add a loop", "prove my loop is working", "self-improving memory", "memory in CI", "GitHub Actions state", "remember the last CI run", "/lorekit-setup".
npx claudepluginhub mthines/lorekit --plugin lorekit-memoryOther plugins' skills for the same job