Acontext

Claude Code

Skill memory plugin for Claude Code — auto-capture, auto-learn, cross-session skill sync

The Acontext plugin for Claude Code gives your agent cross-session skill memory. It captures conversations, extracts tasks, distills reusable Markdown skills, and syncs them to Claude Code's skill directory for automatic loading.

Quick Start

Add the marketplace and install the plugin

Inside Claude Code, run:

/plugin marketplace add memodb-io/Acontext
/plugin install acontext

Set your environment variables

Get an API key from dash.acontext.io and export it in your shell profile (~/.bashrc or ~/.zshrc):

export ACONTEXT_API_KEY="<your-api-key>"
export ACONTEXT_USER_ID="<your-login-email>"

Restart Claude Code

The plugin loads automatically. Every conversation is captured, tasks are extracted, and skills are distilled and synced to ~/.claude/skills/.

How It Works

Session 1: User talks to agent
  └→ Messages stored to Acontext session (incremental capture)
  └→ CORE extracts structured tasks
  └→ Learning Space distills skills as Markdown

Session 2: User returns
  └→ Skills synced to ~/.claude/skills/ (native loading)
  └→ Claude Code auto-loads skill files from its skill directory
  └→ New messages captured (incremental capture)
  └→ Skills updated (auto-learn)

The plugin hooks into Claude Code's lifecycle via MCP:

  • On session start — Syncs learned skills to ~/.claude/skills/ so Claude Code loads them natively
  • On session end — Stores new conversation messages, triggers task extraction and skill distillation
  • On demand — Exposes MCP tools the agent can call mid-session (search skills, trigger learning, etc.)

Skills are synced as Markdown files that Claude Code loads natively. You can inspect, modify, and share these files directly in ~/.claude/skills/.

Configuration

All settings are via environment variables:

Env VarDefaultDescription
ACONTEXT_API_KEYRequired. Acontext API key
ACONTEXT_BASE_URLhttps://api.acontext.app/api/v1API base URL
ACONTEXT_USER_ID"default"Scope sessions per user
ACONTEXT_LEARNING_SPACE_IDauto-createdExplicit Learning Space ID
ACONTEXT_SKILLS_DIR~/.claude/skillsDirectory where skills are synced
ACONTEXT_AUTO_CAPTUREtrueStore messages after each agent turn
ACONTEXT_AUTO_LEARNtrueTrigger skill distillation after sessions
ACONTEXT_MIN_TURNS_FOR_LEARN4Minimum turns before triggering auto-learn

For self-hosted Acontext, set ACONTEXT_BASE_URL to your local API endpoint (e.g. http://localhost:8029/api/v1).

MCP Tools

The plugin registers these tools that your agent can call during conversations:

ToolDescription
acontext_search_skillsSearch through skill files by keyword
acontext_get_skillRead the content of a specific skill file
acontext_session_historyGet task summaries from recent past sessions
acontext_statsShow memory statistics (sessions, skills, configuration)
acontext_learn_nowTrigger skill learning from the current session

Troubleshooting

Plugin not loading

  • Ensure ACONTEXT_API_KEY is exported in your shell profile
  • Verify the plugin is installed: /plugin list
  • Check Claude Code logs for [info] acontext: or [warn] acontext: messages

No skills appearing

  • Skills appear in ~/.claude/skills/ after the first session ends
  • Check that ACONTEXT_AUTO_LEARN is not set to false
  • Ensure at least ACONTEXT_MIN_TURNS_FOR_LEARN turns have occurred

API returns 401

  • Verify your API key with acontext whoami
  • Re-login with acontext login

Next Steps

Last updated on

On this page