Nex Memory Plugin for Claude Code: Auto-Recall and Auto-Capture for Organizational Context

The Nex Memory Plugin for Claude Code gives Claude persistent memory across sessions by connecting it to your organization's context graph. It uses Claude Code hooks to automatically recall relevant context before each prompt and capture new knowledge after each session, so Claude always knows about your customers, deals, and team communications.


How It Works


The plugin integrates through three Claude Code hooks. The SessionStart hook loads baseline organizational context when you begin a new Claude Code session. The UserPromptSubmit hook runs before each prompt, filtering your question through a recall system that queries the Nex API to find relevant context from your CRM, email, Slack, and other connected data sources. The context is injected as additional context so Claude can reference real customer data in its responses. The Stop hook captures new knowledge after each session by sending conversation summaries to Nex for future recall.


Key Features


Auto-Recall: Every prompt you type is automatically checked against your Nex context graph. A recall filter determines if the query needs organizational context and, if so, queries the Nex /ask endpoint to retrieve relevant information about customers, companies, deals, and communications. This context is injected before Claude processes your prompt.


Auto-Capture: When a Claude Code session ends, the plugin automatically captures new knowledge from the conversation. It strips out any previously injected context blocks, then sends the remaining conversation content to the Nex /text endpoint asynchronously. This means every insight Claude generates gets saved back to your organizational knowledge base.


Slash Commands: The plugin also provides manual slash commands. Use /recall to explicitly search your Nex context graph for specific information, and /remember to manually save important context from the current session.


Optional MCP Tools: For advanced use cases, the plugin can also register the full Nex MCP server, giving Claude Code access to all 47 Nex tools for direct interaction with your context graph including searching records, managing relationships, creating tasks, and more.


Getting Started


You need Node.js 18 or later, a Nex API key from app.nex.ai, and the Claude Code CLI installed. Clone the nex-as-a-skill repository from github.com/nex-crm/nex-as-a-skill, navigate to the claude-code-plugin directory, and run npm install followed by npm run build. Then set your NEX_API_KEY environment variable and configure the hooks in your Claude Code settings at ~/.claude/settings.json. The plugin will automatically start recalling and capturing context in every Claude Code session.


Why Use the Claude Code Plugin Instead of Just the MCP Server


The Nex MCP server requires Claude to explicitly decide to call tools. The Claude Code plugin works automatically through hooks, meaning context recall and capture happen without Claude needing to make tool calls. This results in a more seamless experience where Claude always has the right context without any extra steps. You can also use both together for the best of both worlds: automatic context via hooks plus full tool access via MCP when Claude needs to perform specific actions like creating records or managing relationships in your context graph.