remem: Local-first memory for Claude Code and OpenAI Codex
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> Stop re-explaining your project every new coding-agent session.
Language: **English** | 简体中文
remem automatically captures, distills, searches, and injects engineering
memory across Claude Code and OpenAI Codex CLI sessions. Decisions,
bug-fix rationale, project patterns, and preferences stay available through
hooks, MCP, CLI, and a localhost REST API.
*A new Claude Code session recalls the earlier root cause, commit, and open
TODO with memory citations and no re-explaining.*
What remem gives you
- Automatic session capture and background LLM distillation.
- Project-scoped recall across Claude Code and Codex using one local store.
- Searchable decisions, bug fixes, architecture notes, preferences, and raw
session evidence.
- Source attribution, staleness labels, suppression, review queues, and
injection audits.
- SQLite with SQLCipher encryption by default for fresh installs.
- MCP, CLI, and authenticated localhost REST access from one Rust runtime.
remem prioritizes memory quality. Automatic capture is the primary path;
manual save_memory calls supplement it when a decision needs to be recorded
immediately.
Install in five minutes
Homebrew
Use --target claude for Claude Code. --target all configures every known
host, including Cursor where its v1 renderer is supported.
Standalone installer
npm or Cargo
Codex installation, detection, doctor, uninstall, transcript scanning and
default native-memory import all honor CODEX_HOME; the default is
~/.codex. Set it to an absolute directory before running these commands
to select another Codex profile. Empty or relative overrides fail visibly
before installation writes. Unrelated profile files stay untouched.
GitHub Releases: prebuilt binaries for macOS and Linux on x64/arm64, with
published checksums. Use one canonical remem executable on PATH;
remem doctor warns when hooks and terminals resolve different copies.
For channel-specific upgrades, platform boundaries, PATH drift, and manual
install notes, read the installation and upgrade guide.
The broader documentation guide links plugin and operational
material.
Verify the installation
Restart the selected coding agent, then run:
A healthy Claude Code or Codex installation injects relevant project memory at
SessionStart and queues durable session distillation at Stop. Codex also uses
UserPromptSubmit to capture each prompt and surface compact optional memory
candidates. remem doctor checks the schema, encryption key, database, hooks,
MCP registration, worker, and common install-path drift.
Its diagnostics do not create the data directory or write or rotate log files;
findings and stderr warnings remain visible, and existing log health is inspected.
Repository contributors can verify duplicate SessionStart suppression with the
isolated executable smoke fixture.
For a focused, read-only view of current-memory truth:
Why wasn't something remembered?
Use one read-only report to follow capture, extraction, review, current validity,
and the latest recorded context run:
Copy the exact selector from remem raw sessions --json. Use
--injection-run-id RUN_ID to inspect a specific destination context emission.
The source session and destination context run are distinct. Each evidence
source is bounded at 20 rows; omitted evidence is marked. Terminal output shows
retained source/status counts and three samples per source; --json includes
all retained evidence. A missing match or
per-item audit is **unknown**, not proof that capture failed or a guessed drop
reason. Query discovery combines raw search with literal stored-text matches;
try an original phrase or the exact session when a paraphrase finds no evidence.
See the diagnosis contract.
Remem helps an Agent continue work; Refine helps people inspect and reuse
knowledge; agent-sessions parses native source formats. Refine consumes Remem's
existing session references, content fingerprints and commit/session links
instead of collecting another transcript copy.
Host support
| Capability | Claude Code | Codex CLI | Cursor v1 |
|---|---|---|---|
| MCP memory tools | Yes | Yes | Yes on macOS/Linux |
| SessionStart injection | Yes | Yes | Not supported |
| Automatic session memory | Yes | Yes, Stop-based and low-noise | Not enabled by the v1 installer |
| Tool-event capture | Installed hooks | No high-frequency Bash hook by default | Runtime command exists; no installed hook |
| Compiled command-rule enforcement | Optional warn/block on Bash | Not supported | Not supported |