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 API key (saved to ~/.config/audaxic/config.json)
  • Copy the plugin to ~/.claude/skills/audaxic-memory/
  • Configure the Audaxic MCP server (.mcp.json with your API key)

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

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 bundles the Audaxic MCP server (.mcp.json), giving Claude search_memories / add_memory / get_memories tools. MCP tool results are trusted by Claude, so memory recall actually reaches the answer.

Hooks → background saving​

  • UserPromptSubmit → inject.mjs — buffers your prompt and injects context via additionalContext (a passive enhancement — injection may be deprioritized by Claude Code, which is why the skill + MCP path exists)
  • Stop → capture.mjs — buffers the assistant's response; flushes to POST /add at 30 messages

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. CLAUDE_PLUGIN_OPTION_API_TOKEN — set via the plugin's userConfig prompt during /plugin install
  2. ~/.config/audaxic/config.json — shared config used by all Audaxic integrations

The key is also written into the plugin's .mcp.json at install time (mode 0600) so the MCP server authenticates automatically.


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​

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