<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Subal Bain</title>
    <description>The latest articles on DEV Community by Subal Bain (@subal_bain_059153c5cbc1cc).</description>
    <link>https://dev.to/subal_bain_059153c5cbc1cc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4245175%2F1d83dd4a-4eb7-4927-b2dc-1d1931d73be6.jpg</url>
      <title>DEV Community: Subal Bain</title>
      <link>https://dev.to/subal_bain_059153c5cbc1cc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/subal_bain_059153c5cbc1cc"/>
    <language>en</language>
    <item>
      <title>I Gave Claude Code, Codex, Cursor and Copilot One Shared Memory. Here's What Broke.</title>
      <dc:creator>Subal Bain</dc:creator>
      <pubDate>Sat, 14 Nov 2026 23:21:16 +0000</pubDate>
      <link>https://dev.to/subal_bain_059153c5cbc1cc/i-gave-claude-code-codex-cursor-and-copilot-one-shared-memory-heres-what-broke-3g56</link>
      <guid>https://dev.to/subal_bain_059153c5cbc1cc/i-gave-claude-code-codex-cursor-and-copilot-one-shared-memory-heres-what-broke-3g56</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgot05b1q5q3co98d0ohh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgot05b1q5q3co98d0ohh.png" alt="memro" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use four AI coding tools regularly: Claude Code, Codex, Cursor and GitHub Copilot.&lt;/p&gt;

&lt;p&gt;They are all good at different things. But they share one frustrating limitation: every new session starts with a surprisingly short memory.&lt;/p&gt;

&lt;p&gt;The architecture decision we discussed yesterday? Gone.&lt;/p&gt;

&lt;p&gt;The reason we chose PostgreSQL over another database? Gone.&lt;/p&gt;

&lt;p&gt;The migration convention we agreed on last week? Gone.&lt;/p&gt;

&lt;p&gt;I kept repeating context, explaining decisions and correcting the same mistakes across different tools.&lt;/p&gt;

&lt;p&gt;So I started building &lt;a href="https://memro.co" rel="noopener noreferrer"&gt;Memro&lt;/a&gt;: a persistent memory layer that lets different AI coding agents share the same context through MCP.&lt;/p&gt;

&lt;p&gt;The idea was simple:&lt;/p&gt;

&lt;p&gt;Connect one memory server to every coding agent. Let them remember decisions, preferences, project context and previous work.&lt;/p&gt;

&lt;p&gt;In practice, getting this right was more interesting than I expected.&lt;/p&gt;

&lt;p&gt;I connected Memro to Claude Code, Codex and GitHub Copilot, and also examined Cursor's rule configuration. I wanted to understand what each tool actually loaded, which configuration took precedence, and whether the agents would invoke memory tools without being explicitly asked.&lt;/p&gt;

&lt;p&gt;I discovered that connecting an MCP server is only half the problem.&lt;/p&gt;

&lt;p&gt;Here's what I learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Claude Code: Project configuration overrides global configuration
&lt;/h2&gt;

&lt;p&gt;I had Memro configured globally in &lt;code&gt;~/.claude.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For one project, I wanted an isolated memory configuration, so I added a project-level &lt;code&gt;.mcp.json&lt;/code&gt; with a server using the same name, &lt;code&gt;memro&lt;/code&gt;, but a different API key.&lt;/p&gt;

&lt;p&gt;I expected Claude Code to load the project configuration.&lt;/p&gt;

&lt;p&gt;But I wanted to verify what actually happened, not just assume the documentation described the runtime correctly.&lt;/p&gt;

&lt;p&gt;I used Claude Code's machine-readable startup output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude -p ok --output-format stream-json --verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;init&lt;/code&gt; event exposed the MCP servers loaded at startup, including their configuration sources.&lt;/p&gt;

&lt;p&gt;Here's what I observed:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where Claude Code ran&lt;/th&gt;
&lt;th&gt;Loaded server&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Outside the project&lt;/td&gt;
&lt;td&gt;User configuration&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inside project, project server unreachable&lt;/td&gt;
&lt;td&gt;Project configuration, failed&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inside project, valid project server&lt;/td&gt;
&lt;td&gt;Project configuration, connected&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few interesting things emerged:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Same name means override, not merge.&lt;/strong&gt; The project-level &lt;code&gt;memro&lt;/code&gt; server replaces the global one inside that project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;There is no silent fallback.&lt;/strong&gt; If the project server fails, Claude Code doesn't automatically switch back to the working global server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The CLI can be misleading.&lt;/strong&gt; &lt;code&gt;claude mcp get&lt;/code&gt; and &lt;code&gt;claude mcp list&lt;/code&gt; can still show the global configuration. For understanding what actually loaded, inspect the startup &lt;code&gt;init&lt;/code&gt; event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project approval matters.&lt;/strong&gt; Claude Code requires one-time approval before using a project's &lt;code&gt;.mcp.json&lt;/code&gt; server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment variable expansion works.&lt;/strong&gt; You can use &lt;code&gt;${MEMRO_API_KEY}&lt;/code&gt; in the configuration rather than committing a secret.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important lesson: the configuration you see isn't necessarily the configuration your agent is running.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Codex: Your project configuration needs a trusted folder
&lt;/h2&gt;

