Claude Code

@db0-ai/claude-code is an MCP server that gives Claude Code persistent memory, state, and logging via 10 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 10 tools to Claude Code:

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

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.