
Aletheia Mem
Persistent local memory and rules for Claude Code, Codex and Cursor
Replaces —

Who it's for
If you work with Claude Code for some tasks and Codex or Cursor for others, Aletheia keeps one memory store that all of them read. You do not need to re-establish project context when switching tools. Rules written once apply everywhere once synced into each tool's instruction file.
If you use only one AI coding tool and do not switch between them, a shared store adds no value. Per-tool memory and instruction files are sufficient.
All data stays in a local SQLite file. The server listens on loopback (127.0.0.1) by default. No account or telemetry. If you want persistent context across sessions without routing any of it through external APIs or cloud services, this is the primary use case the tool is designed for.
If you are comfortable with cloud-hosted memory and do not have data-residency concerns, managed services may be simpler to set up and maintain without running a local server.
Claude Code's integration is the most thoroughly tested: hooks ran in real sessions over two days of use on one machine. aletheia install claude-code --write sets up the MCP entry, hooks and rules block in one command, with previews and backups before any write.
If claude-mem already covers your Claude Code memory needs and you do not need to share memory with other tools, migrating has limited upside at this early stage of the project.
The problem
Every AI coding tool forgets between sessions. Claude Code, Codex, Cursor, and Gemini CLI each keep their own state, and none of it carries across tools or sessions. A rule set in Claude Code does not exist in Codex. A fact surfaced in one session is invisible to every other tool the next time you open it. Developers working across more than one AI coding tool repeat the same context setup every time they switch. There is no standard way for a tool that learned something yesterday to share it with a different tool today, and no central place to write rules once and have them propagate to every instruction file in your stack.
How it works
All AI coding tools read from and write to one file at ~/.aletheia/hub.db. Any tool that speaks MCP stdio or HTTP, calls the REST API at /v1, or uses the CLI can access the same memory. The store requires no external database and no cloud account.
Write a rule once and sync it into CLAUDE.md, AGENTS.md, GEMINI.md, Cursor's .mdc rules, Windsurf's rules, Copilot instructions, and Aider files. Each target gets a managed block, so your own text is never overwritten. The sync is previewed before any write, and every changed file gets a timestamped backup.
Hooks installed via aletheia install capture SessionStart, PostToolUse, Stop and other events. Secrets and <private> blocks are removed before anything is stored. If the database is temporarily unavailable, hooks spool to disk and exit 0 so they never block the host tool. Hooks have been tested in real sessions of Claude Code (two days of use), Command Code (one short session) and Codex CLI (one interactive session), all on one machine and one user.
aletheia import claude-mem reads an existing claude-mem database in read-only mode and brings your memories across. The import is idempotent: running it twice does not duplicate entries. Aletheia runs on its own port and never writes to claude-mem's database, so both can run simultaneously.
Hooks remove secrets and <private> blocks from every entry before storage. Optional LLM features are off until you configure a provider. The server listens on loopback only; no data leaves your machine unless you explicitly turn on a model provider or share an export.
Features
- Single SQLite store over MCP, REST and CLI
- Rules sync to 9 instruction file targets
- Automatic hook capture in Claude Code, Codex and Command Code
- Import from claude-mem
- Private by default with secret redaction
How to install
Install the package with npm (Bun 1.1 or newer is required as the runtime), then start the server and connect Claude Code.
npm install -g aletheia-mem
aletheia-server
aletheia install claude-code --writeRecommended for this setup
Strengths
- Works with any tool speaking MCP or reading instruction files: Aletheia does not depend on any one AI coding tool. Any tool that speaks MCP stdio or HTTP, or that reads an instruction file, can connect to it. The README capability table shows configuration support for Claude Code, Codex, Cursor, Gemini CLI, Windsurf, OpenCode and Command Code, with verified MCP connections for Claude Code, Command Code, Codex and OpenCode as of 2026-10-27.
- Apache-2.0 with no account, no telemetry and no hosted tier: The license is Apache-2.0, which permits self-hosted use, commercial internal use, and modification without restriction. There is no managed tier, no usage fee, and no account to create. All data stays on your machine by default; data leaves only through a model provider you configure or an export you explicitly share.
- Reproducible retrieval benchmark with measured numbers: The project publishes retrieval benchmarks on the LoCoMo dataset (1,536 questions) with all result files in bench/results/ and instructions to rerun them. Hybrid search with dataset facts reaches Recall@5 of 64.8% at 5.53 ms/query on the full 1,536-question set. The measured baseline for claude-mem 15.2.0 as shipped is Recall@5 36.0% at median 1,699 ms/query. These are retrieval numbers, not answer accuracy.
Trade-offs
- New alpha project with limited real-session verification: Aletheia Mem was created on 2026-10-26 and carries alpha status in the README. Hook capture has been tested in real sessions only for Claude Code, Command Code and Codex CLI, all on one machine and one user. Cursor, Gemini CLI, Windsurf and OpenCode hooks have not run in a real session. Answer accuracy is not measured. Features may change without notice.
- Requires Bun 1.1 or newer rather than Node.js: The server and CLI run on Bun, not Node.js. Developers who do not have Bun installed need to add it before the tool will work. The npm install step works with any package manager, but the installed binaries invoke Bun at runtime; Node alone will not run them.
- Hook testing limited to one machine and one developer: All real-session hook testing was performed by the author on their own machine. The project distinguishes clearly between 'config written from docs' (Cursor, Gemini CLI, Windsurf) and 'hooks ran in real sessions' (Claude Code, Command Code, Codex). The tool has not been vetted in multi-user or multi-machine setups.
Tech stack
FAQ
No. Aletheia runs on its own port (37790) and never writes to claude-mem's database. The two run side by side. aletheia import claude-mem reads your existing claude-mem memory in read-only mode to bring it across; running the import twice does not duplicate entries. The README states that claude-mem is much larger with more features and a bigger community; Aletheia's differentiation is tool-neutrality and rules sync to multiple instruction files.
Yes. The license is Apache-2.0, there is no hosted tier, no account, and no usage fee. Optional LLM features call the model you configure locally and are off by default. The only cost is the Bun runtime and a machine to run the server on.
As of 2026-10-27, MCP connections were verified with the real CLI for Claude Code (2.1.312), Command Code (1.88.1), Codex (0.130.0) and OpenCode (1.18.33). Hooks ran in real sessions for Claude Code (two days of use), Command Code (one session) and Codex (one session), all on one machine and one user. Cursor, Gemini CLI and Windsurf are configured from documentation but have not been tested on a real install.
All data is stored in ~/.aletheia/hub.db on your machine. The server listens on loopback (127.0.0.1) by default. Data leaves only if you configure a model provider (which sends relevant context to that provider's API) or share an export bundle manually. There is no background sync or telemetry.
Aletheia Sync is a self-hosted, append-only sync server documented in the project. It supports device pairing, optional end-to-end encryption of payloads (which does not hide metadata such as device ID, operation kind or timing), and scoped tokens. The README notes that Sync has been tested on loopback only and not across two real machines. TLS is delegated to a reverse proxy; OAuth is not built in.