DEV Community

Cover image for Sharing Local Memory Across Claude Code, Codex, and Cursor Without a Cloud or Hidden LLM
Romain
Romain

Posted on

Sharing Local Memory Across Claude Code, Codex, and Cursor Without a Cloud or Hidden LLM

If you use more than one AI coding assistant on the same repository — say Claude Code to implement a feature, Codex to review it, and Cursor or Gemini CLI for quick fixes — you quickly hit the same wall: each assistant lives in its own memory silo.

You settle on a technical decision with Claude in the morning. Two hours later, Codex suggests the opposite because it has no idea why you ruled that approach out. Shared Markdown files (CLAUDE.md, AGENTS.md) work for static rules, but they drift on fast-moving decisions and two sessions can silently overwrite each other's open tasks.

I built Memory OS AI (PyPI · Official MCP Registry: io.github.RoaminS/memory-os-ai · Glama) to solve this locally with four strict constraints:

  1. 100% local loopback (127.0.0.1), SQLite on disk, zero cloud, zero telemetry.
  2. No hidden LLM inside the memory layer. Your coding assistant already runs a frontier model — it extracts the structured facts and calls MCP tools directly. Zero hidden API cost, zero background hallucinations.
  3. Multi-agent state semantics. Explicit supersession (replaces), point-in-time queries (at_time), and SQLite compare-and-set (CAS) on shared tasks so two assistants cannot silently clobber each other's updates.
  4. Fail-closed, reversible ops. Dry-run preview before writing, backups of modified client configs, reproducible wheel builds, and uninstall that never deletes your stored data.

How it compares honestly

Approach Shared across providers Local-only (no cloud) No hidden LLM calls Point-in-time (at_time) & CAS tasks When to prefer it
Memory OS AI (v4) Yes (one local MCP server) Yes (SQLite on disk) Yes Yes Multi-assistant local dev; Alpha (4 retained arm64 cells today)
Shared Markdown (AGENTS.md) Yes Yes Yes Manual (git) Small repos or static conventions
Single-vendor native memory No Depends Vendor-managed Opaque You only ever use one assistant
Cloud / LLM memory layers Depends Hosted or external LLM API No Varies You need multi-device cloud sync or remote agents today

What a real Claude Code → Codex handoff looks like

We ran an isolated cross-client test against the published memory-os-ai==4.1.2 wheel on a fictitious project (pg-demo), with zero shared config between clients:

  1. Step 1 — Claude Code (fresh session) called memory_session_brief, recorded "PostgreSQL 17 for staging (pgvector compatibility)", and opened the task "Verify staging database backups".
  2. Step 2 — Codex (fresh session, with neither "postgres", "16", nor "17" anywhere in its prompt) called memory_session_brief, memory_search, and memory_task_list, and answered verbatim: > "The current decision for pg-demo staging is **PostgreSQL 17, chosen for **pgvector compatibility* … One task is open: Verify staging database backups — next action: 'Run a restore test on Friday.'"*
  3. Step 3 — Codex (same thread) ran the controlled preview → apply supersession flow to replace PostgreSQL 17 with PostgreSQL 16 (replaces) and close the task.

In the spirit of radical honesty, that real-client run also surfaced two real UX/engine rough edges we are fixing right now in 4.1.3:

  • The compact brief requires an attested local cl100k_base table (1.68 MB, MIT) on both service and relay; embedding it directly in the 4.1.3 wheel removes the tokenizer_unavailable trap on fresh installs.
  • Date-only naive strings ("2026-11-26") were parsed in local time on explicit tool arguments vs UTC when extracted from text — causing a 1-hour offset on UTC+1 machines during same-day replacements. Unifying this to UTC everywhere in 4.1.3.

Two explicit profiles: 36-package lexical vs local semantic

  • lexical (light): SQLite FTS5 / BM25, 36 locked Python packages, zero PyTorch, zero embedding model. Retained on macOS Apple Silicon (Python 3.11 / 3.12 / 3.13) and Ubuntu 24.04 arm64 (Python 3.11 under systemd --user).
  • semantic (recommended on macOS arm64 Python 3.11): hybrid BM25 + a pinned local 97M-parameter embedding model (~1.2 GB total).

(On our retrospective BEAM 100K comparison, lexical was −1.675 percentage points behind semantic on Recall@10, 95% CI [−3.747, +0.404], missing our pre-registered joint parity threshold — so semantic stays recommended where supported and lexical is clearly documented as the light profile.)


Try a 5-minute preview (writes nothing)

On macOS Apple Silicon (Python 3.11, SQLite ≥ 3.51.3):

python3.11 -m venv ~/.memory-os/venv
V=~/.memory-os/venv/bin
$V/pip install --no-deps "memory-os-ai==4.1.2"
$V/pip install -c "$($V/memory-os-constraints lexical)" "memory-os-ai[ops,brief]==4.1.2"

# Dry-run preview — writes nothing:
$V/memory-os-admin quickstart --profile lexical --clients claude-code,codex

# Apply when the preview looks right:
$V/memory-os-admin quickstart --profile lexical --clients claude-code,codex --apply --download-approved --demo
Enter fullscreen mode Exit fullscreen mode

Honest Alpha limits & what comes next

Memory OS AI 4.1.2 is Alpha and explicitly refuses platforms outside its 4 retained cells (macOS Apple Silicon + Ubuntu 24.04 arm64) before writing anything.

Coming next:

  • 4.1.3 (in progress): Linux x86_64, Docker v4, VS Code on Linux, embedded cl100k_base, unified UTC naive dates, --allow-unqualified-platform (lexical), and 1-command install.
  • 4.2.0: native Windows + public reproducible benchmark report (v4/bench/).
  • 4.3.0: opt-in Remote MCP (HTTPS + OAuth 2.1) for cloud agents & self-hosted team mode.

If you run Claude Code + Codex/Cursor on Apple Silicon or Ubuntu arm64 and want to test a 5-minute handoff — or want to vote on Linux x86_64 / Windows / Docker priorities — drop blunt feedback here:

Top comments (0)