Claude Code, Cursor and GitHub Copilot all read instruction files committed to git, such as a project CLAUDE.md, an AGENTS.md or Cursor rules. That makes a file every teammate’s agent reads at the start of a session the plainest way to share coding agent memory. GitHub Copilot Memory, mem0 and Cognee store agent-learned memory as a service instead. Trail-code combines the two: agents write the memory, and it travels as reviewed files in git.

What is shared coding agent memory?

It is anything a coding agent should know about a repository that the code does not say, kept where every teammate’s agent can read it. Examples are the test command that actually works, or why a retry limit is 4 and not 10. Our explainer on agent memory covers the general types.

The tools differ on where the memory lives, whether in the repo, on one laptop or on a vendor’s server. They also differ on who writes it, a person or the agent during a session. A third difference is whether anyone reviews an entry before a teammate’s agent acts on it. Our page on tribal knowledge covers the same gap outside code.

How do the eight tools compare on team sharing?

They split by who writes the memory: a person, the agent during a session, or a service that extracts it.

How coding agent memory reaches a team, from each vendor's own docs
ToolWhere team memory livesWho writes itHow a teammate gets itReview before others use itWhat to check
Trail-code .trail/learnings/ in the repo, one Markdown file per learningThe agent, when a session works something out or you correct itThrough git: commit .trail/ and every clone has itYes, in the pull request like codeThe team workspace across repos and the Skills and Guardrails kinds are marked soonREADME
Claude Code Project CLAUDE.md and .claude/rules/ in the repo; auto memory under ~/.claude/projects/You write CLAUDE.md; Claude writes auto memoryCLAUDE.md through git; auto memory stays on the machineCLAUDE.md as an ordinary file change; auto memory is never shared, so nobody else sees itAuto memory is machine-local; an org-wide CLAUDE.md is pushed with MDM or similar toolscode.claude.com
Cursor .cursor/rules/*.mdc in the repo; Team Rules in the Cursor dashboardYou, or Agent through /create-ruleProject rules through git; Team Rules apply to every member across repositoriesProject rules as a file change; Team Rules are set by adminsTeam Rules need a Team or Enterprise plancursor.com
GitHub Copilot .github/copilot-instructions.md or AGENTS.md in the repo; Copilot Memory on GitHubYou write instructions; Copilot writes memory factsMemory facts reach everyone with Copilot Memory on for that repositoryFacts are checked against the current branch; owners can review and delete them afterwardsPublic preview; unused facts are deleted after 28 daysdocs.github.com
AGENTS.md AGENTS.md files anywhere in the repoYouThrough git; read by Codex, Cursor, Copilot, Gemini CLI and othersAs an ordinary file changeA file format, so it changes only when someone edits it; the nearest file winsagents.md
mem0 Mem0 Platform, one shared project pool per repositoryMem0 extracts it from session activityEveryone on the repo reads and writes the same poolNot found on its pages (checked 2026-10-21)The Claude Code plugin needs a Mem0 Platform account and API keydocs.mem0.ai
Cognee A Cognee knowledge graph, local by default or on Cognee CloudCaptured from prompts, tool traces and responses, synced at session endThrough a shared Cognee Cloud or remote serverNot found on its pages (checked 2026-10-21)Local mode needs Python plus an LLM key or your Claude subscriptiondocs.cognee.ai
Sourcegraph An index of all your repositoriesBuilt from the codeCody and agents over MCP search the same indexNo agent-written entries found to review (checked 2026-10-21)Cody is on Sourcegraph Enterprise only; Cody Free and Pro ended on July 23, 2025sourcegraph.com

Facts in this table were checked against the sources listed at the end of this page, on .

Which tools share memory through files in git?

Claude Code, Cursor and AGENTS.md all rely on a Markdown file in the repository, and git does the sharing. It works with every agent here and costs nothing extra. The weak point is upkeep: the file changes only when someone remembers to change it.

Claude Code

Claude Code has two memory systems, and only one of them is shared. The project CLAUDE.md is “Team-shared instructions for the project”, shared with “Team members via source control”. Auto memory is what Claude writes for itself as it works, including “corrections you give Claude and approaches you confirm”. But “Auto memory is machine-local”, and its files “are not shared across machines or cloud environments” code.claude.com.

A correction you give Claude on Monday helps you on Tuesday, but not your colleague, unless Claude puts it in CLAUDE.md and you commit it. Organizations can also push a managed CLAUDE.md to every machine with MDM, Group Policy or Ansible, and Anthropic notes that Claude treats these files “as context, not enforced configuration” code.claude.com. A committed .claude/settings.json means everyone who clones the repository “gets the same permissions, hooks, and plugins” code.claude.com. Our CLAUDE.md guide covers how to write the file itself.

Cursor

Cursor starts its rules docs from “Large language models don’t retain memory between completions.” Project rules live in .cursor/rules as .mdc files and are version-controlled, and Agent can draft one for you with /create-rule. Team Rules are the shared layer above them: written in the dashboard, “Available on Team and Enterprise plans”, and, when an admin ticks “Enforce this rule”, “required for all team members”. An enabled Team Rule is included for Agent “across all repositories and projects for that team” cursor.com.

That makes Cursor strong for standards an admin wants everywhere. A Team Rule reaches Cursor users only, though. The old Memories docs address now redirects to the Rules page.

AGENTS.md

AGENTS.md is “a simple, open format for guiding coding agents, used by over 60k open-source projects”, stewarded by the Agentic AI Foundation under the Linux Foundation. Codex, Jules, Cursor, Gemini CLI, Copilot’s coding agent and many more read it, and “the closest one takes precedence” in a monorepo agents.md. Claude Code reads it when there is no CLAUDE.md. For a team that mixes agents, one AGENTS.md is the cheapest shared memory available, limited to what someone wrote down.

Which tools store team memory as a service?

GitHub Copilot Memory, mem0 and Cognee capture memory from sessions and keep it on a server that every teammate’s agent queries. Nobody has to write anything down. Where they differ is whether anything checks an entry before others rely on it.

GitHub Copilot

GitHub Copilot has two layers. Instruction files sit in the repo: .github/copilot-instructions.md, path-specific files, AGENTS.md, or “a single CLAUDE.md or GEMINI.md file stored in the root of the repository” docs.github.com. Organization instructions on Business and Enterprise plans currently reach only Copilot Chat, code review and the cloud agent on GitHub.com docs.github.com.

Copilot Memory is the agent-written layer. It stores repository facts “such as coding conventions, architectural decisions, build commands, and project-specific rules”, and they are “Available to all users with access to Copilot Memory for that repository”. Copilot creates them only from the actions of users with write access. Each fact carries citations to the code, Copilot checks those against the current branch, and “Only validated facts are used”. Facts unused for 28 days are deleted. The memory is currently used by Copilot’s cloud agent, code review, Copilot CLI and agentic autofix, and it is “currently in public preview” docs.github.com.

mem0

mem0 offers a Claude Code plugin that captures sessions and sorts each extracted memory into “shared project knowledge or a personal preference”. Project memory is one namespace per repository, and “Everyone on the repo reads and writes the same pool”, while personal memory is “private to you”. At the next session the plugin injects up to five relevant memories. It requires “A Mem0 Platform account and API key” docs.mem0.ai. Mem0 also sells OpenMemory, which it calls “A persistent MCP AI memory layer” for Cursor, VS Code, Claude and other coding agents, with access logs and visibility rules mem0.ai. We found no review step before a shared memory reaches teammates.

Cognee

Cognee lists “First-party integrations for Claude Code, Cursor, LangGraph, OpenClaw, and more, plus an MCP server” cognee.ai. Its Claude Code plugin captures prompts, tool traces and responses and “syncs the session into your knowledge graph on session end”. By default it starts a local Cognee API on the machine. Pointed at Cognee Cloud or a remote server, memory can be shared, and the docs warn that “Under shared memory that data can include other people’s prompts” docs.cognee.ai. Cognee Cloud adds “Dataset-level isolation with role-based access control” and can read Slack, GitHub and Google Drive into shared workspace memory docs.cognee.ai. That suits a team that wants code memory in the same graph as its other company knowledge, or one that wants to run the graph itself.

Is shared code search the same as shared memory?

No. Sourcegraph calls itself “The context layer for your entire codebase” and indexes all of a company’s repositories so agents and developers search the same code sourcegraph.com. Cody, its assistant, now runs only on Sourcegraph Enterprise sourcegraph.com, and its Prompt Library lets people share prompts “within your organization” sourcegraph.com. That answers “where else is this function called?” across hundreds of repositories. It does not record why the team chose a retry limit, and we found no Sourcegraph feature that stores decisions agents learn.

How Trail-code shares coding agent learnings through pull requests

The README starts from an agent that “forgets everything when a session ends”, with teammates’ agents that “do the same”. It saves what an agent works out as a learning, and “You don’t have to write any of it by hand” README.

Repo learnings live in .trail/ and reach everyone who clones the repo, even before they install the CLI; personal ones stay in ~/.trail/, “Never committed, never uploaded”. Each repo learning is a file in the pull request, so “it gets reviewed like the code it is about”. Learnings on a teammate’s pushed branch show up before it merges. Before the PR, trail check flags a change that undoes a teammate’s decision, “quoting who decided it and why”. The trail team command lists the last 7 days of learnings and where work overlaps README.

Since version 0.22.1, trail init also turns “things reviewers flagged on 2 or more of the last 50 merged PRs” into team learnings. In a repo with a committed .trail/, Claude reads the newest learnings even for a teammate without the CLI CHANGELOG. Setup covers Cursor, Codex and other AGENTS.md readers, Gemini CLI, GitHub Copilot, Windsurf and Kiro, with Claude Code getting “the deepest setup”, and the CLI is free under the MIT license README.

The README is open about what is missing. A Trail workspace for the team across repositories is marked “soon”, as are the Skills and Guardrails kinds, so a learning today is a decision or a preference, and nothing blocks a command yet. If your team wants one admin-managed rule set inside a single editor, Cursor Team Rules or a managed CLAUDE.md is simpler. Our rename page covers install, telemetry and the code map.

How can you test whether a tool fixes forgotten team decisions?

We call this the Trail two-teammate test: run one real decision through a tool with two people, on separate machines, and see whether it reaches the second person’s agent.

The Trail two-teammate test for shared coding agent memory

Checklist
  • Make one decision in a sessionTeammate A has their agent work out something non-obvious, such as why a limit has its current value, and confirms it in the chat.
  • Check where it was writtenFind the entry: a file in the diff, a line in a dashboard, or nothing. If it went to a home directory, it will not reach anyone else.
  • Switch machine and agentTeammate B, on another laptop and, if your team mixes tools, a different agent, asks about the same code the next day. Note whether the decision shows up without being asked for.
  • Look for the review stepAsk who approved the entry before B saw it. A pull request, an owner review or a validation against current code all count; silence does not.
  • Try to contradict itHave B propose the opposite change. A useful tool warns before the change merges and says who made the original decision.
  • Wait a monthCheck whether the entry expired, went stale against the code, or is still there. Copilot Memory, for one, deletes facts left unused for 28 days.

Who should be allowed to write and approve each kind of entry is a governance question; our guide to governing a memory layer covers it beyond code.

Which option fits your team?

Start from the agents your team runs and from who should write the memory.

A decision rule for shared coding agent memory

Step list
  1. Everyone uses one editor or agentUse its own shared layer first: a committed CLAUDE.md for Claude Code, Team Rules for Cursor, or Copilot Memory plus instructions for GitHub Copilot.
  2. The team mixes agentsCommit an AGENTS.md as the floor. Add Trail-code if agents should save decisions themselves and you want each one reviewed in the PR.
  3. You want memory captured with no files in the repomem0 for a hosted per-repository pool, or Cognee if you want to host the graph or join it with Slack and Drive content.
  4. Agents miss code in other repositoriesThat is a search problem; Sourcegraph, or another code index, fits better than a memory store.

Which team memory claims could we not confirm?

  • A current Cursor feature that saves memories by itself: the old Memories docs address redirects to Rules, and the Rules page does not describe one.
  • A review or approval step before mem0’s shared project memory, or a shared Cognee dataset, reaches other teammates.
  • Where the source for OpenMemory, the MCP memory layer, lives today: the OpenMemory page calls it open source and links only to mem0ai/mem0, which has no openmemory folder at its root. A separate mem0ai/openmemory repository describes a tool that moves coding sessions between Claude Code, Codex and OpenCode.
  • Whether Copilot Memory facts are used by Copilot in the IDE: the docs name the cloud agent, code review, Copilot CLI and agentic autofix only.

How we compared these eight tools

On 21 October 2026 we read each vendor’s docs and product pages with curl and checked every quote against the fetched text. We picked the tools AI answers to these questions name (Claude Code, Cursor, GitHub Copilot, Cognee, mem0, Sourcegraph), added AGENTS.md as the shared file format, and included Trail-code. The criteria were where team memory lives, who writes it, how it reaches a teammate, whether anyone reviews it first, and which agents can read it. Silence on a vendor page is reported as not found. We did not install or test any tool, and we have not run the two-teammate test on any of them. Trail, which makes Trail-code, publishes this page.

Frequently asked questions

which tool shares coding agent memory across a team?

Trail-code (MIT) is built for it: agents save decisions as Markdown files in the repo, a teammate reviews each one in the pull request, and git carries them to Claude Code, Codex, Cursor, Copilot and other agents; its cross-repository team workspace is still marked soon. GitHub Copilot Memory shares repository facts among Copilot users, mem0's Claude Code plugin keeps one hosted pool per repository, and Cursor Team Rules push admin-written rules to every member.

best tools for coding agents to share repo knowledge

For knowledge people write down, commit an AGENTS.md, which Claude Code, Cursor, GitHub Copilot, Codex and Gemini CLI can all read, or a CLAUDE.md if everyone uses Claude Code. For knowledge agents discover, GitHub Copilot Memory, mem0 and Cognee store it as a service, and Sourcegraph indexes every repository for code search. Pick by who writes the knowledge and whether someone reviews it first.

coding agents forget team decisions, what tools fix that

A decision survives only if it is written somewhere every teammate's agent reads at the start of a session. Instruction files in git do that for decisions someone writes up; Copilot Memory, mem0's shared project pool and Cognee capture them from sessions automatically. Claude Code's auto memory remembers corrections on one machine only.

open source memory tools for coding agents

mem0 and Cognee are both Apache-2.0 on GitHub. Cognee's Claude Code plugin runs a local Cognee server by default, while mem0's Claude Code plugin needs a Mem0 Platform account and API key. AGENTS.md is an open format stewarded by the Agentic AI Foundation under the Linux Foundation, and plain files in git work with any agent.

Does Claude Code share auto memory with teammates?

No. Anthropic's memory docs say auto memory is machine-local and its files are not shared across machines or cloud environments. To share something Claude learned, ask it to add the point to the project CLAUDE.md and commit that file.

What does shared coding agent memory cost?

Instruction files such as AGENTS.md and CLAUDE.md cost nothing beyond the agent you already pay for. GitHub says Copilot Memory is available on all paid Copilot plans, and Cursor Team Rules need a Team or Enterprise plan. mem0's Claude Code plugin needs a Mem0 Platform account and API key, while Cognee runs locally by default.

Should coding agents write team memory without a review step?

It depends on what a wrong memory costs. A stale build command wastes a session, while a wrong rule about retries or migrations can ship in the next pull request. Copilot Memory validates facts against the current code before use, and a file in git can go through the same review as code.

Sources checked

Show 23 sources