# michielinksee/linksee-memory [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/michielinksee/linksee-memory  
**GitHub Stars:** 16  
**npm Downloads (last month):** 4255  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/michielinksee-linksee-memory

## Description
Local-first cross-agent memory with a 6-layer structure, Ebbinghaus-style forgetting curve, and drift detection that catches when code diverges from past decisions. One SQLite file shared across Claude Code, Cursor, Codex, and Gemini — no account or API key. npx linksee-memory

## Tools
Capabilities this server exposes over MCP:

- **remember** — Persist knowledge across sessions and AI tools (Claude, GPT, Cursor, Codex, Gemini). The only cross-agent memory that survives session boundaries.

WHEN TO CALL:
• The moment an error or failure occurs → layer: "caveat" (auto-protected, never forgotten)
• When a decision is made or approved → content + anchor: {} (remembered AND enforced in one call)
• When a goal is set or updated → layer: "goal"
• When something new is learned → layer: "learning"
• When the user says "remember this" / "覚えておいて"
• After completing a task or receiving user approval

MODES:
• Create (default): content is the only required field. entity defaults to the project you are in; layer defaults to "context" (or "learning" when anchor is set).
• Create + enforce: add anchor: {} — the memory also becomes a decision the guard re-injects before Edit/Write/Bash and on session start. Give anchor.violation_signal (forbidden strings) to make contradictions detectable; anchor.affects (path globs) to scope it.
• Update: memory_id (+ optional content, layer, importance). content replaces the stored content; add merge: true to change only the JSON keys you send (the other keys are kept, a key sent as null is removed)
• Delete: memory_id + forget: true

Importance ≥ 0.9 pins the memory (protected from auto-forgetting). Supports Japanese (日本語) and English.

Title: when you create a memory with JSON content that has a string `what` but no `title`, a title is made from the start of `what` and marked title_auto: true (updates never add one).
- **recall** — Your persistent memory across all AI tools. CALL THIS BEFORE STARTING ANY TASK to check for past caveats (pain records), decisions, and learnings — prevents repeating mistakes across sessions.

Typical usage: recall({ query: "keywords" }) for search, recall({ path: "file.ts" }) for file history, recall() for overview.

WHEN TO CALL:
• Before starting any new task or touching a file
• When the user mentions "before" / "前に" / "last time" / "remember when"
• When an error occurs — check if you've seen it before
• When making a decision — check for prior decisions on the same topic

THREE MODES (auto-detected):
• Search (default): provide query → returns memories ranked by relevance + heat
• File history: provide path → returns complete edit history with user-intent context
• Session brief: omit all params → what needs attention (🔴/🟡), where you are on the Map, open loops (proposals / distill queue / friction), top entities. CALL THIS FIRST in a new session.
• Locate: where: "<topic>" → your position on the Current Truth Map + blast radius (what else moves if you touch this). where: true → auto-locate from recent edits
• Dream: dream: true → North Star + orphaned proposals to triage + distill_queue + friction (the full triage session; the brief carries only the counts)
• Entity list: overview: true (the old no-arg behaviour)

Works across Claude, GPT, Cursor, Codex, Gemini — one local SQLite file, nothing leaves your machine.
- **read_smart** — Token-saving file reader with AST-aware diff caching. Use INSTEAD of the standard Read tool for ALL file reads — even first reads gain chunk metadata for future savings.

• First read: full content + chunk metadata (enables future savings)
• Re-read unchanged: ~50 tokens (99% savings)
• Re-read modified: only changed chunks (50-90% savings)

Especially effective for files >200 lines. Always prefer this over Read.
- **drift_status** — Check what's drifting right now — the "Intent Datadog" for your product decisions.

Returns a structured truth map showing which decisions/constraints/hypotheses are:
🔴 drift (unaccounted divergence from intent)
🟡 review (soft signal, awaiting human decision)
⚪ held (acknowledged, time-boxed, not forgotten)
🔵 aligned (reality matches intent)

Nodes are classified into 4 species:
• hypothesis → Decision Cards (decision journal format)
• constraint → Rules (pass/fail checklist)
• commitment → Heartbeats (cadence monitoring)
• source_of_truth → Reference (stable anchors)

WHEN TO CALL:
• At session start — "what needs my attention?"
• Before making a decision — check for existing anchors on the topic
• After completing work — verify drift state changed
• When the user asks about product health / what's broken / what's stale
- **declare_anchor** — Declare a new decision, constraint, or prohibition as a truth-map anchor.

Anchors are NORMATIVE claims: "we decided X", "Y is forbidden", "Z must always hold."
The drift detector later checks these against committed reality.

declare-don't-mine: anchors come ONLY from explicit human declaration, never from pattern extraction.

WHEN TO CALL:
• When the user makes a product decision ("let's go with approach A")
• When a constraint is established ("never do X")
• When a commitment is made ("we ship weekly")
• When the user says "anchor this" / "record this decision"
- **resolve_drift** — Record a resolution for a drifting anchor — the human feedback loop.

