agent-memory — Claude Code MCP server: what it does, how to install
A local project memory server for AI coding agents. It stores decisions and codebase facts in Markdown and lets you review changes before they land.
claude mcp add agent-memory -- npx -y @xchucx/agent-memoryWhat agent-memory does
agent-memory keeps task state, decisions, conventions, pitfalls, and module facts in Markdown within a Git repository. An agent can propose a memory update, stage it, show the exact diff, and apply it after review. Branch-aware storage and write-time scanning help keep project memory organized and secret-safe.
The server runs locally rather than using cloud storage or a vector database, with Markdown serving as the canonical record. It provides three MCP tools plus a CLI, and supports merging concurrent section edits. Claude Code can connect through npx -y @xchucx/agent-memory using claude mcp add. For the reader, the practical difference is clear: memory changes remain visible in Git instead of appearing as silent edits.
What it helps with
- preserve decisions across agent sessions
- record conventions for individual modules
- review memory changes before applying them
- retrieve stored project facts with
fetch - scan new entries for secrets and PII
Example prompts for the agent
- Record the decision about the library choice and stage it for review.
- Show me the pending memory diff, then apply it after I approve it.
- Use
fetchto find the conventions for this module before editing the code.
How to install agent-memory
Platform CLI
claude mcp add agent-memory -- npx -y @xchucx/agent-memoryPlatform CLI
codex mcp add xchucx-agent-memory -- npx -y @xchucx/agent-memoryConfig file
{
"mcpServers": {
"xchucx-agent-memory": {
"command": "npx",
"args": [
"-y",
"@xchucx/agent-memory"
]
}
}
}Config file
{
"servers": {
"xchucx-agent-memory": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@xchucx/agent-memory"
]
}
}
}Platform CLI
gemini mcp add xchucx-agent-memory npx -y @xchucx/agent-memoryStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about agent-memory
How do I install agent-memory in Claude Code?
Run claude mcp add agent-memory -- npx -y @xchucx/agent-memory.
What does agent-memory do?
It gives coding agents local, Git-backed project memory for decisions, conventions, task state, and module facts, with reviewable updates.
Does agent-memory require cloud storage or a vector database?
No. It runs locally and keeps Markdown in the repository as the canonical memory source.