&lt;p&gt;Codex supports MCP authentication through &lt;code&gt;bearer_token_env_var&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I tested this against a logging MCP server and verified that Codex sent the expected authorization header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Authorization: Bearer &amp;lt;value of MEMRO_API_KEY&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That part worked.&lt;/p&gt;

&lt;p&gt;The interesting behavior was project-level configuration.&lt;/p&gt;

&lt;p&gt;Codex uses &lt;code&gt;.codex/config.toml&lt;/code&gt; for project-specific settings, but only when the project folder is trusted.&lt;/p&gt;

&lt;p&gt;The trust configuration lives in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ~/.codex/config.toml
&lt;/span&gt;
&lt;span class="k"&gt;[projects."/path/to/project"]&lt;/span&gt;
&lt;span class="na"&gt;trust_level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"trusted"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I tested the same project in two states:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Project state&lt;/th&gt;
&lt;th&gt;Configuration Codex used&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Folder not trusted&lt;/td&gt;
&lt;td&gt;Global configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Folder trusted&lt;/td&gt;
&lt;td&gt;Project configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When the folder wasn't trusted, Codex silently used the global configuration instead of the project's MCP setup.&lt;/p&gt;

&lt;p&gt;This is easy to miss because nothing necessarily looks broken. The agent still works, but it may be using a completely different memory server.&lt;/p&gt;

&lt;p&gt;One unrelated discovery: if you're running Codex through a shell script, close stdin to prevent &lt;code&gt;codex exec&lt;/code&gt; from waiting for input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. GitHub Copilot: Having tools doesn't mean using them
&lt;/h2&gt;

&lt;p&gt;This was probably the most interesting experiment.&lt;/p&gt;

&lt;p&gt;I configured Memro as an MCP server in VS Code's &lt;code&gt;mcp.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Copilot Agent mode picked it up. Even on the Free plan, the MCP integration worked in my test.&lt;/p&gt;

&lt;p&gt;I asked Copilot directly about previous project decisions, and it called Memro's &lt;code&gt;recall&lt;/code&gt; tool after requesting permission.&lt;/p&gt;

&lt;p&gt;So far, so good.&lt;/p&gt;

&lt;p&gt;Then I asked a normal engineering question:&lt;/p&gt;

&lt;p&gt;"What is our versioning rule?"&lt;/p&gt;

&lt;p&gt;Copilot searched the repository documentation and answered without calling memory.&lt;/p&gt;

&lt;p&gt;The problem was that the repository documentation didn't contain the complete decision. That context existed in Memro.&lt;/p&gt;

&lt;p&gt;The MCP server was connected. The tools were available. But the model didn't know it should use them.&lt;/p&gt;

&lt;p&gt;I needed to solve a different problem: teaching Copilot when to recall memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix: Persistent instructions
&lt;/h3&gt;

&lt;p&gt;VS Code supports personal and repository-level Copilot instruction files.&lt;/p&gt;

&lt;p&gt;For personal instructions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/.copilot/instructions/*.instructions.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For repository instructions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.github/instructions/*.instructions.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I created an instruction file with this front matter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;---
description: Memro long-term memory
applyTo: "**"
---

Before answering questions about earlier work,
decisions, rules, or preferences, call Memro's
recall tool first.

Use recalled context before searching project files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There was one more detail: I had to reload the VS Code window.&lt;/p&gt;

&lt;p&gt;The chat session I had already started didn't pick up the newly created instructions.&lt;/p&gt;

&lt;p&gt;After reloading, I repeated the same question.&lt;/p&gt;

&lt;p&gt;This time Copilot invoked &lt;code&gt;recall&lt;/code&gt; automatically and included the missing context in its answer.&lt;/p&gt;

&lt;p&gt;The takeaway: MCP exposes capabilities. Instructions teach the agent when to use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Cursor: Rules need to be explicitly applied
&lt;/h2&gt;

&lt;p&gt;Cursor's rules have a similar consideration.&lt;/p&gt;

&lt;p&gt;According to Cursor's documentation, a rule without &lt;code&gt;alwaysApply: true&lt;/code&gt; is only used when Cursor decides it's relevant.&lt;/p&gt;

&lt;p&gt;For Memro's memory instructions, the rule should explicitly set &lt;code&gt;alwaysApply: true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A project rule can live at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.cursor/rules/memro.mdc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;---
description: Memro long-term memory
alwaysApply: true
---

Before answering questions about previous work,
decisions, conventions, or preferences, call
Memro's recall tool.

Use the retrieved context when forming your answer.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;alwaysApply&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the memory instructions available across conversations rather than relying on Cursor to decide whether the rule is relevant.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The bigger discovery: MCP integration has three layers
&lt;/h2&gt;

&lt;p&gt;After examining these four tools, I realized that MCP integration isn't just about connecting a server.&lt;/p&gt;

&lt;p&gt;There are three separate things to get right.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 1: Connectivity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Can the agent reach the MCP server?&lt;/p&gt;

&lt;p&gt;Does authentication work? Is the API key valid? Are the tools available?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 2: Configuration resolution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Which configuration is actually being loaded?&lt;/p&gt;

&lt;p&gt;Is the agent using the global configuration or the project configuration? Is the project trusted? Has the server been approved?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 3: Tool invocation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Does the model know when to call the MCP tools?&lt;/p&gt;

&lt;p&gt;A server can be perfectly connected, authenticated and available, while the model never invokes it.&lt;/p&gt;

&lt;p&gt;This is why checking whether an MCP server is connected isn't enough.&lt;/p&gt;

&lt;p&gt;You need to verify all three layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. That's why I built &lt;code&gt;memro-cli doctor&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;While debugging these differences, I realized developers shouldn't have to manually inspect different configuration systems just to understand why their memory server isn't working.&lt;/p&gt;

&lt;p&gt;So I added a &lt;code&gt;doctor&lt;/code&gt; command to the Memro CLI.&lt;/p&gt;

&lt;p&gt;It inspects the configurations for supported coding agents, determines which configuration applies to the current project, checks authentication and checks whether the necessary memory instructions exist.&lt;/p&gt;

&lt;p&gt;Here's the actual output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✔ Claude Code   project ./.mcp.json · key $MEMRO_API_KEY · 25 tools
                overrides ~/.claude.json
! Codex         global ~/.codex/config.toml · key in the file · 25 tools · uses the global config: Codex ignores ./.codex/config.toml until you open Codex in this folder and trust it
✔ VS Code       global …/Code/User/mcp.json · key in the file · 25 tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of wondering why an agent isn't remembering something, you can start by checking what it's actually configured to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Try Memro
&lt;/h2&gt;

&lt;p&gt;You can get started with two commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx memro-cli connect
npx memro-cli doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The connect command signs you in and configures Memro for the coding tools it finds.&lt;/p&gt;

&lt;p&gt;The doctor command checks the resulting setup.&lt;/p&gt;

&lt;p&gt;Memro currently supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code&lt;/li&gt;
&lt;li&gt;OpenAI Codex&lt;/li&gt;
&lt;li&gt;Cursor&lt;/li&gt;
&lt;li&gt;VS Code / GitHub Copilot&lt;/li&gt;
&lt;li&gt;Google Antigravity&lt;/li&gt;
&lt;li&gt;OpenCode&lt;/li&gt;
&lt;li&gt;Gemini CLI&lt;/li&gt;
&lt;li&gt;Windsurf&lt;/li&gt;
&lt;li&gt;Claude Desktop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also configures the instructions that tell each agent when to use memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://memro.co" rel="noopener noreferrer"&gt;Memro&lt;/a&gt; is source-available under the PolyForm Noncommercial License, free for personal and non-commercial use.&lt;/p&gt;

&lt;p&gt;You can explore the code at &lt;a href="https://github.com/memrohq/memro" rel="noopener noreferrer"&gt;github.com/memrohq/memro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;SDKs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install memro
npm install @memro/sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Building a shared memory layer for AI coding agents made me realize that the difficult part isn't necessarily storing context.&lt;/p&gt;

&lt;p&gt;It's making sure the right context reaches the right agent at the right time.&lt;/p&gt;

&lt;p&gt;Every coding tool has its own configuration system, trust model, instruction mechanism and runtime behavior.&lt;/p&gt;

&lt;p&gt;MCP gives us a common interface, but the experience around it is still fragmented.&lt;/p&gt;

&lt;p&gt;I'm curious how other developers are handling this.&lt;/p&gt;

&lt;p&gt;If you've configured MCP across multiple coding agents, what unexpected behavior have you encountered?&lt;/p&gt;

&lt;p&gt;And if you've found a better way to make agents consistently use shared memory, I'd love to hear about it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>productivity</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
