What this is
Unified memory for multiple coding agents — one private local hub shared across environments. Currently supports Cursor and Claude Code. Not RAG, not a vector DB, not a notes app: a continuity system that turns chat sessions into durable project state.
Problem
Coding agents start every session blank. Repo rules help inside one project, but nothing carries cross-project conventions, rejected approaches, distilled history, or where work actually stopped — and once you use more than one agent tool, each silo forgets the other. Dumping everything into context is slow, expensive, and leaks secrets.
What I built
A portable MIT framework (public skills, scripts, hooks) plus a private hub outside the plugin bundle (default ~/.agent-memory/). Both Cursor and Claude write the same files under a shared lock. Routed layers, loaded INDEX-first — never the whole store:
- Global context — who, projects, rules, infra
- Preferences — how the user thinks and communicates
- Feedback — what worked (+) and what to stop proposing (−)
- Chat distill — per-project ## Decisions, ## Recent, merge-staging
- Forward pointer — ## Open threads (rolling 30-day, cross-hub): where each active direction stopped.
## Next stepwas retired in v0.29+
Env protocol: Cursor uses a launchd job every 30 minutes (hooks were dropped by Cursor in June 2026) plus an alwaysApply routing rule; Claude Code uses real hooks (SessionStart, UserPromptSubmit, Stop, PreCompact, SessionEnd) so memory survives compaction and hard kills. Secrets are redacted on every distill; push-time leak checks block personal names from leaving the machine.
Onboarding
One skill, either environment. Install order does not matter — the second tool inherits the existing hub through its anchor.
Claude Code: /plugin marketplace add raphael-batte/unified-agent-memory → /plugin install agent-memory (hooks ship with the plugin).
Cursor: clone the repo → bash scripts/install-local.sh → bash scripts/install-periodic-sync.sh → reload window. In chat: @agent-memory → set up agent memory / sync with agent memory.
That sync pass scans transcripts from installed environments, redacts secrets, batch-distills pending chats, seeds Recent / Open threads, and bootstraps global context. No MCP server, no manual jsonl import. Second machine: same hub path + re-link (ONBOARDING.md).
Session lifecycle
Claude: hooks on stop / preCompact / session end distill into the shared hub; session start and prompt submit inject Open threads.
Cursor: periodic sync (30m while Cursor is open) catches up transcripts; routing rule forces every chat to read the rolling Open-threads pointer first.
Next session → match the user’s topic to an Open threads **[label]** → Decisions / Recent → drill [title](uuid) in Recent if the thread is thin. Distill may draft [auto] threads; curated threads are never overwritten. ## Decisions stay agent-curated via the semantic-merge skill — scripts do bookkeeping; the LLM does meaning.
Key engineering decisions
- One hub, many agents. Env-agnostic distill/search; per-environment adapters only for triggers and pointer delivery.
- Public framework vs private data. MIT repo for skills/scripts; personal hub never committed. Anchors point at the hub and survive plugin updates.
- Open threads as the only forward pointer (v0.29+) — rolling 30d union across the whole hub, not a single Next-step line and not per-repo handoff files.
- Mechanical vs semantic. Scripts: manifest, staging, rotation, secret-scan, leak gate. Agent + semantic-merge: curated Decisions and Open threads.
- Defense in depth for secrets. Regex at ingest, hub verify (regex + gitleaks), pre-commit / pre-push leak checks with a runtime denylist derived from the hub (never a personal-name list in git).
- Pluggable transcript adapters. Cursor + Claude parsers normalize onto the same pipeline.
- Markdown + routing over vectors. Portable, diff-able, multi-machine — intentional trade-off for personal-scale continuity.
Engineering practices
SemVer with pre-commit bump enforcement; 400+ automated tests (parsers, merge, hooks, env protocol, secrets, leak gate); GitHub Actions CI (tests + gitleaks + CodeQL); typed Python; hub-overridable configuration.
Outcome
A maintained end-to-end system — multi-agent transcript ingestion through one curated hub — with architecture, limitations, and migration paths documented for humans (ARCHITECTURE.md) and agents (INSTRUCTIONS.md).
Stack
Python 3.12, Bash, GitHub Actions, gitleaks, Cursor skills/rules + launchd sync, Claude Code plugin hooks.

