← Reports

Claude Code Memory Solutions

Research report for Luci's persistent memory architecture • 7 April 2026

The Problem

Why Luci keeps forgetting what she did.

Main session has memory, workers don't

Luci runs as a persistent Claude Code session with markdown memory files loaded into context. When MC tickets come in, worker sessions are spawned via mc_pickup.py. These workers complete tasks (build features, fix bugs) but never write back to the memory folder. The main session has no idea what was done.

Flat files don't scale

18 markdown files loaded into context at startup. No search capability — everything goes into the context window. As memory grows, this eats tokens. No way to query "what did I do on MC-221?" without loading everything.

Session restarts lose context

When Claude restarts (crash, update, session prune), only the markdown files survive. Conversation context is lost. The resumed session starts with a thin memory of who Elmar is and what's running, but no recall of recent work.

What We Already Have

vault.db is more capable than most off-the-shelf memory solutions.

20+
Database Tables
FTS5
Full-Text Search
WAL
Concurrent Access
18
Memory Files
TablePurposeStatus
activity_logWhat Luci did and whenActive
tickets / ticket_commentsMC ticket history with full conversationActive
sessionsSession registry across all Claude instancesActive
task_runsScheduler execution historyActive
files / edges / tagsFile index with relationshipsActive
search_ftsFull-text search index (FTS5)Active
heartbeatsHealth monitoringActive
memories (proposed)Structured memory store for decisions, preferences, contextMissing

Solutions Evaluated

8 tools researched. Ranked by fit for our scenario.

1. Extend vault.db with MCP Wrapper RECOMMENDED

Custom build • ~200 lines Python • Zero new dependencies

Build a thin HTTP API that wraps vault.db with memory_save, memory_search, memory_context, and session_log tools. Run on localhost. All sessions (main + workers) get memory access via MCP or HTTP.

Why: We already have the database. We just need to expose it. No new infrastructure, no learning curve, perfect fit.

2. Engram BEST OFF-THE-SHELF

GitHub • 2,305 stars • Go binary • SQLite + FTS5

Single binary, no dependencies. MCP server + HTTP API + CLI + TUI. Session tracking, project scoping, git sync between machines. Multi-session via HTTP API on port 7437.

Best for: If we want a polished, maintained tool without building from scratch. Could run alongside vault.db — engram for unstructured memory, vault.db for structured data.

3. Instar STUDY PATTERNS

GitHub • 52 stars • Node.js/TypeScript

Almost identical to Luci's architecture: persistent Claude Code, Telegram integration, scheduler, per-topic sessions. Rolling summaries, context re-injection, cross-platform sync.

Don't adopt: It wants to own the whole lifecycle. But read its architecture for the rolling summary + context re-injection pattern.

4. claude-mem-lite

GitHub • 30 stars • Node.js • SQLite + FTS5

Lightweight (~50KB). Auto-capture via hooks. Hybrid search (FTS5 + TF-IDF). Token-budgeted context (2000 token knapsack). Secret scrubbing. But single-session only — no HTTP API for workers.

5. Awareness Local

GitHub • 99 stars • Node.js daemon

HTTP daemon on port 37800. Progressive disclosure (summary first, full on demand). Knowledge cards. Web dashboard. Multi-session via HTTP. But wants its own directory structure.

6. Memorix

GitHub • 354 stars • Node.js

Git memory (commits as searchable history). Reasoning memory (stores WHY). HTTP control plane. More oriented toward coding decisions than operational memory.

7. mem0-mcp-selfhosted SKIP

GitHub • 62 stars • Python + Qdrant + Ollama

Semantic vector search. Powerful but heavy — needs Qdrant (~2GB RAM) + Ollama for embeddings. Overkill when FTS5 covers 90% of search needs.

8. CAS (Coding Agent System) SKIP

GitHub • 70 stars • Rust

Built for multi-agent orchestration with shared DB. 50+ MCP tools. But overlaps heavily with our existing ticket system — would mean migrating or running in parallel.

Comparison Matrix

SolutionMulti-SessionHTTP APISQLiteFTS5MCP ServerHooksComplexity
vault.db wrapperYesYesYesYesYesAddLow (~200 LOC)
EngramYesYesYesYesYesNoLow (single binary)
InstarYesInternalYesYesNoYesHigh (full framework)
claude-mem-liteNoNoYesYesYesYesLow
Awareness LocalYesYesYesYesYesNoMedium
MemorixYesYesNoNoYesNoMedium
mem0 selfhostedPartialNoNoNoYesYesHigh (Qdrant+Ollama)
CASYesNoYesYesYesNoHigh (replaces infra)

The Pattern That Works

Every top-performing memory system shares these 5 components.

1
SQLite + FTS5
We have this
2
MCP Tools
Need this
3
HTTP API
Need this
4
Auto-Capture Hooks
Need this
5
Progressive Disclosure
Need this

What each piece does

SQLite + FTS5: Fast, reliable storage with full-text search. No server needed. Concurrent reads via WAL mode.

MCP Tools: Claude queries memory on demand ("what did I do on MC-221?") instead of loading everything at startup. Saves tokens.

HTTP API: Worker sessions, scheduled tasks, and external scripts can all read/write the same memory store. Solves the multi-session problem.

Auto-Capture Hooks: SessionStart injects relevant context. Stop/PostToolUse auto-saves decisions and outcomes. No manual memory management.

Progressive Disclosure: Return summaries first (50 tokens), full content only when asked (500 tokens). Keeps context window lean.

Recommendation

Phase 1: Wrap vault.db (this week)

Add a memories table to vault.db. Build a Python HTTP server (~200 lines) with MCP tools: memory_save, memory_search, memory_context, session_log. Run on localhost. Configure in Claude Code's MCP settings. Worker sessions automatically get memory access.

Phase 2: Add hooks (next week)

Claude Code hooks for SessionStart (inject relevant memories), Stop (auto-save session summary), PostToolUse (capture significant actions). This makes memory capture automatic instead of manual.

Phase 3: Consider Engram (if needed)

If vault.db wrapper isn't enough, add Engram alongside it. Single Go binary, zero dependencies. Use for unstructured memory and cross-machine sync (Luci <-> Lucienne). Keep vault.db for structured data.