How to Share Context Between Claude Code and Cursor

You're an hour deep into a debugging session with Claude Code. Good progress. Then you open Cursor to refactor the same function, and it has no idea what you were just doing. So you re-explain. Switch back, re-explain again. This is the question behind "how to share context between Claude Code and Cursor," and the short answer is: neither tool will do it for you, but there is a clean way to make them share one memory.
The Core Problem: Context Dies With the Session
This isn't a bug in either tool. Claude Code works inside its context window (200,000 tokens on most tiers, more on some), and when the session ends, that context is gone. Cursor lives in its own world and knows nothing about what happened elsewhere. Two silos.
Imagine writing a novel with a co-author who forgets everything you wrote the moment you switch computers. That's your coding workflow right now.
The Usual Workarounds (and Why They Don't Hold Up)
Most of us tried these first. They work for about a week.
Copy-pasting. Manually moving snippets and notes between tools. Tedious, error-prone, and it collapses on anything bigger than a toy project.
CLAUDE.mdfiles. Writing context into a Markdown file both tools can read. This is fine for a small project, but the file is only as good as the last time you remembered to update it. I wrote about exactly why in Why Your CLAUDE.md Goes Stale.Shared docs. Notion, Google Docs, a notes app. Still manual, and the content never reaches the tool where you're actually coding.
All three patch the symptom. The root cause is that Claude Code and Cursor have no memory layer they both can read and write.
What MCP Changes
The Model Context Protocol (MCP) is a standard that lets an AI tool talk to an external memory server: save a decision, recall a preference, look up a project fact. Because it's a standard, the same memory server can serve Claude Code, Cursor, Claude Desktop, Windsurf and ChatGPT at once. That is the whole trick: you don't share context between the tools, you give them one shared place to keep it.
If you haven't set up an MCP memory server yet, start with MCP Memory Server: How to Give Claude & Cursor Persistent Memory (2026). It covers the basic setup.
A Concrete Example with ContextForge
ContextForge is the memory layer I built for exactly this. It runs as an MCP server, and you add it to each tool once:
claude mcp add contextforge -e CONTEXTFORGE_API_KEY=<your-key> -- npx -y contextforge-mcp
Here's what a normal week looks like with both tools pointed at it:
Claude Code, Monday. You're debugging a Python function. As you decide things ("the retry logic goes in the client, not the handler," "we're dropping the caching layer"), Claude Code saves those decisions to ContextForge. Not magically: it saves them because it has the memory tools and the instructions to use them, the same way it has a tool to read a file. They land in the Project linked to your repo.
Cursor, Tuesday. You open the same repo in Cursor to refactor that function. Cursor is connected to the same ContextForge project, so before it touches anything it can pull up Monday's decisions. It doesn't propose the caching layer you already killed.
Claude Code, Friday. You come back after three days on something else. It recalls the whole thread instead of asking you to summarize it.
It isn't only decisions. Preferences, conventions, the commands you always run, the one weird constraint in your deploy: anything the agent saves is there for the other tool. You can browse all of it in the dashboard at contextforge.dev.
Spaces, Projects, and Keeping Memory Honest
Inside a Project, memories are organized into Spaces, which are just folders by topic (auth, billing, infra). Tasks track the issues you're working on, and the Git integration pulls commit messages and pull request descriptions in as well, so "why did we do this" usually has an answer.
The part people skip is governance. Code moves fast and memories go stale. ContextForge runs freshness checks that flag a memory when the code it describes has changed since it was saved. You, or the agent, can then confirm it, correct it, or forget it. Skip this and a six-week-old decision will quietly steer today's work, which is worse than having no memory at all.
Limitations, Honestly
There's a setup. One-time, but real: an API key and an MCP entry in each tool. It's not plug-and-play yet, and we're still smoothing it.
Memory is only what gets saved. ContextForge doesn't know what matters. If the agent doesn't save a decision, it isn't there. Your
CLAUDE.mdor rules file should tell the agent when to save, and you'll still nudge it sometimes.It complements reading the code. Memory tells the agent what you decided, not what the code does today. It still has to read the file.
It's early. Small team, active development, occasional rough edges. We ship core functionality first and polish second.
Where to Start
If you use both tools daily, the order that worked for me: get one MCP memory server running, connect Claude Code to it first, then Cursor. Do one real task in each and check what got saved. From there the habit builds itself, because the first time Cursor already knows what you decided in Claude Code, you won't want to go back.
Share this article


