Claude DB logo

Claude DB

Local or shared project memory for Claude Code, with cross-chat recall and code relationship mapping.

Install Claude DB

Run the project’s own setup commands, in order.

Setup steps from the project

claude-db installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install -g claude-db
    
  2. 2. Run
    claude-db install --project
    

Overview

The claude-db MCP server gives Claude Code persistent project memory backed by SQLite, Postgres, MongoDB, or Turso. Hooks capture information from completed chats and select relevant memories for later prompts, while code scanning maps definitions, calls, and imports across several languages. Use it when an agent needs continuity between sessions or a searchable map of an existing codebase. Storage stays in your selected database, with optional Claude Haiku processing for distillation and prompt-level memory selection.

Use cases

  • Resume work with decisions and dead ends from earlier chats
  • Map definitions, callers, and imports in an existing codebase
  • Share project memory across machines with a remote database
  • Leave a concise handoff for a teammate or later session

Key features

  • Cross-chat memory for Claude Code
  • Selective prompt-level memory recall
  • Code relationship mapping across seven languages
  • SQLite, Postgres, MongoDB, and Turso storage
  • Sensitive-data filtering and token redaction
  • CLI diagnostics, scanning, and database selection

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

19/19 checks healthy over the last 45d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars237Stargazers on the source repository.
Last commit7d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Claude DB works

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:

Terminal
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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Claude DB

claude-db is an MCP server that connects Claude Code to a project memory database backed by SQLite, Postgres, MongoDB, or Turso. Its main capabilities are saving and recalling decisions, dead ends, and rules across chats, plus mapping code relationships such as definitions, calls, and imports.

Install it globally with `npm install -g claude-db`, enter a Git repository, and run `claude-db install --project`. Restart Claude Code afterward. Node.js 22.16 or newer is required, and existing project data can be loaded with `claude-db flush` and `claude-db scan`.

claude-db supports SQLite, Postgres, MongoDB, and Turso. SQLite is the default local database, while the other options can support sharing memory across machines. Select a database connection with `claude-db use <url>`.

claude-db excludes `.env`, `secrets/`, `node_modules`, and `.git/`, removes text enclosed in `<private>...</private>`, and redacts API keys and tokens before storage or transmission. Its Claude Haiku-backed distillation and memory-selection features can also be turned off separately.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewClaude DB AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/claude-db?style=directory)](https://allmcps.com/mcp/claude-db)
HTML Embed
<a href="https://allmcps.com/mcp/claude-db"><img src="https://allmcps.com/api/badge/claude-db?style=directory" alt="Claude DB on AllMCPs" /></a>