How to share one memory between Claude Code, Codex and other AI agents
Last updated
To share memory between AI agents, connect each one to the same MCP memory server and sign in to the same account. Each agent then saves to and searches the same memories, so a decision recorded in a Claude Code session is found by Codex or ChatGPT the next day. With Memlo, every agent uses the server https://memlo.ai/mcp.
Why agents drift apart
Each coding agent has its own way to remember. Claude Code reads CLAUDE.md and keeps auto memory on your computer. Codex reads AGENTS.md. Chat apps keep their own memory inside their own service. Ask the same question in three of them and you can get three answers, because each one only knows what it was told.
Copying the same notes into every tool's file works for a few rules. It breaks down when the notes change: one copy gets updated and the others don't.
One memory for every agent
Connect each agent to the same server and sign in with the same Memlo account:
- Claude Code:
claude mcp add --transport http --scope user memlo https://memlo.ai/mcp, then/mcpto sign in. Full steps. - Codex:
codex mcp add memlo --url https://memlo.ai/mcp. Full steps. - claude.ai, Claude Desktop, ChatGPT, Gemini and VS Code: add
https://memlo.ai/mcpas a custom connector or MCP server. Full steps.
Each app signs in separately, and each one shows up in Memlo as its own connected app. You can disconnect one without touching the others, under Account settings, then Connected apps.
Give every agent the same starting point
Agents share memory best when they all begin a session the same way. Have each one call get_prime_directive first. It returns how to use Memlo and your space's prime_memory: what the space is for, its key memories and a table of contents. In Claude Code, a SessionStart hook does this automatically; in Codex, one line in ~/.codex/AGENTS.md does it; in chat apps, put the sentence in the app's custom instructions.
Keep it organized with spaces
Memories live in spaces. Your personal space is the default. You can make other spaces for a project or a team, and agents pick one with the space setting on each tool.
list_spacesshows every space you can use and how many memories each holds.routed_searchsearches all your spaces in one call and says which space each result came from.- Folders inside a space group related memories;
file_memorymoves memories into one without changing their text.
Share with people, not only agents
The owner of a space can share it, or a single page, with other people by email as a Viewer or an Editor, or with anyone who has the link. Their agents can then search what you shared. Searches include spaces shared with you when you ask for them (include_shared) or when your search setting says so, and removing a share takes effect on the next request.
Avoid the usual problems
- Duplicates. Have agents search before they save, and edit an existing memory instead of adding a near copy.
- Stale facts. Retire a memory that is out of date instead of deleting it; it stays readable with its history, and
unretire_memorybrings it back. - The wrong space. Run
whoamiandlist_spaceswhen a memory seems to be missing, and passspacewith the right name. - Secrets. Never save passwords, API keys or tokens. Save where a secret lives instead.
Frequently asked questions
Can Claude Code and Codex share the same memory?
Yes. Connect both to https://memlo.ai/mcp and sign in to the same Memlo account. A memory saved from one is found by the other.
Does Memlo work with Cursor?
Not yet. Cursor's MCP sign-in returns to a cursor:// address, and Memlo's sign-in accepts only callback addresses on your own computer (loopback) or known https addresses. Cursor's sign-in therefore stops with an error today.
Can I see which agent saved a memory?
Yes. The Memlo app shows where each memory came from, such as Claude Code, Codex or another connected app, and you can filter memories by that source.
Does sharing a space share my whole account?
No. Sharing covers the space or the page you choose. Your other spaces stay private.
Try Memlo
Memlo is invitation only for now. Join the waitlist and we'll email you when your invitation is ready.
Join the waitlist