# claude-db [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/Avijit07x/claude-db  
**GitHub Stars:** 237  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/claude-db

## Description
Free, open-source memory for Claude Code. Remembers why decisions were made and maps your code. Your own database (SQLite, Postgres or MongoDB), no cloud, no subscription.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/Avijit07x/claude-db), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install -g claude-db
```

2. Run:

```sh
claude-db install --project
```

## Documentation

## What claude-db does

claude-db adds project memory to Claude Code. It preserves decisions, failed approaches, and working rules between conversations, so later chats can retrieve context instead of starting from an empty session. Retrieval is selective: a prompt receives one or two relevant memories when they match, rather than loading the entire history.

It also builds a relationship map for a codebase. The map can answer which symbols define, call, or import another symbol. Import tracking covers TypeScript, JavaScript, Python, Go, Rust, Java, and Kotlin. This makes the server useful for projects where understanding code relationships would otherwise require repeated searches and file inspection.

## How it works

After installation in a Git repository, Claude Code hooks handle capture and recall without requiring a separate long-running process. Existing project information can be loaded with the `flush` and `scan` commands. The `/cdb-scan` command provides the corresponding codebase-mapping workflow, while `/catchup` and `/handoff` support returning to unfinished work and leaving context for a later chat or teammate.

SQLite is the default local store. A project can instead use Postgres, MongoDB, or Turso, including a shared database when memory needs to be available across machines. The `claude-db use <url>` command selects a database connection.

Two optional operations use Claude Haiku through the user's own Claude login: creating facts from finished chats and choosing memories for each prompt. They can be disabled independently with `claude-db distill off` and `claude-db pick off`.

## Setup and configuration

Requirements are Node.js 22.16 or newer and a Git repository. Install the package globally, change to the target project, and register it with Claude Code:

```bash
npm install -g claude-db
cd your-project
claude-db install --project
```

Restart Claude Code after installation. The normal capture and recall flow is hook-based, so no additional service needs to be started. Use `claude-db status` to inspect the connection and recorded information, and `claude-db doctor` to check the setup. The shorter `cdb` alias is available for commands.

Privacy controls include disabling update checks with `updates: off`, and excluding sensitive content before storage. `.env`, `secrets/`, `node_modules`, and `.git/` are excluded; text inside `<private>...</private>` is removed; API keys and tokens are redacted before data is stored or sent.

## Tools and capabilities

- Retain decisions, dead ends, and rules across Claude Code chats.
- Select matching memories for a new prompt.
- Scan supported languages to map symbol definitions, calls, and imports.
- Catch up on previous work with `/catchup`.
- Write a short continuation note with `/handoff`.
- Inspect setup and recorded data with `status` and diagnose problems with `doctor`.
- Switch between local and remote-capable database backends with `use`.

The package also exposes MCP tools for its documented memory and codebase features, alongside its command-line interface.

## Limitations and notes

The documented workflow targets Claude Code and requires a Git repository. Automatic memory processing is not entirely local when the two Claude Haiku-backed features are enabled, although both features have separate switches. Database choice affects where memory is stored: SQLite keeps it on the machine, while Postgres, MongoDB, and Turso support other deployment arrangements.

The project includes benchmarks that compare its behavior with plain `grep`; codebase mapping is therefore a targeted aid rather than a replacement for every search workflow. Existing data must be loaded explicitly with `flush` and `scan` after setup if it should be available immediately.

_Full upstream README: https://allmcps.com/mcp/claude-db/readme_

