Repository navigation
v2.17.0
Hardening and "recall everywhere". Consolidates open PRs #27–#38 with six parallel workstreams into one release.
Security
- Graph server no longer exposed to the network. It bound
0.0.0.0andGET /api/settingsreturned provider API keys in plain text. It now binds127.0.0.1(override:LTM_SERVER_HOST, with a warning), rejects non-loopbackHost/X-Forwarded-Host/Origin(DNS-rebinding and cross-site requests), requiresContent-Type: application/jsonon mutations, masks secrets in settings/config responses (masked values sent back never overwrite the real key), and confines/api/revealto the database directory. The Next UI on :7332 now binds loopback too. - Fail-closed secret scrubbing on every durable write (#29) and on egress — SessionStart injection, MCP recall/context/context_items/resources, categorise, dedup prompts, embeddings (#31).
- Private tags — memories tagged
privateare left out of recall, SessionStart, exports,getand janitor candidates unlessincludePrivateis passed. Private is not encryption (#37). - Proposals:
accept/rejectrefuse path-like session ids (previously../xcould rewrite or delete JSON outside the proposals dir). - Staging terms are scrubbed before
memory_conflict_stagingwrites (#34 follow-up that was missing from the PR stack tip). - Private memories never leave the machine. Before this, a
privatememory was still sent to the embedding provider bylearn()(its vector and auto-relations), to the categorise LLM, injected by prompt recall, listed by thememory://MCP resources, and reachable through graph traversal. All of those paths now skip it. - Prompt recall and the SessionStart context summary are egress-scrubbed too (rows and legacy context files written before the scrubber existed reached the model verbatim).
Added
- Prompt-time recall — new
UserPromptSubmithook adds up to 5 memories relevant to each prompt (full-text only, ~50ms, never repeats a memory in a session). Config:ltm.promptRecall,ltm.promptRecallLimit. - Commit-driven stale flagging inside Claude Code — new
PostToolUse(Bash) hook flags memories anchored to files Claude commits, without the global git hook. - MCP tools —
get(fetch one memory by id, #32),context_add(goal/decision/gotcha/progress),proposals(list/accept/reject).context/context_items/context_adddefaultprojectto the current one. Every tool carries MCP annotations (readOnlyHint,destructiveHint, …) and the server reports the real package version. - Hybrid recall — full-text (stopwords dropped, prefix + plural matching) and semantic results fused with Reciprocal Rank Fusion; query relevance now leads ranking. Golden-query eval: right memory first 8/8 (was 1/8).
RecallInput.semantic: falseforces full-text. - SessionStart compact index —
- [id] title, capped byinjectTopN(now actually wired, #30/#33), full body viaget. - Supersede review — contradictions are staged, never auto-applied; SessionStart lists pending ones;
ltm conflict list|accept|reject|coexist(#34, #35). - Learn near-dedup — FTS shortlist + Jaccard tiers with
matched_by/score/matched_idon the result (#36). - Standalone janitor —
ltm janitor run|status|schedule|daemon, single-instance lock,SessionEndtrigger, systemd/launchd/cron units (#27). scripts/unwire-legacy-hooks.ts— lists (--check) or removes OpenLTM hook entries from~/.claude/settings.json, with a backup.- QA harness —
bun run qa:smoke(MCP over stdio, every hook as a subprocess, the semantic path against a stub embeddings server, the built Pi/OpenClaw bundles under Node and OpenCode under Bun, graph-server network guards) andbun run qa:ui(the graph UI in Chromium via Playwright).scripts/qa/prompt-recall-eval.tsmeasures prompt-recall precision/recall on a labelled corpus. - Skills — one
Ltmmemory skill (merges ContinuousLearning, session-context, Learned) with reference files; newMemoryReviewcuration skill;/openltm:servercommand replaces the LtmServer skill; trigger evals underevals/.
Changed
- Hook lifecycle.
Stopfires after every turn, so it now only upserts one progress row per session; session evaluation moved toSessionEnd. SessionStart is source-aware (startup/resume/clear/compact), no longer runsgit fetchor editsknown_marketplaces.json, onboards with an absolute bun path, keeps summary headers when trimming, injects globals for new projects, and announces pending proposals. All hooks have explicit timeouts. Dev installs are wired the same way. - One project identity across hosts. Claude Code, Pi, OpenCode and OpenClaw resolve names the same way (registry → git repo root → folder name). A host's previous name is kept while it is the only one holding data, so nothing is orphaned.
- OpenLTM state moved out of
~/.claude/projects(Claude Code's transcript directory) to<dataDir>/projects/; config read orderLTM_CONFIG_PATH→<dataDir>/config.json→ legacy~/.claude/config.json. Legacy files are copied on first use and never modified. - Session pattern logs moved from the plugin install dir to
${CLAUDE_PLUGIN_DATA}/learned/. - Agent
planner→ltm-planner: valid Claude Codetools:list, reads LTM itself (read-only), narrower trigger. - Tests run with an isolated
HOME/CLAUDE_CONFIG_DIRand fail if the real~/.claudechanges (#38).
Fixed
- Progress history wiped by one long session — 20 turns replaced every earlier session's progress row.
- Memories differing by a marker, number, or negation were merged — "plan A"/"plan B", "retry 3"/"5" (#36's Jaccard tier) and "do not run X"/"do run X" (older containment rule) now stay separate.
git-learnerpassed fieldslearndoesn't accept, so mined memories were stored as global.- New projects were registered under the subfolder name the session started in.
- The bundled git hook ran core CLI entry points on every commit (printed
Usage: bun embeddings.ts …). - Graph server ignored SIGTERM.
- Janitor dedup queried a column removed in migration 010 and never produced suggestions; embedding counts and llama.cpp vector alignment (#27).
Fixed after end-to-end verification
Found by running the plugin in a real Claude Code session, the smoke scripts above, and a review of the whole release.
- SessionStart injected no memories when an embeddings provider was up (it read vectors from a column dropped in migration 010) and its index showed no titles.
- Prompt recall skipped memories SessionStart had only indexed, and its matching was retuned: light stemming, IDF weighting, generic words ("add", "test", "fix") count half, one distinctive word suffices, weak partial matches are dropped. On a labelled corpus of 71 prompts (17 held out), precision went from 85.5% to 95.2% and recall from 67.3% to 94.5%.
- recall() took its full-text and semantic top-N before applying the project/status/privacy filters, so a busy project could crowd out the current one's memories.
- MCP
learnwithfilesand noprojectstored an anchored memory as global; it now uses the current project. Log notifications were rejected (missingloggingcapability). - Commits run as
git -c k=v commitorgit -C dir commitwere not detected by the PostToolUse hook. - Accepted proposals lost their session's project.
- Near-dedup merged antonym pairs (sync/async, read/write, enable/disable, …).
bunx @rohirik/openltm-core --claudewrote MCP and hook config that Claude Code ignores (0 hooks, no server); it now writes~/.claude.jsonand the current hook format. The portable SessionStart crashed on a brand-new DB.bun installin any checkout wired global hooks and could setcore.hooksPath; dev wiring is now opt-in (LTM_WIRE_HOOKS=1), and the git hook only withltm.gitLearnEnabled.- Pi looked for the plugin cache under an old path, sorted versions as strings, and kept its own DB; it now shares Claude Code's DB, saves progress on compaction through the bridge, and its dead
hooks.ts/tools.tsare gone. OpenCode resolves the project from its path while keeping memories stored under the old name. - Janitor: graph-server, its interval and the scheduler now take the cross-process lock. Generated systemd units failed to load when the DB path contained a space. Scheduled units ignored
ltm.janitor.intervalMinutes. - Folder names in non-Latin scripts normalized to an empty name, splitting one repository into a different project per host.
- SessionStart listed every project's staged conflicts; identical permanent decisions/gotchas were stored repeatedly.
hooks/GitCommit.bundle.mjsrebuilt. Eight graph-app e2e tests still targeted the pre-2.8 UI and failed onmaintoo; they now test the current shell.
Fixed after the release verification (round 2)
The first independent verification rejected the candidate; these are its findings plus what the follow-up live acceptance run found.
- Tests could write the real user's config. An inherited
XDG_CONFIG_HOMElet installer tests read and rewrite the real OpenCodeopencode.json, and the Pi tests ran the realpi installfrom PATH. Installers now only honourXDG_CONFIG_HOMEfor the process's own home, never run the Pi on PATH for another home, and bound Pi calls with timeouts. The test harness points every XDG dir into the temp home, and its drift guard also watches the real OpenCode config and~/.pi. - Hooks and the MCP server could use two databases. The manifest pinned the MCP server's
LTM_DB_PATH, so an exportedLTM_DB_PATHonly reached the hooks. It also used a self-referentialCLAUDE_PLUGIN_DATAentry that Claude Code passes unexpanded, which created<project>/${CLAUDE_PLUGIN_DATA}/openltm.db. Both now resolveLTM_DB_PATH→$CLAUDE_PLUGIN_DATA/openltm.db, and an unexpanded placeholder is never used as a path. - OpenLTM hooks left in
~/.claude/settings.jsonby a git-clone or bunx install fire next to the plugin's. SessionStart now warns about them,/openltm:healthlists them, andscripts/unwire-legacy-hooks.tsremoves only those entries after backing up the file. - Graph UI edit and delete did nothing. The GET route for a memory answered PUT and DELETE too (also on
main). UI edits now go through the secret scrubber. - Stale flags:
git commit --amendre-flagged an already-stale memory; a memory is now flagged once until revalidated. - Janitor with embeddings
disabledlogged an error and exited 2 on every run; it now skips the embed step. - Session proposals no longer include routine git output ("nothing to commit").
/openltm:server stopleft the UI running while reporting its port free; it now stops the UI by PID and reports only what it verified.
Fixed after the release verification (round 3)
contextdidn't return whatcontext_addstored. It returned only memories, so a decision recorded withcontext_addwas saved but missing fromcontext.contextnow returns the project'sgoal,decisions,gotchasand the last 5progressentries (secret-scrubbed), next toglobalsandscoped.learnnow returns theproject_scopeit stored the memory under.- Graph UI lists went stale after an inspector edit or delete. On the project and memory-table pages, a deleted memory stayed listed, and an edit kept its old text, until a manual reload. Both pages now refetch.
- Diagnostics:
scripts/mcp-probe.tsstarts the MCP server the way Claude Code does and says why it would show as failed. The newqa/continuity-smoke.tschecks the default database end to end: an MCPlearnreaches the next SessionStart under an alternateCLAUDE_CONFIG_DIR, with exactly one database. The Ltm skill now says when alearnis global and which memories the SessionStart index lists.
Fixed after the release verification (round 4)
- Security CI: patched the three dependency findings.
@modelcontextprotocol/sdknow requires ≥ 1.31.0 (1.32.1 locked) in the root and inopenltm-core.proxy-addr2.0.8 via override.source-map-js1.2.2 in the graph app.
- The plugin's data dir is
openltm-OpenLtm. Claude Code names an installed plugin's data dir<plugin>-<marketplace>; OpenLTM assumedOpenLtm-openltm. So the Pi adapter opened a separate database instead of Claude Code's, and fallbacks wrote logs and proposals where nothing read them. All of them now use the dir Claude Code uses; a database under the old name is still found. The bunx installer shares the plugin's database. /openltm:healthread an empty in-memory database ("no such table: settings") and the wrong log dir, because the model's shell has noCLAUDE_PLUGIN_DATA. Commands now use the path Claude Code substitutes into them./openltm:admin scan --dry-runwrote changes. The flag was never read. The scan also imported a file that had moved, and opened no real database. All three are fixed.- Session proposals no longer include failures of read-only probes (
ls,lsof,curl…) or one-off scripts (bun --eval,sqlite3…), and drop theExit code Nprefix.
Fixed before release
After the round-4 approval.
/openltm:healthnever counted learns or recalls. Nothing emitted the events behind its "Memories learned" and "Recall hits" rows. MCPlearnandrecall, prompt recall and commit stale flags now log toltm.jsonl, and health shows all four.- OpenCode, OpenClaw, the
ltmCLI and a standalonemcp-servenow share Claude Code's database by default. WithoutLTM_DB_PATH, they used a database inside the core package. Now they use the Claude Code plugin's database when it exists. A database they already created stays in use, so nobody's memories move.
Removed
- Skills
ContinuousLearning,session-context,Learned,LtmServer; committed session logs;r2-split-harness/,scripts/tmp_*,verify_split*.ts.