Claude-Mem
Persistent memory plugin for Claude Code and other coding agents, with MCP tools to search past sessions
Project memory and a code-symbol graph for Claude Code, stored in your own SQLite, Postgres or MongoDB
By Avijit Dey (individual) TypeScript Local · stdio Knowledge and memoryDeveloper toolsDatabases
45 popularity score ★ 233 ↓ 113/wk
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
git clone https://github.com/Avijit07x/claude-db.git
cd claude-db && npm install && npm run buildclaude mcp add claude-db -- node '<ABSOLUTE_PATH_TO_CLONE>/dist/mcp/server.js'{
"mcpServers": {
"claude-db": {
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/mcp/server.js"
]
}
}
}{
"mcpServers": {
"claude-db": {
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/mcp/server.js"
]
}
}
}{
"servers": {
"claude-db": {
"type": "stdio",
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/mcp/server.js"
]
}
}
}[mcp_servers.claude-db]
command = "node"
args = ["<ABSOLUTE_PATH_TO_CLONE>/dist/mcp/server.js"]gemini mcp add --scope user claude-db node -- '<ABSOLUTE_PATH_TO_CLONE>/dist/mcp/server.js'CLAUDE_DB_URL |
Optional: Database address: a postgres:// or mongodb+srv:// URL or an absolute SQLite path; overrides the config file. Unset means SQLite at ~/.claude-memory/memory.db. |
|---|
claude-db gives Claude Code a record of past work on a project: decisions taken, approaches that failed, bug fixes and standing rules. Hooks capture this when a chat ends and add matching entries to later prompts; the MCP server is the part Claude queries on demand when the injected lines are not enough.
The server (dist/mcp/server.js in the npm package, registered as "memory" by the installer) exposes six tools at version 0.12.3, confirmed in src/mcp/server.ts. Memory is read in two steps: search returns a short index of matches (10 by default, up to 50 with limit), filterable by kind, tag and project, and get_observations fetches full records for at most 25 ids per call. timeline lists recent entries in order, remember stores a rule the user states, and forget deletes an entry by id.
The sixth tool, find_usages, answers code questions from a symbol graph built from imports in TypeScript, JavaScript, Python, Go, Rust, Java and Kotlin. It has four modes: usages (the default, graph plus grep), explain, path (the route between two symbols, given as target) and text (a plain live git grep). It returns up to 100 matching lines by default, capped at 500, and searches the whole repository unless a path is given.
Storage is SQLite at ~/.claude-memory/memory.db by default; a Postgres or MongoDB address can be set instead so several machines or a team share one store.
| Runtime | Node.js 22+ |
|---|
Node 22.16 or newer and a git repository for the project (find_usages only works inside a git working tree). Install globally with npm install -g claude-db, then run claude-db install --project in the repository, which writes the MCP entry and hooks, and restart Claude Code. Postgres or MongoDB need their driver installed beside it first (npm install -g pg or npm install -g mongodb); neither ships with the package.
The package installs no MCP program of its own name: its bins (claude-db, cdb) are a CLI, and the server is a file inside the package started with node, which claude-db install wires up for Claude Code. It is built around Claude Code's hooks; with another client only the six on-demand tools work, without automatic capture or per-prompt recall. get_observations takes at most 25 ids per call; find_usages returns at most 500 lines. On MongoDB Atlas the vector index is not created for you and must be added by hand, otherwise vector scoring runs in process. Machines sharing one database should all run 0.11.0 or newer.
Suits a developer who works in Claude Code across many sessions on the same repositories and wants past decisions and a symbol lookup kept locally, with no hosted service or account. The Postgres or MongoDB option fits a team or several machines sharing memory. Less suited to users of other MCP clients, since capture and recall depend on Claude Code hooks, or to anyone who wants nothing sent to a model beyond the chat: two optional features call Claude Haiku and must be turned off.
searchget_observationstimelinerememberforgetfind_usages