claude-mem-lite

data-ai MCP Server

Persistent long-term memory for Claude Code via MCP — captures coding decisions, bugfixes, and context across sessions. Hybrid FTS5 + TF-IDF search with episode batching. Single SQLite DB, no external services. Alternative to claude-mem with 600x lower cost.

VerifiedInstall Ready
data-aidata-ai
3 views61 stars13 forksv6.9.1MIT

Why This Matters

Discovered via github-topic:mcp and last synced 1w ago.

VerifiedInstall Ready
Source
github-topic:mcp
Stars
61
Last synced
1w ago
Install
Instructions detected

Install

1. Install the package

npx claude-mem-lite

2. Add to claude_desktop_config.json

{
  "mcpServers": {
    "claude-mem-lite": {
      "command": "npx",
      "args": [
        "claude-mem-lite"
      ]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)

107
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (107)

claude-mem

claude-mem-lite

Tool

CLI equivalent

Dimension

Winner

mem_search

FTS5 full-text search with BM25 ranking. Filters by type, project, date range, importance level.

original

Sees full diffs, but rarely useful for memory search

mem_timeline

Browse observations chronologically around an anchor point.

mem_update

`claude-mem-lite update <id>`

Platform

Status

mem_save

Manually save a memory/observation. Accepts `closes_deferred` array for transactional closure of deferred work.

mem_fts_check

`claude-mem-lite fts-check <check\

search

recent

mem_get

Retrieve full details for specific observation IDs (includes importance and related_ids).

mem_export

`claude-mem-lite export`

CLAUDE_MEM_DEBUG

Enable debug logging (`1` to enable).

mem_maintain

`claude-mem-lite maintain scan --ops dedup,decay`

mem_defer_drop

Drop a deferred item without fixing it; requires a `reason` for the audit trail.

mem_recent

Show most recent observations, ordered by time. Quick snapshot of latest activity.

mem_defer

Mark work for a future session (v2.70+). First-class carry-forward signal, surfaced in SessionStart `### Deferred Work` block.

mem_compress

`claude-mem-lite compress`

Variable

Description

mem_recall

Recall observations related to a file. Use before editing to surface past bugfixes and context.

mem_optimize

`claude-mem-lite optimize`

CLAUDE_MEM_MODEL

LLM model for background calls (episode extraction, session summaries). Accepts `haiku` or `sonnet`.

CLAUDE_MEM_DIR

Custom data directory. All databases, runtime files, and managed resources are stored here.

MEM_QUIET_HOOKS

See Core above — the broadest injection-volume switch.

mem_defer_list

List open deferred items for the current project.

ANTHROPIC_API_KEY

Anthropic API key. When set, all background LLM calls go directly to the Anthropic Messages API (with prompt caching). Highest priority.

mem_stats

`claude-mem-lite stats`

mem_browse

`claude-mem-lite browse`

MEM_NO_ADOPT_HINT

Silences the one-line "Invited-memory 未启用:`claude-mem-lite adopt`…" hint that SessionStart appends when the current project hasn't been adopted. Since v2.82.1 auto-adopt runs on every SessionStart for any install path, so this hint typically surfaces only when you've explicitly opted out (`MEM_NO_AUTO_ADOPT=1` or `claude-mem-lite adopt --disable`).

MEM_NO_AUTO_ADOPT

Global opt-out for auto-adopt (v2.82.0+). `1` prevents the per-SessionStart auto-write of the `CLAUDE.md` managed block across **all** projects. For per-project opt-out use `claude-mem-lite adopt --disable` instead (writes a durable `<memdir>/.mem-no-auto-adopt` sentinel that survives marker deletion).

Supported

Fully compatible (Intel and Apple Silicon)

mem_delete

`claude-mem-lite delete <id>`

mem_registry

`claude-mem-lite registry <action>`

General-purpose

Generic graph nodes

gold

`, the *fraction* of all gold sessions retrieved), the lexical stack scores @1 = 52.9% / @5 = 87.8% / @10 = 91.0%. The whole gap is the 65% of questions with multiple gold sessions — any-hit needs one, fractional needs them all, and @1 is capped at 1/

mem_use

_MCP only_

OPENROUTER_API_KEY

OpenRouter API key (OpenAI-compatible). Used for background LLM calls when `ANTHROPIC_API_KEY` is **not** set. If neither key is set, calls fall back to the `claude -p` CLI.

Tie

Users search semantic concepts ("auth bug"), not code lines

Untested

Linux under the hood, so it should behave as the Linux row; nobody has reported either way

automatic

does not happen

Removed

What happens now

clear

compact

Path

Update mechanism

Metric

Score (production-hybrid)

OPENROUTER_MODEL

Overrides the OpenRouter model slug for **all** background calls (e.g. `openai/gpt-4o-mini`, `qwen/qwen-2.5-72b-instruct`). When unset, the `CLAUDE_MEM_MODEL` tier maps to `anthropic/claude-haiku-4.5` (haiku) or `anthropic/claude-sonnet-4.5` (sonnet).

CLAUDE_MEM_ALL_TOOLS

`1` exposes all 18 MCP tools in `tools/list` instead of the 9 core ones (pre-v2.34.0 behavior). The 9 hidden tools stay callable by exact name either way.

CLAUDE_MEM_FILE_INTEL

`0` disables the file-intel block injected before `Read` (past observations about the file you are about to open).

CLAUDE_MEM_FILE_INTEL_MIN_TOKENS

Files smaller than this stay silent — file-intel only pays for itself on large files.

CLAUDE_MEM_REREAD_GUARD

`0` disables the warning when the same file is read twice in a session. Never fires on `offset`/`limit` paging.

CLAUDE_MEM_REREAD_MIN_TOKENS

Token floor below which the re-read guard stays silent.

CLAUDE_MEM_PRETOOL_NUDGE

`1` extends the pre-tool recall nudge from `Read` to other tools.

CLAUDE_MEM_KEEP_LOW_SIGNAL

`1` keeps low-signal observations that the deterministic filter would otherwise drop before dedup/vector work.

CLAUDE_MEM_NO_TEMPLATE_REFRESH

`1` stops SessionStart from refreshing the adopted `CLAUDE.md` managed block when the shipped template changes.

CLAUDE_MEM_ERROR_RECALL_BM25_MIN

Relevance floor for the error-recall surface (memories injected after a failed Bash command). **Off by default.** Setting it to `10.5` (the calibrated value) makes the surface stay silent when its best-matching memory is not actually about the failure — the whole set is dropped, never trimmed row-by-row. **It is a real trade, not a free win:** measured on a live database at that threshold, injections fall ~37% and ~39% of firings go silent, concentrated in projects with few memories. Off by default because nothing shows the dropped rows were noise. Explore with `node benchmark/error-recall-suite.mjs --sweep`.

CLAUDE_MEM_DEEP_DISCLOSURE

`off` suppresses the one-line caveat appended to a multi-variant deep result. The caveat exists because deep search fills the page even when the corpus cannot answer — measured at 10 of 10 slots on queries whose answers had been removed (`benchmark/deep-search-holdout.mjs`) — and `deep` is AUTO by default on the MCP surface, i.e. it escalates precisely when the honest answer is "nothing". It does not change retrieval, ranking, or which rows are returned.

CLAUDE_MEM_NO_CITE_NUDGE

`1` fully silences the cite-back nudge.

CLAUDE_MEM_LEGACY_STOP_UNLINK

Restore the pre-v5.4.0 behaviour where `Stop` deletes the session file. Documented revert path for the session-lifecycle change, not a supported configuration: it re-mints a mem session per turn and makes the `/clear` handoff unreachable again. Only reach for it on a host that fires `Stop` once per session rather than once per turn.

CLAUDE_MEM_NO_LESSON_RETRY

`1` disables the one-shot retry that re-asks for a missing `lesson_learned`.

CLAUDE_MEM_UPS_MAX_RESULTS

Max memories injected per prompt.

CLAUDE_MEM_UPS_IDENTIFIER_BYPASS

`0` disables the bypass that lets an exact identifier match skip the score floors.

CLAUDE_MEM_AUTO_DEEP_CLI

`0` disables the same auto-escalation on the CLI path only.

CLAUDE_MEM_CITE_NUDGE_MIN_INJECTED

Minimum injection volume before the ratio gate is judged at all.

CLAUDE_MEM_SKIP_COMPRESS

Skip auto-compression of old observations.

CLAUDE_MEM_UPS_REQUIRE_SIGNAL

`0` restores always-search; by default the prompt must carry an explicit retrieval signal.

CLAUDE_MEM_UPS_PROMPT_FALLBACK_LIMIT

How many past-prompt rows the fallback arm may return.

CLAUDE_MEM_SCOPE_FILTER

`1` stops environment-scoped observations from firing on file-triggered recall. They stay reachable via search. **Leave it off**: on the face it gates, `environment` is not the low-relevance class its premise assumes — it cites at least as well as `project` (47.5% vs 44.3%, intervals overlapping), and an earlier measurement left 173 recall groups empty with it on.

CLAUDE_MEM_CITE_NUDGE_SILENCE_AFTER

Consecutive low-cite sessions before the nudge goes quiet; `0` = never silence.

CLAUDE_MEM_SKIP_MAINTAIN

Skip the 24h auto-maintain pass (decay, purge, backup).

CLAUDE_MEM_TASK_IMPERATIVE

`on`/`1` injects the single most relevant lesson at prompt position under an imperative template.

CLAUDE_MEM_UPS_BM25_MIN

BM25 relevance floor for a result to be injected.

MEM_COVERAGE_THRESHOLD

Fraction of query terms a memory must cover to qualify (∈ [0,1]).

CLAUDE_MEM_READS_CARRY

An episode flush collects `reads-<project>.txt` only when it will actually save an observation, so a flush that records nothing no longer discards the Read paths it swept up (42.2% of the paths a flush consumed, measured over 1122 transcripts). `0` restores the pre-v3.83.0 behaviour.

CLAUDE_MEM_CITATION_RELEVANCE_GATE

Stop credits an `access_count` to a memory the session cited only when something made that memory relevant to the session — it was injected, or you typed its `#NN` yourself. `off` restores the pre-v3.84.0 behaviour of crediting every `#NN` the assistant wrote, which over-counts sessions that discuss memories in prose (release notes, audit reports): measured on real transcripts, 267 of 859 credited (id, session) pairs — 31.1% — were mentions nothing had put in front of the model. Superseded citations are redirected to their keeper on both settings.

CLAUDE_MEM_SKIP_OPTIMIZE

Skip the LLM optimization pass (re-enrich, normalize, cluster-merge).

CLAUDE_MEM_SUBAGENT_INJECT

Dispatch-time memory injection for subagents.

CLAUDE_MEM_UPS_BM25_MIN_FOLLOWUP

Looser floor for follow-up prompts inside an already-injected session.

MEM_CROSS_PROJECT_BOOST

Multiplier for matches from other projects (∈ [0,1]); raise it for installs that want more cross-project sharing.

CLAUDE_MEM_SUBAGENT_DECAY

The `subagent` injection face feeds the decay loop: memories handed to a dispatched agent enter the denominator, and the citation that agent makes in its own transcript counts as the numerator. `0` returns the face to metered-but-never-decaying (v3.77–v3.82).

CLAUDE_MEM_SKIP_AUTO_DEDUP_FUZZY

Skip the MinHash near-duplicate pass, keeping exact dedup.

CLAUDE_MEM_SALIENCE

Selects a comprehension-bridge arm (`bridge`, `bind`); unset = current default behavior.

CLAUDE_MEM_UPS_OR_BM25_MIN

Floor applied to the OR-fallback arm (looser query, needs a stricter floor).

MEM_OR_FALLBACK_MAX_TOKENS

Max query tokens allowed into the OR fallback (∈ [0,50]).

CLAUDE_MEM_NO_CITATION_TRACK

`1` disables both the access-count bump and the decay loop — no citation bookkeeping at all.

CLAUDE_MEM_METRICS

`1` records feature-injection counters surfaced by `claude-mem-lite stats`.

CLAUDE_MEM_SKIP_MARKER_GC

Skip the runtime-marker sweep. **Must be exactly `1`** — unlike the other `CLAUDE_MEM_SKIP_*` flags, which accept any truthy value, this one compares against the string `1`. That is deliberate: a truthy check makes `=0` mean "skip", which is the opposite of what anyone typing it intends.

CLAUDE_MEM_EDGE_DECAY

Enables decay of file↔observation edges.

CLAUDE_MEM_UPS_TOP_MIN

Minimum score for the top hit; `0` disables (useful on tiny test corpora).

CLAUDE_MEM_CJK_PREC_MIN

Precision floor for CJK segmentation candidates.

MEM_DISABLE_CITATION_DECAY

`1` disables only the decay writes, keeping access-count bumps.

CLAUDE_MEM_SKIP_UPDATE

Skip the 24h auto-update check against GitHub Releases.

CLAUDE_MEM_EDGE_DECAY_K

Edge-decay threshold when the flag above is on (clamped to ≥1).

CLAUDE_MEM_UPS_FLOOR_REF_CORPUS

Reference corpus size the score floors are normalized against, so a fresh install with few rows is not silently gated to zero injections. Shared by every floor-bearing surface, including error-recall below.

CLAUDE_MEM_ERROR_RECALL_RERANK

`off` restores the flat keyword ordering of the error-recall surface. **On by default**, and unlike the floor above it removes nothing: memories that share only the failed command's vocabulary are demoted below memories that mention the failure itself, and when a project has none of the latter the result is unchanged. Measured on a live database over 52 real failing commands × 15 projects: the lead memory matched no error term in 42.3% of firings before, 21.5% after, with the injected row count identical.

CLAUDE_MEM_ERROR_RECALL_ON_FAILURE

`off` stops the plugin from recalling memories when a Bash command **fails at the host level**. On by default. Claude Code delivers failed tool calls to a separate `PostToolUseFailure` hook event, so before this the surface only ever saw commands that exited `0` while printing error-ish text — a genuinely failing build recalled nothing. Denials from your own guardrails (sandbox, policy hooks, declined permission prompts) and commands you interrupted are never recalled for.

CLAUDE_MEM_AUTO_DEEP

`0` disables automatic deep-search escalation (one Haiku call rewriting a weak query into keyword/concept/HyDE variants). Explicit `deep: true` still works.

CLAUDE_MEM_REACH_DISCLOSURE

`off` suppresses the one-line note that fires when a search's reported `total` exceeds what its pagination can hand back. The candidate pool is sized from `limit` alone and deliberately does not grow with `offset` (D#30 — an offset-scaled pool re-ranks its own prefix under RRF, so pages overlapped and gapped), while `total` is the full match count. Measured on a 128-row corpus: at the default limit of 20 the last non-empty offset is 59, so 60 of 128 rows are unreachable at any offset. The note reports that; it does not change retrieval, ranking, or which rows are returned. It stays **silent** when a filter you asked for (`tier`, or the CJK precision gate on prompts) removed rows after the count was taken — that gap is your filter, not the pool, and raising the limit would not recover it.

CLAUDE_MEM_NORMALIZE_CROSS_PROJECT

`1` restores the pre-fix behaviour where the daily unattended `normalize` runs ONCE over every project's concepts at the same time. That is how one project's stored content could steer synonym groups applied to another project's rows, so the default is now one scoped pass per project (bounded to 8 per run). The cost of the default is that `k8s` in one project and `kubernetes` in another are no longer unified automatically. Note that EVERY unscoped run fans out, including an explicit `optimize --run --task normalize` with no `--project` — this variable is the only route back to the single cross-project pass. A foreground `optimize` run prints a warning when it is set; the daily unattended pass cannot (its worker is spawned with stderr closed), so `claude-mem-lite doctor` reports it as a ⚠ instead.

CLAUDE_MEM_CITATION_ADOPTION_THRESHOLD

**Removed — inert.** Tuned the per-project adoption gate, which is gone (D#204). Setting it warns on stderr and changes nothing.

CLAUDE_MEM_CITE_NUDGE_THRESHOLD

Cite-rate below which the nudge fires.

CLAUDE_MEM_CITE_NUDGE_WIDE_DENOMINATOR

`1` judges the wide cite-recall ratio (every `#NN`-shaped token the model saw) instead of the lessons the hooks injected. **Half of the revert**: the threshold moved too, so pre-v6.6.0 gating needs this **and** `CLAUDE_MEM_CITE_NUDGE_THRESHOLD=0.6`. This switch alone gives you the wide ratio judged at 0.4, which is neither release's behaviour.

CLAUDE_MEM_SKIP_SUMMARY

Skip the background LLM session summary at **both** of its spawn sites — `Stop`, and the SessionStart `/clear`-handoff path. Until v5.3.0 only the `Stop` one honoured it.

CLAUDE_MEM_SKIP_EPISODE_LLM

Skip LLM extraction on episode flush — observations are still batched, just not summarized.

CLAUDE_MEM_SKIP_SAVE_ENRICH

Skip the background Haiku call that backfills `lesson_learned` / search aliases after a save.

CLAUDE_MEM_SKIP_SIG_VERIFY

Skip Ed25519 signature verification of a downloaded update. **Escape hatch — leaves updates unauthenticated.**

CLAUDE_MEM_FLUSH_TIMEOUT

Seconds the Stop hook waits for pending episode flushes.

CLAUDE_MEM_BACKUP_BUDGET_MB

Disk budget for backup snapshots; the next maintain/save evicts oldest snapshots past the 7-day undo grace.