To share context between the coding agents on a team, split it in two.
Instructions (how to build, conventions, rules) go in a file committed to
the repository: AGENTS.md is read by Codex, Cursor and Claude Code.
Knowledge that grows as you work (decisions, lessons from reverted
changes, open tasks) goes in one shared memory every agent reads and writes
over MCP. The file is the same for everyone because it's in git; the memory is
the same for everyone because it's one server.
Why each agent starts from zero
Each tool keeps its own context and none of it travels:
- Claude Code's auto memory is stored on one machine.
- Cursor's user rules are per person.
- Chat histories stay in the tool and with the person who had them.
- Pull request descriptions and Slack threads hold the reasons, but agents don't read them before a change.
So the lesson one person's agent learned on Tuesday is learned again by someone else's on Thursday.
Layer 1: one instruction file for every agent
Commit an AGENTS.md at the repository root. Who reads it, from each
tool's docs (checked on 30 October 2026):
| Agent | Reads AGENTS.md? |
|---|---|
| Codex | Yes, from the repository root down to the working folder |
| Cursor | Yes, at the root and in subfolders |
| Claude Code | Yes, when there is no CLAUDE.md; otherwise import it with @AGENTS.md in CLAUDE.md |
Keep it short and stable: build and test commands, layout, conventions, and the name of the project's shared memory.
Layer 2: one memory every agent reads and writes
RepoMemory keeps a ledger per project with five kinds of entry:
| Kind | Example |
|---|---|
| Decision | "Chose Postgres full-text search over embeddings: predictable results." |
| Lesson | "Captcha on checkout cut completed orders 5%; reverted." |
| Guardrail | "Never run migrations on deploy." |
| Note | "Staging Stripe uses the shared test key." |
| Task | "Move image uploads to R2." |
Every agent uses the same tools: brief at the start of a session (every
guardrail, the open tasks, the newest decisions), recall before a change,
record_entry when something is worth keeping, and claim_task before
starting a task. A claim is refused with already_claimed if another agent
has the task, and runs out after two hours unless renewed, so two people's
agents don't do the same job and a crashed one doesn't hold it.
Each entry records which key and which agent wrote it. Entries are shown to agents as notes, not instructions, and one worded like a prompt injection is flagged.
Set it up for a team
Put the team on one account. On the Team plan, every API key on the account reads and writes the same ledgers. Invite teammates from the dashboard.
Each person creates their own key on the API keys page and sets it as
REPOMEMORY_KEY.Each person connects their agent:
# Claude Code claude mcp add --transport http repomemory https://api.repomemory.dev/mcp \ --header "X-API-Key: $REPOMEMORY_KEY" # Codex codex mcp add repomemory --url https://api.repomemory.dev/mcp \ --bearer-token-env-var REPOMEMORY_KEYFor Cursor and VS Code, the docs have the JSON.
Commit the project-memory section to AGENTS.md once, for everyone:
## Project memory (RepoMemory, project "acme/shop") - At the start of a session, call `brief` for the project: it returns every guardrail, the open tasks and the latest decisions. Never break a guardrail. - Before planning a change, removing code that looks unneeded or retrying an approach, call `recall` with words about the change. Follow what it returns. - When a change is reverted, a fix took real digging, or you choose one approach over another, call `record_entry` (kind lesson or decision) saying what happened, why, and what to do instead, with your name in `agent`. - Claim a task with `claim_task` before starting it and keep the `claim_token` it returns; `retire_entry` it when done, or call `claim_task` with `release` and the token if you stop without finishing.npx @plexsicity/repomemory initwrites this section and adds the server to Claude Code and Cursor in one step.
Keep it healthy
- When a decision changes, record the new one with
supersedes; the old one is retired with a pointer, and recall stops returning it. - If someone's agent records a secret, delete the entry from the dashboard's Ledger page; deleting is free.
- Export a project's whole ledger, retired entries included, with
/v1/export.
Limits to know
Recall matches words, not meaning. Agents record only what AGENTS.md tells them to. RepoMemory is hosted only, with no self-hosted version. The Team plan is $50 a month; see pricing.