sage-memory

Reviewed at commit aa6bd69 New version, not yet reviewed

Keeps project and global memories in SQLite through a shared local daemon, hands the model the entries that match its file tool calls, prompts and subagent…

Made by
Kerem Gok
What we checked

Keeps project and global notes in SQLite databases under ~/.claude/sage-memory through a local background program, and adds the matching notes to your prompts, file tool results and subagent tasks. After each turn it has Haiku on your own Claude account pick new notes from your prompts, the answer and the files and commands the turn touched. Setup is optional and installs an embedding package and model.

Review details

Static review of the source at the pinned commit; not run. Hooks: session.start, tool.describe/tool.check/tool.call for its own mcp__sage-memory__* tools (tool.check always answers allow, so its 15 memory tools never ask for approval; they only reach its own stores), prompt.section (adds a fixed note to the system prompt telling the model to read, fix and proactively save notes), classic.SessionStart, session.compact, prompt.context, prompt.attachment, classic.PostToolBatch, tool.call on Read/Grep/Glob/LSP/Edit/Write/NotebookEdit/MultiEdit and other MCP tools (appends a memory block to the result context), prompt.submit (adds context), agent.spawn (prepends notes to the subagent prompt), turn.complete, tool.call on Bash (records the command, redacting ones that look like they hold a credential, and moves anchors after mv/git mv/Move-Item), session.end, command.run, ui.render/ui.close for a pane, turn.start. Runtime calls: $.process.run for node -p (version probe), git rev-parse and node daemon/launch.ts; $.http.fetch only over a Unix socket in ~/.claude/sage-memory with a random bearer token; $.model.complete for the consolidator, curator, triage and compact jobs (haiku by default, uses tokens); $.tool.call TaskList; $.fs.read for server.json and a file you pass to /sage-memory import; $.store, $.clock, $.sidebar.set, $.ui.status/log/open. The launcher spawns a detached Node daemon (node:sqlite, files mode 0600 in ~/.claude/sage-memory) that exits five minutes after its last request; an interactive session polls it every 60 s, so it lives as long as the session plus five minutes. The daemon reads anchored files only inside the project root (realpath checked), runs git hash-object on them, stats PATH entries for command anchors, reads agent frontmatter in the project's .claude/agents and ~/.claude/agents, and lists file names (not contents) under ~/.claude/projects to drop records of deleted sessions. Writes refuse text that looks like a secret. Only on /sage-memory setup does it run npm install @huggingface/[email protected] (exact top-level version, dependencies unpinned, ONNXRUNTIME_NODE_INSTALL=skip) into ~/.claude/sage-memory/runtime and let transformers.js download the Xenova/paraphrase-multilingual-mpnet-base-v2 model from Hugging Face; the npm package itself was not reviewed. A daily cleanup (on by default, /sage-memory daily off) runs hygiene and an applied triage that deletes or merges low-value notes; deleted notes stay recoverable. Opt-in, off by default: capturing Bash outcomes and errors (up to 200 characters of output) as notes. Notable: notes in the user scope are injected into every context and subagent of every project as the user's global rules, and the model can write them without asking, so text the model was induced to save follows you across projects; review them with /sage-memory pane. Read fully: register.tsx, launcher, server, http, embedder, embeddings, setup, stores, routes, upkeep-routes, hygiene, hygiene-jobs, claude-dirs, verify, blobs, commands, agents, remap, paths, files, lock, capture; the remaining pure logic and SQL modules (relevance, rules, ranking, dedupe, graph, pane rendering, prompt texts) by targeted search. Linux and macOS only.

What it uses
  • Reads your prompts: yes
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): yes
  • Sends data over the network: yes
  • Stores data: yes
  • Shows something on screen: yes
Hooked events

Keeps project and global memories in SQLite through a shared local daemon, hands the model the entries that match its file tool calls, prompts and subagent tasks, and saves new ones with a haiku consolidator after each main-loop turn.

Made this mod? Add a badge to your README

modsforClaude badge for sage-memory

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/sage-memory.svg)](https://modsforclaude.com/mods/sage-memory/)

← All mods