Releases: catfish-1234/sessionmem
Releases · catfish-1234/sessionmem
Release list
v1.1.2
What's new since v1.0.6
Features
- Session lifecycle hooks (session-start / session-end): Claude Code auto-injects memories at start, summarizes on end via ~/.claude/settings.json hooks
- Generic MCP adapter base class; existing adapters refactored onto it
- projectId derivation: basename + SHA-256(normalized path).slice(0,8), Windows/UNC normalization, SESSIONMEM_PROJECT_ID env override
- injectionCap config key: sessionmem config set injectionCap <100-10000>
- listMemories pagination: optional limit (default 200, max 1000), response includes total
- Lossless export/import: exportMemories/getMemory/storeMemory return full content, no 2000-char truncation
- ingestSessionEvents dedup: INSERT OR IGNORE + unique index (migration 009)
- FTS5 recency filter fix: corrected datetime format mismatch
- Re-embed on redact: redactExisting re-embeds after content scrub
- Atomic policy config writes: temp-file + renameSync
- Error hardening: fs paths no longer leaked to MCP clients
- Startup injection sanitization: control chars stripped, kind validated against allow-list
- Extended redaction: Stripe live keys and npm tokens, bounded quantifiers (no ReDoS)
Security hardening (21-round audit)
- sessionId/memoryId/originProjectId capped at 200 chars
- ingestSessionEvents array capped at 500 events
- sourceAdapter validated against control-char regex
- fetch_memories query bounded min(1)/max(1000)
- Semgrep path-traversal false positives suppressed inline
CI / deps
- actions/checkout v7, actions/setup-node v6, typescript-eslint 8.61.1
- workflow_dispatch with OTP input for npm 2FA
- Trivy v0.36.0
Tests
- 449 tests, 85 test files (+13 new)
- Integration: Claude Code hook install/uninstall, FTS fallback union
- Unit: session-start/end, projectId, ingestSessionEvents cap+idempotency, listMemories pagination, full-content export round-trip, Stripe/npm redaction
Upgrade
npm install -g sessionmem@1.1.2
sessionmem install claude-code # re-run to add session hooks
v1.0.6- Major Bug Fixes and Optimization
What's Changed
Bug Fixes (22 issues)
Core Engine & Retrieval
- Replace word-split
countTokenswith shared BPE tokenizer fromtokenBudget.ts - Add WAL mode + performance pragmas (
busy_timeout,cache_size) toopenDb - Replace 4-band step-function recency scoring with smooth exponential decay (14-day half-life)
- Add
MAX_SEMANTIC_CANDIDATES=2000limit tosearchMemoryCandidates - Wire unused
decayOldBoostsinto retrieval pipeline before scoring - Add embedding version mismatch awareness — stale embeddings get neutral 0.5 score; added
sessionmem re-embedCLI command
Summarization & Cloud
- Implement real cloud summarization via Anthropic SDK (was a non-functional stub)
- Default model set to
claude-sonnet-4-6, centralized inpolicyConfig.ts - Record cloud summarizer failures in
summarization_failurestable before local fallback (was silently swallowed)
Code Quality
- Extract magic numbers to
policyConfig.ts(MIN_IMPORTANCE,MAX_IMPORTANCE,CRITICAL_WARNING_IMPORTANCE_THRESHOLD,DEEP_MODE_RETRIEVAL_CAP) - Add per-session write soft limit (
SESSION_WRITE_SOFT_LIMIT=50) with warning inwarningCodes - Record
manual_deletefeedback inmemory_feedbacktable onforgetMemory - Fix stale CLI output tests — add missing fields, correct column index, export
MemoryTableRow
CI/CD & Distribution
- Fix GitHub Actions versions (
checkout@v4,setup-node@v5) across all workflows - Replace hardcoded
.mcp.jsonwith portable.mcp.json.exampleusingnpx - Delete duplicate
publish.ymlworkflow — onlyrelease.ymlpublishes now - Pin
trivy-actiontov0.28.0(was unpinned@master) - Sync all manifest versions + add
postversionnpm hook for automatic syncing - Dockerfile: pin package version
@1.0.6, add non-rootsessionmemuser
Adapter & CLI
- Expand startup log with db path, project ID; stderr debug output gated by
SESSIONMEM_DEBUG=1 - Wire fallback tools (
fetch_memories,startup_inject_memories) into MCP server with real execute bodies
Performance Optimizations
- Statement caching — WeakMap-based prepared statement caching across all 6 storage repo files. Each SQL statement compiled once per DB lifetime, not once per call.
- Batch store —
batchStoreMemorywraps multiple inserts in single SQLite transaction. Registered asbatchStoreMemoriesMCP tool. ~10x faster for session-end writes. - SQL pre-filter — Candidate loading now filters at SQL level: keeps
importance >= 8ORupdated_atwithin 90 days. Excludes stale low-signal memories before cosine similarity. - FTS5 pre-filtering — Full-text search narrows candidates to ~50 FTS matches before cosine similarity computation. Falls back to full scan when keyword overlap is poor.
Stats
- Tests: 370 passing across 72 files
- New migrations: 007 (feedback manual_delete), 008 (FTS5 search)
- New dependency:
@anthropic-ai/sdk(cloud summarization)
Full Changelog: v1.0.0...v1.0.6
v1.0.0 — Initial release
sessionmem v1.0.0
First public release of sessionmem — a local-first MCP memory layer that gives your AI coding assistant a persistent memory across sessions, stored entirely on your own computer.
What's included
- Session memory — automatically captures what happens in your coding sessions and summarizes the important parts (decisions, warnings, key facts)
-
- Cross-tool support — works with Claude Code, Cursor, Codex, Cline, Windsurf, Antigravity, QCoder, and any other MCP-compatible host
-
- Privacy-first — everything stored in a single SQLite file on your machine; no account, no cloud, no telemetry
-
- Secret redaction — API keys, tokens, and passwords are scrubbed before anything is saved (on by default)
-
- Token-budgeted injection — memories are trimmed to ~230 tokens so they don't bloat your context (85.6% reduction vs. carrying full history)
-
- Retention pruning — stale memories are automatically cleaned up to prevent "memory rot"
-
- Team mode — optional shared-path team memory via a folder you already control
-
- Cloud summarization — optional opt-in via Anthropic API for higher-quality summaries
-
- Full CLI —
install,search,list,forget,export,import,stats,redact-scan, and more
- Full CLI —
Quickstart
npm install -g sessionmem
sessionmem install # register with your AI toolSee the README for full documentation.
Benchmark highlights
| Metric | Result |
|---|---|
| Token reduction | ~85.6% |
| Retrieval hit-rate | 100% |
| Recall | 100% |