DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to share Claude Code memory across machines on Postgres with Claude DB

Move Claude DB from local SQLite to a shared Postgres or MongoDB database.

Short answer: npm install -g claude-db; then cd your-project; claude-db install --project. All steps.

Credentials. A shared Postgres or MongoDB connection needs database credentials, so store them outside the repo and never commit them.

Who it is forA developer or small team who uses Claude Code on more than one machine and wants one memory store.

The problemThe default SQLite store lives on one machine, so decisions and maps made on a laptop are missing on a desktop.

The outcomeMemory is kept in a Postgres or MongoDB database you run, so every machine using Claude DB reads the same store.

What you need first

  • Node 22.16 or newer
  • A git repository for your project
  • Claude Code installed and able to run hooks
  • Optional: a Postgres or MongoDB database if you want to share memory across machines

Steps

  1. npm install -g claude-db
  2. cd your-project
  3. claude-db install --project
  4. Run claude-db use pg or claude-db use mongodb and follow the prompts to point Claude DB at your database. (inferred, check the README)
  5. Run claude-db doctor to check the setup, then claude-db status to confirm what is recorded.

Prompt for your agent

In the repo <repo-path>, switch claude-db to the database <pg-or-mongodb> and run claude-db doctor. Expected output is a passing setup check and a status line showing the chosen database. Verify that claude-db status reports the same memory count on a second machine after one chat is recorded.

Caveat. The README gives the command only as a table entry, so the exact connection steps are in the documentation site and you should confirm them there.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for Avijit07x/claude-db and "Share Claude Code memory across machines on Postgres"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer