Skip to content

Persistent memory for Claude Code and Codex

# Stop re-explaining your project every new session.

A single Rust binary that automatically captures, distills, and injects project context across sessions: decisions, patterns, preferences, and learnings.

Get started
View on GitHub

- Single Rust binary
- Localhost only
- SQLCipher at rest
- MIT licensed

claude - remem

$ remem install --target all

ok Claude Code hooks configured

ok Codex MCP server registered

$ claude

SessionStart

decision use host-specific context commands

preference keep remem minimal and auditable

bugfix preserve root cause before patching

context restored

The problem

## Every new session starts from zero.

Context you spent hours building disappears the moment the thread ends.

01

### Session amnesia

Each new Claude Code or Codex session starts without the context you already earned.

02

### Lost rationale

Design decisions and bug-fix root causes vanish when the session ends.

03

### Preference fatigue

The same project preferences get repeated instead of carried forward.

04

### No continuity

Long-running work is hard to resume with confidence after context compaction or a fresh session.

How it works

## Hooks into your agents. Nothing to capture by hand.

remem records raw session evidence, distills it in the background, then serves compact memory back through hooks and MCP.

Claude Code SessionStart

Inject relevant project memory and preferences.

Claude Code UserPromptSubmit

Register sessions and flush stale queues.

Claude Code PostToolUse

Queue tool observations without blocking the workflow.

Claude Code / Codex Stop

Summarize and promote durable memories in the background.

Search architecture

## Four retrieval channels, fused.

A query is routed through BM25, entities, temporal parsing, and LIKE fallback, then merged with Reciprocal Rank Fusion.

- Project-scoped search prevents cross-project leakage.
- CJK segmentation and Chinese-English synonym expansion improve recall.
- Title-weighted BM25 and topic-key dedup keep results compact.

"database encryption"
FTS5 BM25 Entity index Temporal LIKE fallback
RRF = sum 1 / (60 + rank)
Top-K merged memories

Product proof

## The memory arrives before the work begins.

The site ships with the repository's existing terminal demo asset, so the first release uses real project media instead of stock visuals.

Terminal demo from the remem repository assets.

Benchmarks

## Measured, not hand-waved.

Published README snapshots cover LoCoMo, internal retrieval, and local QA evaluation.

LoCoMo overall 62.7%

v2 optimized, session summary ingest, gpt-5.4.

MRR 0.858

Internal eval over 1,777 real memories.

Hit Rate@5 1.000

Internal retrieval hit rate.

Project leak 0%

Project-scoped search validation.

Usage & cost

## Measured locally, reported as estimates.

remem records AI usage for its own background extraction, summaries, compression, and promotion calls. The CLI reports token usage and estimated USD cost by day, week, source, project, and executor.

- Provider/log usage is separated from text-estimated fallback rows.
- Cost is an estimate, not a provider invoice or subscription bill.
- Executor and model selection live in ~/.remem/config.toml.
- The local audit below is a snapshot from 2026-06-06; usage varies by workload.

remem usage --days 14 --weeks 8
Daily and weekly totals Project-scoped reports Usage source precision Estimated USD cost
provider/log rows stay separate from estimates
cost estimate, not invoice
Project ledger share 0.04%

This repository's remem ledger was $6.18 against $17,595.10 of total agent spend.

Full remem ledger share 2.48%

All remem background memory calls across projects were $437.15 in the same window.

Project ledger cost $6.18

Estimated background memory cost for this repository over 8 weeks.

Total agent spend $17.6k

ccstats all-source spend over the same 2026-04-12 to 2026-06-06 window.

Install

## Use the same commands as the README.

Start with Homebrew, the prebuilt GitHub Release installer, or Cargo. Then restart your coding agent.

    curl -fsSL https://raw.githubusercontent.com/majiayu000/remem/main/install.sh | sh

### Secure by default

- SQLCipher encryption at rest.
- Data directory 0700 and key file 0600.
- REST API binds to 127.0.0.1 and requires a local token.
- Uninstall removes hooks and MCP config without deleting memory data.

## Give Claude Code and Codex a memory.

Single binary. Local store. Durable context for long-running engineering work.

Install remem Read the docs