Claude Code remembers your project.
db0 makes it remember you.
Claude Code's built-in memory is scoped per git repo. Teach Claude your preferences once — commit style, tool choices, output format — and db0 carries them into every project, on every machine.
10 MCP tools. No signup, no API key. Same db0 database accessible from CLI, web inspector, OpenClaw, or any TypeScript project.
Quick start
Run in Claude Code:
claude mcp add --transport stdio db0 -- npx -y @db0-ai/claude-codeOr add to your project's .mcp.json:
{
"mcpServers": {
"db0": {
"command": "npx",
"args": ["-y", "@db0-ai/claude-code"]
}
}
}10 MCP tools immediately. No signup, no API key. Persistent SQLite at ~/.claude/db0.sqlite.
/plugin marketplace add db0-ai/db0 /plugin install db0@db0-ai-db0
Adds MCP tools plus skills (/db0:inspect, /db0:ingest) and hooks.
db0_.Why Claude Code still loses knowledge
What db0 adds
Out of the box, with no further configuration.
How it works in practice
You don't need to learn tool names. Just talk to Claude the way you normally would.
MCP Tools
All 10 tools are available to Claude Code immediately after installation.
| Tool | Description |
|---|---|
| db0_memory_write | Store a fact with scope, tags, summary, and optional superseding |
| db0_memory_search | Semantic search across memories with scope/tag filtering |
| db0_memory_list | List memories by scope |
| db0_memory_get | Get a specific memory by ID |
| db0_memory_update | Update a fact — finds the old version, supersedes it, writes the new one |
| db0_memory_delete | Delete a memory |
| db0_memory_stats | Memory statistics by scope and status |
| db0_state_checkpoint | Create a state checkpoint |
| db0_state_restore | Restore the most recent checkpoint |
| db0_log_query | Query structured log entries |
Memory superseding in action
When facts change, old memories are preserved but excluded from search. Full audit trail.
You: "remember I prefer dark mode" db0_memory_write({ content: "User prefers dark mode", scope: "user" }) You: "actually I switched to light mode" db0_memory_update({ oldContent: "User prefers dark mode", newContent: "User prefers light mode", scope: "user" })
Memory scopes
Claude Code's built-in memory is equivalent to agent scope — per-project, per-machine. The user scope is what's new: preferences that follow you everywhere.
| Scope | Lifetime | Example |
|---|---|---|
| user | Permanent, cross-project | Commit style, tool choices, output format |
| agent | Permanent, this project | Architecture, patterns, project conventions |
| session | Current session | In-progress decisions, temporary context |
| task | Current task | Scratch work, intermediate results |
Cross-device memory with Postgres
Claude Code's built-in memory is stored by absolute filesystem path. If your username, home directory, or mount point differs between machines — and it almost always does — the memory directory hash is different. Same project, different machine, zero shared memory.
db0 uses the database connection as the source of truth, not the filesystem path. Point to any hosted Postgres with pgvector:
{
"mcpServers": {
"db0": {
"command": "npx",
"args": ["-y", "@db0-ai/claude-code"],
"env": {
"DB0_STORAGE": "postgresql://user:pass@your-host/db0"
}
}
}
}Configuration
Environment variables for the MCP server.
| Variable | Default | Description |
|---|---|---|
| DB0_STORAGE | ~/.claude/db0.sqlite | Storage path. Use a PostgreSQL connection string for cross-device sync. |
| DB0_AGENT_ID | claude-code | Agent identifier for scoping memories. |
How it fits
The plugin is an MCP server that wraps the db0 harness. Same SDK, same database, different entry point.
Claude Code │ │ MCP protocol (stdio) │ ▼ db0 MCP Server (@db0-ai/claude-code) │ ├── memory tools → db0 harness → memory() ├── state tools → db0 harness → state() └── log tools → db0 harness → log() │ ▼ SQLite (local) or PostgreSQL + pgvector (cloud)
How it compares
db0 vs. other Claude Code memory solutions.
| db0 | total-recall | Nemp | MemoryGraph | mem0 | CLAUDE.md | |
|---|---|---|---|---|---|---|
| Storage | SQLite / Postgres | Unknown (tiered) | JSON files | SQLite / Neo4j | Vector DB (cloud) | Plain text |
| Semantic search | Yes (built-in embeddings) | Unknown | Term expansion | Fuzzy matching | Yes (LLM-powered) | grep only |
| Memory scopes | 4 (task/session/user/agent) | Tiered | Flat | Flat | 3 (user/session/agent) | None |
| Superseding | Yes (audit trail) | Correction propagation | No | No | No | Overwrites |
| State management | Checkpoints + branching | No | No | No | No | No |
| Structured logging | Yes | No | No | No | No | No |
| Requires LLM | No | Unknown | No | No | Yes | No |
| Requires account | No | No | No | No | Yes | No |
| Cross-device sync | Yes (Postgres) | No | No | No | Yes (cloud) | git |
| L0 summaries | Yes (auto-generated) | No | No | No | No | No |
Part of the db0 ecosystem
The same memory database is compatible with every db0 package.