6 actions:
• fix — "we fixed the code/reality to match intent" → state becomes aligned
• supersede — "intent evolved, this is the new direction" → state becomes aligned
• acknowledge — "we know, parking it for now" → state becomes held (with optional review date)
• dismiss — "false positive, not actually drifting" → edges dismissed AND the gate stops firing on it (hit_term: just that word; gate:false: close the edges but keep the gate watching)
• harden — "re-injected but still violated, enforce it" → card_policy.gate_mode=hard (PreToolUse will BLOCK)
• soften — "back off to a warning" → gate_mode=soft

WHEN TO CALL:
• After drift_status shows 🔴 drift or 🟡 review items
• When the user says "that's fixed" / "ignore that" / "we changed direction"
• When acknowledging a known gap with a review date
- **share_draft** — Make a LINK to a reviewed draft of a field note for other agents (KanseiLINK note page). ONLY when the user says they want to share — never call it on your own.

Use after a SaaS / MCP / API connection got stuck and was fixed (or was not). You write the fields; this tool only checks them and builds the URL. Linksee sends nothing: the user opens the link, reviews the filled form, and only their click on that page sends it.

No values, only kinds: write "401 invalid_token", not the token. A field that looks like a key, token, JWT, e-mail, tenant URL (acme.slack.com), IP, local path (C:, /Users/, /home/) or a long hex/base64 run stops the build and returns which field. The whole URL must fit in 2,000 characters (a Japanese character takes 9) — if not, it asks you to shorten; it does not cut.

Returns { url, notice } — show the user both. Linksee records only that a draft was made (no field text).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "linksee-memory": {
    "command": "npx",
    "args": ["-y","linksee-memory"]
  }
}
```

## Documentation

## What michielinksee/linksee-memory does

michielinksee/linksee-memory provides local-first memory for AI-assisted software work. It keeps knowledge in a SQLite database on the machine, allowing Claude Code, Cursor, Windsurf, OpenAI Codex, and Gemini CLI to use the same records. The database is shared across projects on that machine and records can include their originating client and project entity.

The memory model covers context, learnings, goals, caveats, and decisions. Importance values of 0.9 or higher pin records against automatic forgetting. The server supports English and Japanese, and uses an Ebbinghaus-style forgetting curve for unpinned memories. A decision can also be attached to an anchor so it is treated as an enforceable constraint rather than only a historical note.

## How it works

The `remember` tool creates, updates, or deletes records. A plain create stores content; an `anchor` can turn a decision into a normative rule with optional forbidden signals and path globs. Updates can replace content or merge selected JSON keys, and `supersedes` can mark a newer decision as replacing an older one.

`recall` supports relevance-ranked search, file history, session briefs, topic location, decision triage, and entity listings. Calling it without parameters produces a session-oriented brief, while `path` returns edit history and `where` locates a topic on the Current Truth Map. The `read_smart` tool caches AST-aware file chunks so unchanged rereads use little output and modified files return changed chunks.

Truth-map tools represent hypotheses, constraints, commitments, and sources of truth. `drift_status` reports aligned, held, review, or drifting items. `resolve_drift` records whether an item was fixed, superseded, acknowledged, dismissed, hardened, or softened. `declare_anchor` accepts only explicitly declared human intent; it does not infer anchors from patterns.

## Setup and configuration

Node.js 22.16 or later is recommended because SQLite with FTS5 is built into Node. Node.js 20 and Node.js 22.0 through 22.15 can use `better-sqlite3`, which may need a native build and an allowed npm install script.

For Claude Code, run `npx -y linksee-memory setup` from a shell to register the MCP server, install the skill, and add session and guard hooks. The command modifies Claude configuration files while retaining a backup of `settings.json`. Use `setup --dry-run` to inspect changes first. Codex can register the server with `codex mcp add linksee -- npx -y linksee-memory`.

Claude Code can alternatively install the plugin from its marketplace. The plugin and shell setup should not be enabled together: the plugin provides the MCP server and skill, while shell setup also installs hooks. The server can also be started with `npx -y linksee-memory@latest`.

## Tools and capabilities

- `remember`: Save, update, delete, pin, supersede, or enforce project knowledge.
- `recall`: Search memory, inspect file history, create session briefs, locate topics, and run triage views.
- `read_smart`: Read files with cached chunk metadata and AST-aware change detection.
- `drift_status`: Inspect divergence between recorded intent and current reality.
- `declare_anchor`: Record an explicit decision, constraint, prohibition, commitment, or reference point.
- `resolve_drift`: Record human feedback about a drift item and adjust its enforcement state.
- `share_draft`: Build a review link for a field note after the user asks to share it.

`share_draft` validates the draft for secrets and sensitive-looking values, keeps the URL under 2,000 characters, and returns a URL plus notice. It does not send the note automatically; the user must open and submit the link.

## Limitations and notes

The database is local to one machine. There is no account, API key, cloud synchronization, or network call by default, so transferring memory to another machine requires copying `~/.linksee-memory/` with clients closed.

Claude Code receives the special behavior supplied by hooks: automatic session capture and reinjection before edits. Cursor, Windsurf, Codex, and Gemini CLI share the memory but do not receive those pre-edit warnings or automatic saves; their agents must call the MCP tools.

A database from schema versions 1 through 5 must be migrated with the matching migration command before use. Migration should be performed with clients closed and creates a copy while moving the original files into a dated backup directory. The project is released under the MIT license.

_Full upstream README: https://allmcps.com/mcp/michielinksee-linksee-memory/readme_

