Shared persistent memory for coding agents. Reads scoped lessons at session start and nudges a retrospective when a tool fails, backed by the LoreKit MCP server.
Your coding agents forget. LoreKit makes them learn.
When your agent hits a wall and works its way out, it writes down what it
learned — and the next agent to hit that wall gets the lesson with the
error, on any machine, in any tool. What keeps recurring becomes a rule.
What nobody uses gets archived.
Works with Claude Code and Cursor, Codex (experimental), and any MCP
client. Runs fully offline with no account, or hosted so your whole team
shares one set of lessons. MIT licensed and self-hostable.
Design choices
LoreKit makes retrieval deterministic and leaves reasoning to the model.
It stores lessons in scopes (branch::, repo::, project::, global; the
most specific copy of a key wins), delivers them through lifecycle hooks and
error matching, counts recurrence so lessons worth promoting into a rule
surface, and archives by measured usage (how often a lesson is chosen versus
delivered). Reasoning over what it delivers is the model's job. Non-goals, by
design:
No belief graph, and no typed links between memories.
No confidence scores, and no propagation between memories.
No contradiction detection, and no invalidation through dependency chains.
The bet: keep memory small, legible, and in the hot path — no structure
precomputed at write time. Beyond catching failures, a skill can use LoreKit
to improve on every run: self-improving workflows.
Why not just a CLAUDE.md?
Keep it. A rules file holds what you knew to write down before anything
broke. LoreKit captures what your agents find out the hard way — and keeps
sorting it.
Rules file (CLAUDE.md, .cursorrules, …)
LoreKit
Who writes it
You, when you remember to
Your agents, the moment they hit friction
What's in it
What you predicted would matter
What actually broke — and the fix that worked
What gets loaded
All of it, every session
What matches: at session start, on each prompt, on the failing call
Over time
Grows until someone prunes it
Promotes what recurs, archives what nobody uses
LoreKit is how you find out what has earned a place in your CLAUDE.md.
How the loop actually runs
Each step is shipped behaviour, not a roadmap item:
Learns. Lifecycle hooks watch the session for friction — errored tool
calls, a command repeated in a loop — and nudge the agent to write a lesson
before it stops. Clean sessions stay silent.
Recalls. When a tool call fails, the hook searches your lore with the
tool name and error text and injects up to three matching lessons before
the agent retries. (Claude Code; Cursor reads lessons through a rule and an
end-of-turn hook.)
Promotes. A lesson re-learned in later sessions accrues a seen-count;
session start ranks the most-recurring first, and the
Insights view flags the load-bearing ones to
promote into a permanent rule.
Prunes. Every lesson delivered costs tokens whether it's used or not.
LoreKit tracks how often each lesson is actually opened versus merely
delivered, and retention policies archive what nobody reads — previewed
first, restorable with one command.
Quick start
npx @lorekit/cli install
The installer wires the MCP server, three companion skills, and the lifecycle
hooks into your project, and picks up the repo's scope from its git remote.
It then asks for a token — and that's where you pick a path: