Claude Code
@db0-ai/claude-code is an MCP server that gives Claude Code persistent memory, state, and logging via 9 MCP tools. Knowledge survives across sessions — beyond what CLAUDE.md can hold.
Install
npx @db0-ai/claude-code init
This registers the MCP server in your Claude Code configuration.
Storage
By default, memories are stored at ~/.claude/db0.sqlite.
# SQLite (local file)
export DB0_STORAGE=./my-agent.db
# PostgreSQL (remote sync)
export DB0_STORAGE=postgresql://user:pass@host:5432/db
Environment variables
| Variable | Default | Description |
|---|---|---|
DB0_STORAGE |
~/.claude/db0.sqlite |
Storage path or PostgreSQL connection string |
DB0_AGENT_ID |
claude-code |
Agent identifier |
DB0_USER_ID |
system user | User identifier |
MCP tools
The server exposes 9 tools to Claude Code:
| Tool | Description |
|---|---|
memory_write |
Write a memory with scope and tags |
memory_search |
Search memories by query |
memory_list |
List memories with filters |
memory_delete |
Delete a memory |
state_checkpoint |
Save execution state |
state_restore |
Roll back to a checkpoint |
state_list |
List available checkpoints |
log_append |
Log a structured event |
log_query |
Query log entries |
Skills
The plugin includes built-in skills for:
- Memory inspection — browse and search the memory database
- Fact ingestion — manually write specific facts into memory
Hooks
Automated workflows can be configured via Claude Code hooks to trigger memory operations on events like file changes or session start.