Claude Code Plugin
Automatically save conversation facts and inject context into prompts.
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 /addconfirms 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:
AUDAXIC_API_KEY— explicit environment overridedirectoryKeysentry matching the session project directory (CLAUDE_PROJECT_DIR)CLAUDE_PLUGIN_OPTION_API_TOKEN— the general key from the plugin'suserConfigapiKey— 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
| Endpoint | Method | Description |
|---|---|---|
https://api.memory.audaxic.com/search | POST | Search memories for context injection |
https://api.memory.audaxic.com/add | POST | Save 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
- Check that
.mcp.jsonpoints to the local proxy:cat ~/.claude/skills/audaxic-memory/.mcp.json - Verify Node and npm are available:
node --versionnpx --version
- In Claude Code, open
/mcpand reconnectaudaxic-memory. - On Windows, use plugin version
1.2.6or newer. Older builds failed to launchnpxfrom 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
- Verify the plugin exists:
ls ~/.claude/skills/audaxic-memory/ - Verify API key is set:
cat ~/.config/audaxic/config.json - Restart Claude Code after installing the plugin
Context not being injected
- Check that
inject.mjsexists in the plugin directory - Verify API key is valid at memory-dashboard.audaxic.com
- Check network connectivity to
api.memory.audaxic.com
Messages not saving
- Check that
capture.mjsexists in the plugin directory - Check the buffer file for pending messages
- Verify API endpoint is reachable