claude-db
Persistent memory for Claude Code on your own database: capture of decisions and context plus a code graph, injected into every prompt
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Installs hooks into project settings and reads session transcripts
- Builds a graph over the codebase files
- Writes data to a local or external database
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/claude-dbDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Install the tool
npm install -g claude-dbSet up memory: npm install -g claude-db, then in the project root claude-db install --project and restart Claude Code. For the code graph run claude-db scan once.
Other ways from the author
npm install -g claude-db
cd your-project
claude-db install --projectRestart Claude Code after install. The --project flag scopes memory to one repository.
This is third-party code. Review the repository files before installing.
What it does
The tool gives Claude Code memory that survives sessions and stores it in a database of your choice: SQLite, PostgreSQL or MongoDB. Capture and recall run as hooks, so decisions and context are saved on their own and injected into every new prompt. A separate command builds a code graph: proper symbol parsing for TypeScript, JavaScript, Python, Go, Rust and Ruby, and pattern-based reading for other languages. Through MCP the agent gets code search modes: a live grep, usages lookup, explain and a path between symbols.
Who it is for. For developers who do not want to re-explain the project layout and past decisions to the agent every time.
Good fit when
- The agent forgets context between sessions and re-derives the codebase
- You want a history of decisions and reasons kept next to the code
- You want fast usages and symbol relations lookup through the agent
Not a fit when
- The project is a one-off and cross-session memory is not needed
- You cannot set up a local database or write into the project directory
Example request
Why does capture read the transcript? Look up past decisions on this in memoryLimitations
It works with Claude Code through hooks and MCP. Data lives in your database: with SQLite nothing leaves the machine, while PostgreSQL or MongoDB need access to that database. The install command writes .claude/settings.local.json and .mcp.json, and the latter holds a machine-specific path that is worth adding to .gitignore.
How to disable. Remove the claude-db entries from .claude/settings.local.json and .mcp.json, then drop the global package with npm uninstall -g claude-db.
Security check
- Installs hooks into project settings and reads session transcripts
- Builds a graph over the codebase files
- Writes data to a local or external database
README in short
The README frames the problem: the agent starts each session from zero and re-derives the code. claude-db keeps decisions and context in your database and injects them into every prompt via hooks. Install: npm install -g claude-db, then claude-db install --project, where --project scopes memory to one repository and writes local settings. The claude-db scan command builds a code graph and exposes text, usages, explain and path modes over MCP, and a re-scan re-parses only changed files.
FAQ
Where is data stored?
In a database of your choice: SQLite locally, or PostgreSQL or MongoDB. With SQLite nothing leaves the machine.
Do I run the search by hand?
No. Capture and recall are hooks, so context is injected into every prompt automatically. The claude-db scan command is only for the code graph.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything