explaingit

dan-calin/shared-agent-memory

Analysis updated 2026-05-18

2JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

An MCP-based tool that gives Claude Code, Codex, and other AI agents a single shared memory file so knowledge from one agent session is immediately available to the next.

Mindmap

mindmap
  root((shared-agent-memory))
    What it does
      Shared memory for agents
      Knowledge graph storage
      Context across sessions
    Coordination Layer
      File claim board
      Warn or block mode
      Auto-expiring claims
    How It Works
      MCP server per agent
      Same memory JSON file
      Search on task start
    Install
      npx one-liner
      Auto-detects agents
      Restart agents after
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let a Claude Code session pick up exactly where a Codex session left off without manually writing a handoff document.

USE CASE 2

Prevent two parallel AI agents from unknowingly overwriting each other by claiming files on a shared coordination board.

USE CASE 3

Ask any new AI agent what it knows about a specific module in your codebase and get facts saved by previous sessions.

What is it built with?

JavaScriptNode.jsMCP

How does it compare?

dan-calin/shared-agent-memoryash310u/awesome-ai-stackasqrzk/copilot-openrouter-to-ollama-proxy
Stars222
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Node 18+ and agents that support MCP configuration, agents must be restarted after install.

In plain English

shared-agent-memory is a tool that gives all your AI coding agents a single shared memory so that what one agent learns, the others can immediately access. Without it, each new AI session starts from scratch and you have to manually copy context between agents by writing handoff files and pasting them around. This tool replaces that process with a searchable knowledge graph stored in a single JSON file on your machine. The technical approach is straightforward: it configures the memory MCP server, a standard memory system from the MCP protocol ecosystem, for each AI agent you use (Claude Code, Codex, or any other MCP-compatible tool) and points all of them at the same file. When an agent finishes a task, it saves a short note about what changed. When a new agent starts a task, it searches that memory for relevant prior context before doing anything. The memory is organized as named entities with short observations, plus relationships between them, so searching finds the right facts quickly without reading an ever-growing document. An optional coordination layer handles a second problem: two agents editing the same file at the same time and overwriting each other. You can turn it on with one command, after which agents can claim the files they intend to edit. The claims are advisory by default, meaning the system warns an agent if it is about to touch a file claimed by another agent but does not block the edit. A stricter mode that refuses the edit until the claim is released is also available. Claims expire automatically after two hours so a crashed session does not leave a file permanently locked. Installation uses one npx command that auto-detects which agents you have installed and configures the MCP server for each. Agents then use the memory automatically at the start and end of each task with no manual steps required. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
I use both Claude Code and Codex on the same project. How do I install shared-agent-memory so both agents read and write to the same memory file?
Prompt 2
I want to prevent Claude Code and Codex from editing the same file at the same time. How do I turn on the coordination layer and use file claims?
Prompt 3
My Codex session saved notes about a refactor. How do I ask Claude Code to search those saved memories before starting a related task?
Prompt 4
How is the shared-agent-memory knowledge graph structured? What are entities, observations, and relations in the memory.json file?

Frequently asked questions

What is shared-agent-memory?

An MCP-based tool that gives Claude Code, Codex, and other AI agents a single shared memory file so knowledge from one agent session is immediately available to the next.

What language is shared-agent-memory written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, MCP.

How hard is shared-agent-memory to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is shared-agent-memory for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub dan-calin on gitmyhub

Verify against the repo before relying on details.