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
npm install -g claude-dbcd your-projectclaude-db install --project- Run
claude-db use pgorclaude-db use mongodband follow the prompts to point Claude DB at your database. (inferred, check the README) - Run
claude-db doctorto check the setup, thenclaude-db statusto 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
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer