← All articles

Can Claude Code and Codex read the same memory source in fresh sessions?

A local test of Claude Code and Codex found saved memory sources in fresh sessions, with empty wrong-project controls.

By: Cairn team

Updated:

Tested:

Published:

In a local preview started from the cairn-memory source code, we tested whether Claude Code and Codex could read a saved memory source across fresh sessions: both directions returned the expected project-scoped source through explicit MCP calls, while both wrong-project controls returned empty lists.

What did we run with Claude Code and Codex?

The test took place on 2026-11-08, using Claude Code 2.1.319 and Codex 0.166.0. We pinned the local MCP server to ad274b6, the full commit ad274b6117f86446fbf0ff16f503ae69d0278ce5. We used a fresh synthetic database and records assigned to a particular project. Each record contained a harmless made-up preference, with an expected value that we could compare against the returned source.

For today's installation, the current path is the 0.6.5 release: run the installer below and follow the Claude Code and Codex sharing guide. The release installer README describes Cloud for automatic sharing after sign-in and Local for explicit tools on one computer without an account. The experiment below records the earlier pinned source setup.

npx @cairn-ink/memory setup

Our test asked a specific question about saved evidence. A Memory is private context owned by its user. A Source Receipt is the accompanying source record that helps explain why that Memory exists. We wanted the second client to return the matching source after the first client's session had ended. The Memory Scope, meaning where the Memory may be recalled, was set to the project being tested.

We kept the expected preference out of the receiving client's prompts and working directory. That separation matters when checking continuity: the receiving client should obtain the value from the store being tested. Giving it the value in the question would make the result hard to interpret. Starting a fresh receiving session also made the session transition an explicit part of the check.

What happened when we switched clients?

First, Claude Code saved one synthetic preference through an explicit MCP tool call. We ended that session, opened a new Codex session and requested the matching source. Codex returned the expected source. We then used a separate fixture for the reverse direction: Codex saved it, its session ended, and a fresh Claude Code session returned the expected source.

The read operation was read_memory_sources. In this pinned setup, it lists retained sources within the local server's configured scope. That gives us something concrete to compare: which source came back, what it contained and whether it belonged to the project we configured. The pinned standalone MCP guide describes this tool and its source-list behavior.

We also ran a control for each direction. We reused that direction's successful project-scoped fixture, then configured the server with another project ID that already existed in the test setup. A project ID is simply the identifier the local server uses to select the project; the identifier itself carries no readable project description. Both of these wrong-project reads returned empty source lists.

Reusing the successful fixture made the comparison useful. The source had already been read through the intended project setting. With the alternate setting, it disappeared from the returned list. We therefore had a positive result and a matching empty control for each direction, rather than an empty list from a database that might never have contained the fixture.

The receiving prompts and directories contained none of the expected values. We made no hosted Cairn write and created no shared Knowledge Card. A Knowledge Card is a separate document for shared knowledge, and sharing it requires a separate human decision. The native clients used existing subscriptions while the memory database remained local.

How can I repeat the check safely?

Use a disposable local environment with a fresh synthetic database. Choose your own database path, local owner identifier and two existing project identifiers. Keep the test records harmless and separate from real personal notes. Follow the startup settings in the pinned MCP guide when reproducing this particular source version.

  1. Pin the source commit above and start the local preview against the new database. Record the database, owner and intended project settings privately so you can compare the two clients' configuration.
  2. In client A, explicitly save one made-up preference in project scope. Keep a separate record of its expected value and returned source information. Put that record outside client B's prompt, repository, working directory and session history.
  3. End client A's session. Start a new process or session in client B and explicitly call read_memory_sources. Compare the returned source and Source Receipt with the record you kept.
  4. Reuse that same positive fixture for the wrong-project control. Configure the local server with the other existing project ID, make the source-list request and record whether the list is empty.
  5. Use a different synthetic fixture for the reverse direction. Repeat the save, session change, read and wrong-project control, preserving the outcome for each direction separately.

Record the client versions, pinned commit, scope, tool calls and returned results together. Name the read operation in the record so a later reader can tell which behavior was exercised. For an additional inspection in your own run, label that as an added step; our cross-client result used the source-list read.

The pinned local store contract explains the stored source and scope fields. Use those fields when comparing evidence, and review the current project decision separately before acting on an old preference.

What does this test leave open?

These explicit source-list reads did not test semantic matching, answer generation, automatic capture or automatic retrieval. Hosted same-account access remains untested, and the local owner and project launch settings are not hosted account authentication. A Source Receipt explains origin rather than proving correctness or current applicability. The native subscriptions also mean that a local database did not make this an offline run.

To connect your own tools, follow the connection guide.

Sources