← Practical guides to AI coding memory

Guides

How can Claude Code and Cursor share memory across tools?

Use shared instruction files or a shared MCP memory server, then verify the same saved context from a fresh Claude Code or Cursor session.

By: Cairn

Updated:

Published:

Claude Code and Cursor can share project rules through repository files and private context through a hosted memory service. For Cairn.ink Memory, use the Cloud installer for Claude Code and connect Cursor through hosted MCP with the same account. Claude Code gets automatic capture and prompt recall; Cursor uses explicit memory tools. Verify retrieval in a fresh Cursor conversation.

What do the tools already remember on their own?

Claude Code provides instruction files and auto memory. Cursor provides project, user and team rules, plus support for a plain Markdown instruction file. These are useful native options: you do not need another service just to tell both assistants how to run tests.

Choose a shared source and configure each client to read it. Native rules remain useful for tool-specific behavior, while a common file or memory store carries context that both assistants need. The Claude Code memory documentation and Cursor rules documentation describe their respective native mechanisms; both were accessed on 2026-11-12.

For a project convention, choose one file that people maintain with the code. For private context, choose a store with the account and access boundary you intend. Neither approach requires copying a whole conversation into every new prompt.

Can both clients use the same instruction file?

Yes. A practical starting point is a repository-root file: AGENTS.md

For example, its content might be:

Run the existing focused test before proposing a broad refactor.
Read package.json before choosing a package manager command.

These example rules tell the assistant how to choose the project's actual test and package-manager commands. Cursor documents this filename as a simple alternative to its richer project rules. Claude Code's direct support depends on its version and which instruction files are already present. To make the relationship explicit, an adjacent Claude instruction file can import it: CLAUDE.md

@AGENTS.md

Merge the import into an existing file rather than replacing established instructions. Ask each assistant to identify the loaded rule and explain how it applies before changing code. If one tool has a more specific rule, resolve the conflict in the files instead of assuming that both tools use identical precedence.

Shared files are especially effective for build commands, contribution standards and architecture references. Keep private personal information out of a committed repository. Files are less convenient for a growing set of individual preferences that you want to retrieve selectively across unrelated projects.

When is a shared MCP server a better fit?

MCP, the Model Context Protocol, lets an assistant call tools exposed by another program or service. A memory server can give both clients access to one saved record instead of two manually maintained copies. The server's storage and permissions determine what is shared; MCP itself does not synchronize unrelated stores.

Cairn.ink Memory is one option for private context with a Source Receipt. A Memory is a private, user-owned preference, decision or other useful context. A Source Receipt provides the source excerpt and client metadata. A Knowledge Card has a separate review and publication process for durable knowledge.

Other reasonable choices include the MCP reference memory server for a local knowledge graph, and Basic Memory for a file-oriented knowledge base. Compare storage and control needs before installing. The setup below connects both clients to Cairn.ink Memory: automatic integration for Claude Code and explicit hosted tools for Cursor.

How do I connect Claude Code and Cursor?

For Claude Code, use the Cloud installer. It requires Node 22.16 or later and the selected CLI on your path:

npx @cairn-ink/memory setup --cloud
npx @cairn-ink/memory status

Approve the Claude Code connection and complete the displayed browser sign-in to cairn.ink. If the installer also finds Codex, choose whether to connect it; when pairing them, close both tools and wait for background work before confirming. Reopen Claude Code after setup. Its integration provides automatic capture and prompt recall, plus explicit MCP tools for the verification below.

For Cursor, use the hosted MCP connection shown in the website's connection guide. The installer covers Claude Code and Codex; configure Cursor separately. MCP, the Model Context Protocol, gives the assistant tools to call against the service.

Edit ~/.cursor/mcp.json for your user-level connection, preserving existing servers. Add this configuration:

{
  "mcpServers": {
    "cairn": {
      "type": "http",
      "url": "https://cairn.ink/api/mcp"
    }
  }
}

For a project-only connection, use .cursor/mcp.json instead. Open Cursor's Customize page, enable the server and complete browser OAuth with the same cairn.ink account used by Claude Code. OAuth authorizes the client through the browser. Confirm that the memory tools are available, then use them to save or retrieve context explicitly.

The configuration locations and management surface follow Cursor's MCP documentation, accessed 2026-11-12. Claude Code's MCP reference, accessed the same day, explains its server panel. Use /mcp there to inspect its connection. The two clients can now reach the same hosted account even though their capture behavior differs.

Cloud conversations are saved after best-effort local masking, and Claude Code's prompt recall sends a masked, length-limited prompt copy. Review the privacy controls before using automatic capture. Cursor's explicit MCP connection saves context through tool calls; it does not enable the installer's automatic integration in Cursor.

How do I check retrieval from the other tool?

Use a harmless synthetic preference. In Claude Code, ask:

Use remember_memory to save this in personal scope:
For the fictional Juniper demo, I prefer short review summaries.
Show the returned Memory ID and Source Receipt.

Check the successful tool response and write down the ID and receipt for your own comparison.

Now open a new Cursor conversation. Do not paste the preference or original response into it. Ask:

Use recall_memory to find my review-summary preference for the Juniper demo.
Show the Memory ID and Source Receipt, or say no matching Memory was returned.

Compare the returned ID, wording and source with Claude Code's result. Matching evidence confirms that Cursor retrieved the record saved through Claude Code. Repeat in the reverse direction if both tools will write memories in your workflow.

What should I check when recall returns nothing?

First check that both clients reached the same server and signed into the same account. Then check the query and scope. Start in personal scope to keep the first test independent of project matching. Project-private Memory requires the same supported opaque project identifier; matching folder names alone do not supply it.

Check tool errors separately from an empty search result. Resolve authentication or service errors before testing search again. If the record is returned but outdated, use the current project files to settle the fact, then update the saved context through the documented tools. Check a Source Receipt against current sources before relying on an old conclusion. Keep team rules in reviewed files or Knowledge Cards, with publication authorized separately.

For the worked service, the hosted setup and boundaries above are documented in the release README. Try the connection guide.

Frequently asked questions

Can Cursor read Claude Code auto memory?
There is no shared store configured by default. Use a shared instruction file for maintained rules or connect both clients to the same memory service.
Does adding MCP enable automatic capture?
Cursor's hosted MCP connection uses explicit tool calls. The Cloud installer enables automatic capture and prompt recall for Claude Code; configure Cursor separately.
Will matching repository names share project Memory?
No. Hosted project Memory needs the same opaque project identity. This guide tests personal scope with the same account.

Sources