nexusmem — Claude Code MCP server: what it does, how to install
Local-first memory engine for coding assistants that tracks shell history, exit codes, and git diffs. Keeps agents from repeating broken steps and dead ends.
claude mcp add nexusmem -- npx -y nexusmemWhat nexusmem does
NexusMem records developer activity into a local SQLite file on disk. The tool logs shell executions alongside their true exit codes, per-file git patches, and markdown docs. When an agent queries its background, the ranker returns relevant items fitted to a specified token budget without sending project data to cloud services.
Custom hooks expand this tracking to the interactive shell and the agent environment. The shell hook captures the working directory with status codes, while the Claude Code hook associates test executions with prior file edits. Commands are automatically scrubbed of credentials before being stored.
Running on Node 20 will fail immediately due to missing better-sqlite3 binaries. You need git and Node version 22 or newer on your machine. An Ollama instance is entirely optional and only comes into play for vector search.
What it helps with
- record terminal command execution with real exit codes
- surface past solutions for broken builds and tests
- retrieve relevant git patches within strict token limits
- prevent coding assistants from repeating failed shell commands
Example prompts for the agent
- Search NexusMem history to see why our build failed earlier and how it was resolved
- Find previous commands in nexusmem related to process spawn failures on Windows
How to install nexusmem
Platform CLI
claude mcp add nexusmem -- npx -y nexusmemPlatform CLI
codex mcp add nexusmem -- npx -y nexusmemConfig file
{
"mcpServers": {
"nexusmem": {
"command": "npx",
"args": [
"-y",
"nexusmem"
]
}
}
}Config file
{
"servers": {
"nexusmem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"nexusmem"
]
}
}
}Platform CLI
gemini mcp add nexusmem npx -y nexusmemStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about nexusmem
How do I install nexusmem in Claude Code?
Run claude mcp add nexusmem -- npx -y nexusmem to register the MCP server with Claude Code.
Why use nexusmem instead of plain git log?
Git records only final commits, losing failed intermediate shell attempts. NexusMem keeps command logs, non-zero exit codes, and prior edit context so the agent knows what failed before.
What dependencies are required for nexusmem?
You need git and Node version 22 or higher. Node 20 is not supported, while Ollama is completely optional if you want semantic retrieval.