Support shared memory across multiple projects (not just global or per-project)
Problem
Claude Code's auto-memory system currently has two levels:
- Global (
~/.claude/CLAUDE.md) — applies to every project - Project-specific (
~/.claude/projects/<path>/memory/) — scoped to a single project directory
There is no way to share memory across a subset of projects. In practice, a lot of knowledge is relevant to multiple (but not all) projects — e.g. shared infrastructure, team conventions, API configurations, deployment patterns, or organizational context that spans several repos.
Current workaround
Duplicating memory entries across project-specific memory directories, or putting everything into global CLAUDE.md even when it only applies to a few projects. Both approaches are fragile and lead to stale or noisy memory.
Proposed solution
Introduce a shared memory directory that can be referenced by multiple projects. For example:
- A configurable list of shared memory paths per project (in
.claude/settings.jsonorCLAUDE.md) - Or named memory namespaces (e.g.
~/.claude/shared-memory/<namespace>/) that projects can opt into
Example configuration:
{
"memory": {
"shared": ["~/.claude/shared-memory/sediwork"]
}
}
This would allow memories like "Jira project key is SDW", "Bitbucket repo is kupuhealth/frontend", or "team uses pnpm in frontend, npm in backend" to live in one place and be available to all related projects — without polluting the global scope.
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
A
UserPromptSubmithook can inject shared context from a common location into any project:Add to global
~/.claude/settings.json:Then organize shared memory by topic:
For subset sharing (e.g., only frontend projects), add a project filter:
This gives you the missing middle layer: global memory for everything, shared-memory directories for project groups, and project-specific memory for individual repos.
Built a plugin for this: claude-memory-bridge
It adds a namespace layer between global and project memory at
~/.claude/shared-memory/<namespace>/. Projects subscribe to namespaces, so you can share conventions across related projects without polluting global scope.Works with Claude Code CLI and Cowork desktop. MCP server over stdio, no database — reads/writes Claude's native memory format directly.
Would love feedback if anyone tries it out! Issues and suggestions welcome 🙏
The problem is very real, and your solution is great for high level users. That said, if a non-programmer is using regular Claude AI, it seems a "simple" tagging feature would be also useful. Many projects have nothing to do with coding.
still relevant in the current version (2.1.191)
still relevant in the current version (2.1.220)
A current workaround is to give a selected group of repositories the same explicit memory scope instead of copying files between Claude auto-memory directories.
I maintain GoodMemory. With v0.7.1, install the Claude Code integration once, then enable each related repository with the same
workspaceId:Those repositories use the same exact workspace scope in the installed local SQLite store, while unrelated repositories keep their own derived workspace IDs. The integration supplies scoped recall through Claude hooks plus read-only MCP trace/stats/inspection; durable writeback remains opt-in and can be reviewed or disabled.
Important boundary: this does not merge or modify Claude Code's native
~/.claude/projects/<path>/memory/directories, and it does not implement the proposed native shared-memory configuration. It is a parallel local memory scope that can cover the practical multi-repo case today. ManualCLAUDE.mdpolicy and repository instructions should still remain the explicit source of truth.Disclosure: @hjqcan maintains GoodMemory. This comment was drafted with Codex assistance under @hjqcan's authorization; the commands and scope behavior were checked against the current v0.7.1 CLI and public repository.