Skip to main content

Claude Code Plugin

Automatically save conversation facts and inject context into prompts.

← Back to MCP Setup


Installation​

npx @audaxic/memory-claude install

This will:

  • Prompt for your Audaxic general API key (saved to ~/.config/audaxic/config.json)
  • Copy the plugin to ~/.claude/skills/audaxic-memory/
  • Configure the directory-aware Audaxic MCP proxy

The plugin auto-loads on your next Claude Code session.

If you install from the plugin marketplace instead of the CLI, also run npx @audaxic/memory-claude key set --global once so the MCP proxy can read your general key from the shared config.

Get your API key from: memory-dashboard.audaxic.com


How It Works​

The plugin combines three mechanisms:

Skill → auto-search on questions​

An Agent Skill (skills/audaxic-memory/SKILL.md) instructs Claude to search Audaxic Memory before answering questions about your past decisions, projects, and preferences — then answer directly from the results.

MCP server → trusted memory tools​

The plugin configures a local stdio proxy (.mcp.json). The proxy resolves the key for the session's project directory and connects to the hosted MCP server, giving Claude search_memories / add_memory / get_memories tools scoped to the right project.

Hooks → background saving​

  • UserPromptSubmit → inject.mjs — parks the prompt in a per-message file, injects context via additionalContext (a passive enhancement — injection may be deprioritized by Claude Code, which is why the skill + MCP path exists), and drains one stale parked message.
  • Stop → capture.mjs — parks the assistant response and drains up to 3 stale parked messages. A parking file is deleted only after POST /add confirms receipt; failed sends stay parked and retry on later hooks.

Architecture​

┌──────────────────────────────────────────────────────────────┐
│ Claude Code │
│ │
│ User types prompt │
│ │ │
│ ▼ │
│ UserPromptSubmit ──► inject.js │
│ │ ├─ buffer user prompt to disk │
│ │ └─ POST /search → additionalContext │
│ ▼ │
│ Claude responds │
│ │ │
│ ▼ │
│ Stop ──────────────► capture.js │
│ ├─ buffer assistant msg to disk │
│ └─ if buffer >= 30 → POST /add │
└──────────────────────────────────────────────────────────────┘

API Key​

The plugin uses your API key in this order:

  1. AUDAXIC_API_KEY — explicit environment override
  2. directoryKeys entry matching the session project directory (CLAUDE_PROJECT_DIR)
  3. CLAUDE_PLUGIN_OPTION_API_TOKEN — the general key from the plugin's userConfig
  4. apiKey — the general key in ~/.config/audaxic/config.json

All scripts fail silently if no key is found — they never block Claude Code.

Directory-specific API keys​

Give each project its own memory project by mapping a directory to an API key:

npx @audaxic/memory-claude key set --global
cd C:\projeler\my-project
npx @audaxic/memory-claude key set
npx @audaxic/memory-claude key list
npx @audaxic/memory-claude key resolve

The shared config:

{
"apiKey": "ak_general...",
"directoryKeys": {
"C:\\projeler\\my-project": "ak_project_a...",
"C:\\projeler\\another-project": "ak_project_b..."
}
}

Matching uses the nearest parent directory. Git worktrees fall back to the main checkout's key. The config is stored with mode 0600; keys never go into a repository. Each parked message stores the key it was captured with, so parallel sessions cannot route one directory's memory to another project.

See Directory-Specific API Keys for the full precedence, worktree behavior, and parallel-session rules.


Uninstall​

rm -rf ~/.claude/skills/audaxic-memory

API Endpoints​

EndpointMethodDescription
https://api.memory.audaxic.com/searchPOSTSearch memories for context injection
https://api.memory.audaxic.com/addPOSTSave conversation messages in batch

Behavioral Triggers​

AUTO-SEARCH before:​

  • Making architectural decisions
  • Adding new dependencies
  • Fixing bugs (check for prior solutions)
  • Starting new sessions (load preferences)

AUTO-SAVE after:​

  • User states a preference
  • Decision with rationale made
  • Complex bug fixed
  • Project conventions learned

DO NOT save:​

  • Temporary state, debug info, secrets

Content Rules​

  • One fact per memory
  • Natural language, not keywords
  • Include reasoning, not just outcomes
  • Be specific for better semantic matching

Lifecycle​

Add → Search → Update (delete + re-add) → Delete (when obsolete)


Troubleshooting​

MCP tools not appearing​

  1. Check that .mcp.json points to the local proxy:
    cat ~/.claude/skills/audaxic-memory/.mcp.json
  2. Verify Node and npm are available:
    node --version
    npx --version
  3. In Claude Code, open /mcp and reconnect audaxic-memory.
  4. On Windows, use plugin version 1.2.6 or newer. Older builds failed to launch npx from the proxy.

Directory key is not being used​

npx @audaxic/memory-claude key resolve

If it shows the general key, add a mapping for the directory or a parent. If it shows the environment override, unset AUDAXIC_API_KEY for that process. The MCP proxy resolves the key when the connection opens; reconnect /mcp after changing a key.

Plugin not loading​

  1. Verify the plugin exists: ls ~/.claude/skills/audaxic-memory/
  2. Verify API key is set: cat ~/.config/audaxic/config.json
  3. Restart Claude Code after installing the plugin

Context not being injected​

  1. Check that inject.mjs exists in the plugin directory
  2. Verify API key is valid at memory-dashboard.audaxic.com
  3. Check network connectivity to api.memory.audaxic.com

Messages not saving​

  1. Check that capture.mjs exists in the plugin directory
  2. Check the buffer file for pending messages
  3. Verify API endpoint is reachable