All integration guidesClaude Code · Codex

One local memory store for Claude Code and Codex

Point Claude Code and Codex at one Heartwood file with signed sources. Both start read-only; if a custody root is used, both need that root and key ID.

What you get

One SQLite file on your machine that both Claude Code and Codex read through Heartwood’s local MCP server. Each client gets its own identity in the same tenant, and each starts with the read-only tools recall, explain_recall and health. Once any server opens the store with a custody root, every server that opens it — including read-only ones — needs the same root and key ID to read memories written with it. A memory that one client recalls carries its author, its source IDs and a signature check, so you can see where an answer came from.

Claude Code and Codex each have memory features of their own. Heartwood adds a separate store that both can share; it does not replace or switch off theirs.

Before you start

• Python 3.11 or newer, and uv for the one-line setup. • An absolute file path for the store. With no path set, the MCP server keeps memory in RAM, and it is gone when the server stops. • If either client will write: one custody root and its key ID, kept in your own secret store and given to both clients (including a read-only one).

Set up both clients

This creates the store folder, then registers Heartwood with Claude Code (for your user) and with Codex, both pointing at the same file.

bash
DB="${XDG_DATA_HOME:-$HOME/.local/share}/heartwood/heartwood.db"
mkdir -p "$(dirname "$DB")"
claude mcp add --scope user --env HEARTWOOD_DB_PATH="$DB" \
  --env HEARTWOOD_TENANT=tenant:ops --env HEARTWOOD_MCP_PRINCIPAL_ID=agent:claude-code \
  --env HEARTWOOD_MCP_ALLOWED_TOOLS=recall,explain_recall,health \
  --transport stdio heartwood -- uvx heartwood-memory
codex mcp add heartwood --env HEARTWOOD_DB_PATH="$DB" \
  --env HEARTWOOD_TENANT=tenant:ops --env HEARTWOOD_MCP_PRINCIPAL_ID=agent:codex \
  --env HEARTWOOD_MCP_ALLOWED_TOOLS=recall,explain_recall,health \
  -- uvx heartwood-memory

Check it

In each client, list the MCP servers and confirm that Heartwood exposes exactly recall, explain_recall and health. Both clients start read-only on the same file — before any server uses a custody root, both read it directly; once any server opens the store with a custody root, both need that same root and key ID. A new store is empty, so recall returns nothing until something is written to it.

Adding writes or erasure

remember and forget are added only when you name them in HEARTWOOD_MCP_ALLOWED_TOOLS. If any server on the store uses remember, give every server that opens it — including read-only ones — the same custody root and the same key ID. Without the root, a writer cannot write again after a restart and a reader sees none of the memories written with it; with a different key ID, recall fails with an error. Decide before the first write: once any server with a root has opened the store, every server that opens it needs that root and key ID. See docs/security/multi-agent-identity.md in the source-available core. From 0.2.10 the server takes its tenant and principal from its own configuration, and a tool call that tries to send a different tenant or principal is rejected. With remember enabled, pass supersedes to retire the memories a write replaces.

Limits

MCP runs over local stdio on one machine. Hosted MCP isn’t available. Nothing is captured automatically: the store holds only what you or an agent write to it, or what you import.

License and plans

The core is source-available under BSL 1.1, not OSI open source. It is free for non-production use at any size, and free in production for small organizations as the license defines them. For hosted recall, Team and Professional are on the pricing page at /pricing.

Questions

Can Claude Code and Codex share one local store?

Yes, when both are configured with the same absolute file path for the store — and, if any server on the store uses a custody root, the same custody root and key ID (including on read-only servers). The setup on this page gives each client its own identity in one tenant and starts both read-only, with recall, explain_recall and health. Writes and erasure are added only when you name those tools. MCP runs over local stdio on one machine; hosted MCP isn't available. Remember what you ruled out across AI tools.

Does Heartwood turn off Claude Code’s or Codex’s own memory?

No. Each client keeps its own memory features. Heartwood is a separate store that both can share — using the same file path, and the same custody root and key ID whenever any server on the store uses one. Make a correction stick in agent memory.

Adapted from docs/integrations (mcp-quickstart, codex-quickstart) in the source-available core.