Shared team memory for Claude Code: what to share, what to keep private, and how to enforce it
How do you share team memory in Claude Code today? Claude Code's auto memory is machine-local, so a teammate's agent cannot see what yours learned. Until first-party shared team memory ships, the reliable pattern is two
How do you share team memory in Claude Code today? Claude Code's auto memory is machine-local, so a teammate's agent cannot see what yours learned. Until first-party shared team memory ships, the reliable pattern is two stores (personal and shared), an explicit promotion step, and access control enforced at retrieval — usually behind a small MCP memory server.
Claude Code starts every session with a fresh context window. Two things carry knowledge forward: CLAUDE.md files (instructions you write, shared through git if you commit them) and auto memory (notes Claude writes about your corrections and preferences). Per Anthropic's docs, auto memory is machine-local: it isn't shared across machines or cloud environments. That's fine for one person. For a team it leaves a gap, and it's the subject of a popular feature request, anthropics/claude-code#38536: an engineer pauses a task and someone else picks it up; an EM investigates an incident and files a ticket; a new hire starts with a blank slate. The context exists, but it's stuck in somebody's session.
After reading that thread and a lot of the tools in it, I think four design decisions matter more than which tool you pick.
Keep personal memory and shared team memory in separate stores
Don't use one pool with a visibility flag as the only boundary. Use two stores:
- Personal memory: a store only that engineer's agent can read: preferences, half-formed theories, scratch notes.
- Team memory: a store with explicit membership, where every entry has an author and a timestamp.
The value of two stores is that moving something from personal to shared becomes an explicit promotion step. That step is where you can add review, attribution, and an access list. It also stops a debugging session from silently turning into "team truth."
Record handoffs as stateful records, not session dumps
The easiest way to hurt a team with shared memory is to hand the next agent a stale investigation that reads like a fact. A commenter in the thread (@carltonawong) described the fix: make the unit of transfer a small, evidence-backed record rather than "all prior memory."
{
"kind": "handoff",
"task": "PAY-1423",
"owner": "[email protected]",
"observed_at": "2026-11-26T18:02:00Z",
"status": "in_progress",
"tried": [
{"approach": "retry with backoff", "outcome": "no effect; failure is deterministic"}
],
"next_steps": ["check idempotency key reuse in checkout-api"],
"supersedes": null,
"needs_verification": true
}
The receiving agent should treat needs_verification: true and an old observed_at as "re-check first." Without those fields, every handoff is a trust fall.
Enforce access control at retrieval, not in the prompt
A common first implementation scopes records inside the MCP server: each record has an owner_id and the tools filter on it. That prevents accidents but not a teammate's agent that talks to the database directly (one commenter, @iwo-szapar, reports exactly this and moved the check into Postgres row-level security with per-member, revocable tokens).
Whatever you build, apply these rules:
- The caller's identity comes from your auth layer, never from the model or the request body.
- The permission filter is part of the search itself, so the top-k is computed over what the caller may read. Filtering after ranking can return empty results for someone who can read only a small slice, and it can leak counts.
- Missing permission data means deny, not allow.
- Offboarding needs a plan. Revoking a credential stops future reads. A leaver's sensitive notes may also need to be removed from the store and its index (@dancenitra's point in the thread), so keep every shared entry attributable to its author.
Keep the MCP memory server's tool surface small
Memory servers tend to grow a tool per operation. One team in the thread measured 44 tools costing roughly 10K tokens of schema in every teammate's every session, and cut it by consolidating to a few generic record tools. Prefer a handful of tools (recall, record, handoff) and put a short instruction in CLAUDE.md saying when to call them: recall before planning a change, record after a decision or a revert.
An open-source example: HydraDB
Open-source HydraDB stores memories and knowledge in one database and exposes both through a single query endpoint, with hybrid (semantic + BM25) retrieval and an optional per-source acl. Here's the two-store pattern with it, using the Python SDK (pip install "hydradb-sdk>=2,<3"):
import json, os
from hydra_db import HydraDB
client = HydraDB(token=os.environ["HYDRADB_API_KEY"])
DB = "acme_eng"
# 1) Personal memory: one collection per engineer, never queried by anyone else.
client.context.ingest(
type="memory",
database=DB,
collection="user_alice",
memories=json.dumps([{
"id": "pay-1423-theory",
"title": "PAY-1423 working theory",
"text": "Retries don't help; suspect idempotency key reuse in checkout-api.",
"infer": False, # store verbatim
}]),
)
# 2) Promotion: an explicit write into the shared collection, with an ACL and author.
def promote(note_id: str, text: str, author: str, readers: list[str]):
client.context.ingest(
type="knowledge",
database=DB,
collection="team_knowledge",
app_knowledge=json.dumps([{
"id": f"decision-{note_id}",
"title": f"Decision / finding: {note_id}",
"kind": "custom",
"provider": "claude-code",
"external_id": note_id,
"timestamp": "2026-11-26T18:02:00Z",
"fields": {"kind": "custom", "body": text, "author": author},
"metadata": {"service": "checkout-api"},
"acl": readers, # who may retrieve this source
}]),
)
promote("pay-1423", "Root cause: idempotency key reused across retries. Fix in #8812.",
author="[email protected]", readers=["domain:acme.com"])
# 3) Retrieval: shared + the caller's own memories, filtered by the caller's identity.
def recall(question: str, caller_email: str):
return client.query(
database=DB,
collections=["team_knowledge", f"user_{caller_email.split('@')[0]}"],
query=question,
type="all",
query_by="hybrid",
acl=[caller_email], # derive from your session, never from the model
)
Three honest caveats from the docs:
-
aclis opt-in at query time. A query with noacl, an empty list, or["*"]isn't filtered, so set it server-side from your auth session. - There's no built-in team promotion workflow or review gate that I know of. Promotion is just the second write above; if you need approvals, build them in front of it.
- The Claude Code plugin (hydradb-claude-code) does per-user automatic recall and capture via hooks. It isn't a turnkey team setup, and you should decide what it's allowed to capture before pointing it at a shared project.
Wire recall behind an MCP tool (HydraDB also ships an MCP server, hydradb-mcp), add a four-line rule to CLAUDE.md, and you have the pattern. The store matters less than the four decisions above. Which of them has hurt your team most? I'm curious what I've missed.
FAQ: shared team memory for Claude Code
Does Claude Code have shared team memory?
Not as a first-party feature. CLAUDE.md in the repo is shared through git; auto memory is machine-local and is not shared across machines or cloud environments. Shared, searchable memory usually means an MCP memory server the whole team points at.
What's the difference between CLAUDE.md and auto memory?
CLAUDE.md is instructions you write (conventions, commands, architecture). Auto memory is notes Claude writes from your corrections and preferences. Neither is a governed team store with promotion, ACLs, or handoff state.
How should an MCP memory server enforce permissions?
The caller's identity should come from your auth layer, and the permission filter should run as part of retrieval so top-k only includes what that person may read. Filtering inside the tool wrapper, or after ranking, is not enough.
When should something be promoted from personal memory to team memory?
When it's a decision, a gotcha, or a handoff another engineer should trust — and only then, as an explicit write into the shared store, with an author, a timestamp, and an access list. Half-formed theories stay personal.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.