Claude Code
Connect Claude Code to Memax via MCP and hooks. Full guide with setup, verification, and troubleshooting.
Claude Code has the deepest Memax integration. You get both MCP (on-demand recall and push) and hooks (ambient context injection).
Quick setup
The fastest path:
memax setup claude-codeThis configures both MCP and hooks in one command.
Manual setup
MCP Server
Add the MCP server to your Claude Code configuration.
{
"mcpServers": {
"memax": {
"command": "npx",
"args": ["-y", "memax-cli", "mcp", "serve"]
}
}
}{
"mcpServers": {
"memax": {
"command": "npx",
"args": ["-y", "memax-cli", "mcp", "serve"]
}
}
}Project-level config gives Claude Code access to Memax only in that project.
Restart Claude Code to pick up the new MCP server.
Verify by asking Claude Code: "What Memax tools do you have access to?"
It should list memax_recall, memax_push, memax_search, and other tools.
Hooks (ambient context)
memax hook install claude-codeThis creates a hook that runs before every prompt, injecting relevant context from your Memax hub.
What Claude Code can do with Memax
With both MCP and hooks configured:
- Automatic context — relevant docs, decisions, and conventions appear before every prompt
- On-demand recall — Claude Code calls
memax_recallwhen it needs specific knowledge - Push discoveries — Claude Code can push new knowledge (debug solutions, architecture decisions) to your hub
- Search and browse — Claude Code can explore your knowledge base
- Team awareness — if you're on a team hub, Claude Code sees shared knowledge
Example workflow
You: "Fix the auth token refresh bug"
Claude Code sees:
<memax-context>
Auth system uses JWT with 1h access tokens and 30d refresh tokens.
Refresh endpoint: POST /api/auth/refresh
Known issue: race condition when multiple tabs refresh simultaneously.
</memax-context>
Claude Code: "I can see from your knowledge base that there's a known
race condition in the refresh flow. Let me look at the endpoint..."Troubleshooting
Claude Code doesn't see Memax tools
- Check that
memax whoamireturns your account - Verify the MCP config JSON is valid
- Restart Claude Code
- Ask Claude Code: "Search for memax tools" (triggers deferred tool loading)
Hook is slow
The hook has a 500ms latency budget. If it's consistently slow:
memax hook statusCheck your network connection to api.memaxlabs.com.
Claude Code uses deferred tool loading — Memax tools may not be visible until the agent searches for them. The tool names (memax_recall, memax_push) are designed for high discoverability.