All projectsCase 03 / 03

MemCP

Persistent memory for Claude Code, so context survives /compact and new sessions.

Overview

An MCP server that gives Claude Code an external memory. Decisions, findings and large documents are stored outside the context window, and Claude loads only what it needs, across sessions and projects. It is published on PyPI under the MIT licence.

The problem

Claude Code loses everything after /compact: earlier decisions, technical findings and conversation context. Long sessions hit the context limit and push important information out, and every new session starts from scratch.

The approach

MemCP follows the Recursive Language Model approach (arXiv:2512.24601): content stays on disk and Claude decides what to load, instead of relying on passive retrieval. Insights live in a SQLite knowledge graph linked by semantic, temporal, causal and entity edges. Search runs in tiers, from keyword and BM25 up to semantic and hybrid rank fusion, and sub-agents work through large documents in parallel. The core needs only two packages; optional extras unlock better search.

Highlights

  1. 24 MCP tools to remember, recall, search, chunk and traverse stored knowledge
  2. SQLite knowledge graph with semantic, temporal, causal and entity edges
  3. Five-tier search, from keyword and BM25 to semantic and hybrid rank fusion
  4. Hooks that save context before /compact, and secret detection on stored content
  5. 458 tests and 77 benchmarks, with CI on Python 3.10 to 3.12