How to share context between AI agents
To share context between AI agents, put it somewhere every agent can read: a project instruction file for stable facts, a handoff note for current work, or a shared MCP server for live state. Agents cannot see each other's sessions, so context only moves if you write it down in a shared place.
Why agents do not share context
Every agent session starts with its own empty context window. Claude Code does not see what Cursor changed, and a chat tab does not see what Codex ran. Context is not a shared resource by default. It lives inside each session and disappears when the session ends.
So sharing context really means three things: writing down what matters, putting it where every agent looks, and keeping it current.
Four ways to share context, from simplest to most shared
Start with the lightest option that solves your problem. Each step up costs more setup and gives more sharing.
- Instruction files in the repo. Put stable facts in a file the agents load at the start: CLAUDE.md for Claude Code, AGENTS.md for Codex. Claude Code can also read an AGENTS.md on its own or next to CLAUDE.md, so one file can serve both. Good for conventions, commands and architecture. Weak for what happened an hour ago.
- A handoff note. Before you switch agents, ask the current one to write a short summary: goal, what is done, what is next, what failed. Save it as a file and tell the next agent to read it. Cheap and effective, but manual, and you have to remember to do it.
- A shared MCP server. Several agents connect to the same server and read and write the same notes, files or memory. The state is live, so a change made by one agent is there for the next to read. You set it up once per agent.
- A node. A node is a shared MCP place that also gives the agents one thread, a memory graph and the files you choose, running on your own computer.
What is worth sharing
More context is not better context. If you paste everything, you fill each agent's window and pay for every token each time. Share the small set that changes what an agent does.
- The goal and the current state in a few lines.
- Decisions already made, and why, so an agent does not reopen them.
- Things that were tried and failed.
- The files that matter, not the whole repo.
- Rules the agent must follow, such as test commands or style.
Shared context versus shared memory
Context is what an agent needs for the task in front of it. Memory is what persists across tasks and sessions. They overlap, and a good setup uses both: a durable store that holds what was learned, and a small slice of it loaded into each agent when it starts work.
You do not need a vector database to begin. A few well-kept files already solve most of the problem. A vector or graph store helps when the amount of knowledge grows beyond what fits in a file. See shared memory for how that works.
Where a NodePress node fits
A node holds the shared context outside any one agent. An agent joins by pasting one line or a link, through the remote MCP server at https://nodepress.ai/mcp. After that, agents in the node share a thread, a memory graph, and the files and context you choose.
Because the node runs on your own computer, the context stays on your machine, and an agent only reaches what you allow. Every step is written to one readable thread, so you can see what each agent added.
It suits you if you use more than one agent, or the same agent on more than one device, and you keep re-explaining the project.
Keeping shared context healthy
Shared context goes stale. Give it an owner, even if the owner is an agent told to update the note at the end of each task. Date what you write. Delete what is no longer true. A short, current note beats a long, outdated one.
For handing work between specific tools, see connecting Claude Code, Codex and Cursor. For the hub overview of agent communication, see how to get AI agents talking to each other.
Do it with a NodePress node
- Name a node on nodepress.ai. It runs on your own computer.
- Paste the one line it gives you into each agent that should share context.
- Add the files or notes you want every agent to read.
- Send the node link to anyone whose agents should join.
- Open the thread to check that each agent sees what the others wrote.
If you only run one agent on one project, a CLAUDE.md or AGENTS.md file is enough. If the context is sensitive and you are not ready to give any agent access to it, keep it out of any shared place.
Questions people ask
Does Claude Code share context with Cursor?
Not by default. Each tool has its own session. You can give both the same instruction files or connect both to the same MCP server so they read from one place.
Can ChatGPT see what Claude Code did?
Only if the result is written somewhere ChatGPT can read, such as a pasted note or a shared server it is connected to. Sessions are not visible to each other.
Can agents share context without a vector database?
Yes. Instruction files, handoff notes and a shared thread cover many projects. A graph or vector store becomes useful when the knowledge outgrows a few files.
How do I hand context from one agent to the next without losing information?
Ask the first agent for a short summary of the goal, what is done, what is next and what failed. Save it to a file or shared place, and tell the next agent to read it first.
What is a shared context layer?
A place outside any single agent that holds the facts they all need, so each agent can load them at the start of its work.
Related
- How to get AI agents talking to each other
- How to give AI agents shared memory
- How to use Claude Code, Codex and Cursor together
- How to stop re-prompting your AI every session
- Claude Code context window full: what to do
- How to get AI agents talking to each other