claude-mem-lite 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "claude-mem-lite",
13
- "version": "3.0.0",
13
+ "version": "3.0.1",
14
14
  "source": "./",
15
15
  "description": "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. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark)."
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "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. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark).",
5
5
  "author": {
6
6
  "name": "sdsrss"
package/mem-cli.mjs CHANGED
@@ -39,6 +39,7 @@ import { resolveAnchorToken, formatAnchorError, resolveQueryAnchor, fetchRecentT
39
39
  import { buildSearchFtsQuery, parseDateBounds, computePerSourceWindow, effectiveObsFtsQuery, searchSessionsFts, searchPromptsFts, normalizeCrossSourceScores, applyUserSort, applyTierFilter } from './lib/search-core.mjs';
40
40
  import { AUTO_MERGE_THRESHOLD } from './lib/dedup-constants.mjs';
41
41
  import { countRecentHookErrors } from './lib/hook-telemetry.mjs';
42
+ import { aggregateMetrics } from './lib/metrics.mjs';
42
43
  import {
43
44
  insertDeferred, listOpenWithOrdinal, dropDeferred,
44
45
  resolveDeferredIds, closeDeferredItems,
@@ -1154,6 +1155,13 @@ async function cmdStats(db, args) {
1154
1155
  out(` Low-value (imp=1, never accessed, >30d): ${lowVal.c} (${(noiseRatio * 100).toFixed(1)}% noise)`);
1155
1156
  out(` Compressed: ${compressedCount.c}`);
1156
1157
  out(` Hook errors (last 24h): ${hookErrors24h}${hookErrors24h > 0 ? ` ← tail ${join(DB_DIR, 'runtime/hook-errors')}` : ''}`);
1158
+ // Tier-1 firing counters for ① file-intel + ② reread-guard (recorded by
1159
+ // pre-tool-recall.js via lib/metrics.mjs; CLAUDE_MEM_METRICS=1 to enable).
1160
+ const featAgg = aggregateMetrics(DB_DIR, 7);
1161
+ const fiN = featAgg.file_intel?.count ?? 0;
1162
+ const rrN = featAgg.reread_warn?.count ?? 0;
1163
+ const metricsOn = process.env.CLAUDE_MEM_METRICS === '1';
1164
+ out(` Feature injections (7d): 📄 file-intel ${fiN} · 🔁 reread-warn ${rrN}${(!metricsOn && fiN + rrN === 0) ? ' (set CLAUDE_MEM_METRICS=1 to record)' : ''}`);
1157
1165
  if (noiseRatio > 0.6) out(' ⚠️ High noise ratio — consider running mem compress');
1158
1166
  out('');
1159
1167
  // Tier counts only live (uncompressed, non-superseded) observations — surface the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-mem-lite",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "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. A lighter, lower-cost alternative to claude-mem (episode batching + a smaller model; cost savings are an internal estimate, not a measured benchmark).",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",
@@ -12,6 +12,7 @@ import { recordHookError } from '../lib/hook-telemetry.mjs';
12
12
  import { citeFactorClause } from '../scoring-sql.mjs';
13
13
  import { fileIntelFor } from '../lib/file-intel.mjs';
14
14
  import { shouldWarnReread, buildRereadWarning, readFileMeta } from '../lib/reread-guard.mjs';
15
+ import { recordMetric } from '../lib/metrics.mjs';
15
16
 
16
17
  // CLAUDE_MEM_DIR matches schema.mjs / main CLI — one env var sandboxes the
17
18
  // whole system. CLAUDE_MEM_DB_PATH / CLAUDE_MEM_RUNTIME_DIR remain as
@@ -258,6 +259,7 @@ try {
258
259
  ].join('\n'),
259
260
  },
260
261
  }));
262
+ recordMetric(DATA_DIR, { event: 'reread_warn' }); // tier-1 firing counter (②)
261
263
  }
262
264
  }
263
265
  process.exit(0); // already recalled this file in-session
@@ -388,6 +390,9 @@ try {
388
390
  if (isRead && !FILE_INTEL_OFF) {
389
391
  try { fileIntelLine = fileIntelFor(filePath, { minTokens: FILE_INTEL_MIN_TOKENS }); } catch {}
390
392
  }
393
+ // Tier-1 firing counter (①). recordMetric no-ops unless CLAUDE_MEM_METRICS=1,
394
+ // so default users pay nothing; observers see counts in `doctor` / `stats`.
395
+ if (fileIntelLine) recordMetric(DATA_DIR, { event: 'file_intel' });
391
396
  const lines = [];
392
397
  // v2.34.6: Read mode uses 120-char truncation (Edit mode keeps the 240-char
393
398
  // cap from R3-UX). Rationale: Read is a one-shot nudge with 1 lesson max;