axsDocs
Guides

Claude Code team memory: CLAUDE.md in git vs MCP

Share Claude Code memory with your team: commit a project CLAUDE.md to git, deploy a managed CLAUDE.md, or add shared memory over MCP and hooks. The tradeoffs.

Claude Code has no built in team memory, but it has one team channel: a project CLAUDE.md committed to git, which every teammate's Claude reads at the start of each session. For lessons that come up in chat, knowledge across repos, or rules that must hold, teams add a shared memory service that Claude Code reaches through MCP and hooks.

What Claude Code remembers on its own

The Claude Code memory docs list these layers:

LayerLocationWho sees it
Managed policy/etc/claude-code/CLAUDE.md on Linux, /Library/Application Support/ClaudeCode/CLAUDE.md on macOSAll users on the machine
Project./CLAUDE.md or ./.claude/CLAUDE.md, plus .claude/rules/The team, through source control
User~/.claude/CLAUDE.md and ~/.claude/rules/Only you, all projects
Local./CLAUDE.local.md, added to .gitignoreOnly you, this project
Auto memory~/.claude/projects/<project>/memory/Only you, this machine

A few details matter for teams:

  • CLAUDE.md files can import other files with @path/to/file, up to four hops deep. Imports keep a file organized, but imported files still load into context.
  • Anthropic suggests keeping each CLAUDE.md under 200 lines, and moving rules for part of the codebase into path-scoped rules in .claude/rules/.
  • Auto memory is where Claude saves your corrections on its own. It is machine-local and not shared across machines or cloud environments. When you teach your Claude something, your teammates' Claude does not learn it.

Option 1: CLAUDE.md in git

Commit a project CLAUDE.md with build and test commands, code style and architecture notes. Every clone gets it.

This is enough when:

  • the team works in one or a few repos,
  • the rules are about the code in that repo,
  • someone is willing to turn chat corrections into pull requests.

It costs nothing, changes go through review, and history is in git. It falls short when knowledge is not about one repo (servers, accounts, deploy steps), when lessons from chat never reach the file, or when the file grows past what the agent follows well.

Option 2: Managed CLAUDE.md

IT or DevOps can place a managed CLAUDE.md on every developer machine with MDM, Group Policy or Ansible, or put the content in managed-settings.json with the claudeMd key. Developers cannot exclude it. It is good for company wide guidance. The docs themselves say to use it for guidance and to enforce rules with managed settings such as permissions.deny. It is also one file for everyone, updated by whoever owns the rollout.

Option 3: A shared memory over MCP

Claude Code supports MCP servers, so you can point every teammate at one memory server with tools to search and save memories. Every agent then reads and writes the same store, across repos and machines.

The tradeoffs: over MCP alone, Claude has to decide to search, and it rarely searches for what it does not know it is missing. If you run the server yourself, you also own access control, backups and uptime.

Option 4: MCP plus hooks

Claude Code hooks run on session start, on each prompt and around tool calls. A memory service that uses them can put the right memories into the session without the agent asking, and can check rules before a command runs. axs brain works this way.

How axs brain does it

axs brain adds hooks and an MCP server to Claude Code through the axs@axs plugin:

  • Always-on rules at session start, the memories of a project on the first work there, and matching memories on every prompt.
  • Lessons saved from chat. When someone corrects the agent, axs brain asks it to save a short memory. It checks for near-duplicates and refuses secrets.
  • Spaces. Every person has a private space, teams add shared spaces, and Access sets who reads and who writes. See Memories and spaces.
  • Team rules. Rules can block, ask first or remind. Rules a member or agent proposes wait for an owner in To confirm.
  • History. Every change to a memory is kept and can be undone in the dashboard.

The same memory works in Codex and Cursor, so a lesson saved in Claude Code reaches teammates on other agents too. See Shared memory for AI coding agents.

Setup

Install the axs CLI, then:

axs login
axs install claude

axs install claude installs the axs@axs plugin with its own token, so Claude Code needs no browser login. Start a new session. Without the CLI, use the plugin directly:

claude plugin marketplace add axs-sh/claude; claude plugin install brain@axs

To bring your existing CLAUDE.md along, run /axs:import (or /brain:import). It splits the file into one memory per rule or fact and shows the list before writing anything. See Import.

Team costs €20 per person a month with a 14 day free trial; bots are free. See Plans and billing.

FAQ

Does Claude Code share memory between teammates?

Only through files you share. A project CLAUDE.md in git reaches everyone. Auto memory and ~/.claude/CLAUDE.md stay on each person's machine.

Should CLAUDE.md be committed to git?

The project CLAUDE.md should be, since that is how the team shares it. Personal notes for one project go in CLAUDE.local.md, which you add to .gitignore.

When is CLAUDE.md in git enough?

When the knowledge is about the code in that repo and someone keeps the file current. Small teams in one repo often need nothing more.

Can I keep CLAUDE.md and use axs brain?

Yes. Claude Code keeps reading your CLAUDE.md files. axs brain adds memories and rules on top. Your files stay unchanged after an import.

On this page