Set up context-memory in Claude Code.
context-memory installs as a Claude Code plugin: it bundles the MCP server and the hooks that capture and recall your project’s memory automatically.
An API key and a handful of commands and you’re running. Each step is explained in full in the walkthrough below.
-
export CONTEXT_MEMORY_API_KEY="cm_your_key_here"
-
/plugin marketplace add SlovaApplications/claude-plugins
/plugin install context-memory@slova
/reload-plugins
Run them one at a time. When prompted, choose Install for you (user scope);
/reload-pluginsthen activates the MCP server and hooks with no restart. -
/context-memory:bootstrap-memory all
Requirements
- The latest Claude Code, on macOS, Linux, or Windows.
- Node.js 18 or newer on your
PATH. The plugin’s hooks run on Node. - A context-memory API key, which starts with
cm_. Here’s how to get one:
1Authenticate
The plugin’s MCP server reads your key from the CONTEXT_MEMORY_API_KEY environment variable. Add the export to your shell config (~/.zshrc, ~/.bashrc, or whichever shell you use) so it persists across sessions:
export CONTEXT_MEMORY_API_KEY="cm_your_key_here"
Then reload your shell (source ~/.zshrc) or open a new terminal before launching Claude Code. The key is read at MCP-server start, so if it’s unset, the server fails
to load and the hooks stay silent.
2Install the plugin
Run these inside Claude Code, one at a time. First add the Slova marketplace:
/plugin marketplace add SlovaApplications/claude-plugins
Then install the plugin:
/plugin install context-memory@slova
When the install prompt asks who to install for, choose Install for you (user scope).
Finally, activate it in your current session. /reload-plugins loads the plugin’s
MCP server and hooks with no restart — and the MCP server comes on automatically, so there’s no
separate step to switch it on:
/reload-plugins
3Seed your memory optional
A fresh install starts empty. Run the bootstrap command once to seed it from your history. It reads your past Claude Code transcripts and turns what’s worth keeping into Contexts and Topics (the individual memories it saves, and the syntheses that group related ones). You approve the full set before it writes anything:
/context-memory:bootstrap-memory all
all sweeps every project you’ve worked on. Omit it to scope the seed to your current
repo.
Your transcripts never leave your machine. They’re read locally, and only the knowledge you approve is saved. Running it again is safe: it skips any session it has already processed.
The memory loop
Once it’s installed, there’s nothing to invoke. context-memory runs a few hooks around your Claude Code sessions, all in the background, inside the agent’s context:
- At session start, in a git repo, it hands Claude this repo’s prior “where you left off” summary and the project facts you’ve built up.
- On every prompt, it searches your store and prepends the handful of memories most relevant to what you just asked.
- At the end of a turn, it nudges Claude to save what it learned: the decisions, dead ends, and gotchas worth keeping.
Claude can also reach your memory directly through the plugin’s MCP tools (save_context, search_contexts, get_context, and the rest), so you can just
ask it to remember or look something up.
Update the plugin
Updates are done from the /plugin menu inside Claude Code:
- Run
/plugin - Press → to the Installed tab
- Use ↑ ↓ to select context-memory Plugin · slova
- Press Enter
- Move down to Update now
- Press Enter
The new version loads automatically on your next session. To apply it in the current session
without restarting, run /reload-plugins.
Rotate or replace your key
Keys are managed on your account page — log in with the email and password from your invite. Rotation is zero-downtime if you do it in this order:
- Create a new key. It’s shown once — copy it then.
- Swap it into
CONTEXT_MEMORY_API_KEYin your shell config and reload your shell. - Start a Claude Code session. Back on the account page, the new key’s row flips from waiting for first use… to seen — that’s your confirmation the swap worked.
- Revoke the old key.
Lost your key? Same page: log in and create a new one — old keys can’t be re-shown. Forgot your password? Reset it by email; a password reset never touches your keys, so a running agent keeps working.
Remove or disable the plugin
Uninstall it completely:
/plugin uninstall context-memory@slova
Prefer to keep it installed but paused? Open /plugin → Installed, select context-memory, and choose Disable. You can re-enable it later without reinstalling.
Your saved memory is untouched either way. It lives in your hosted workspace, not in the plugin.
Configuration
Everything is environment variables, read at server start and on every hook. Only the key is required.
| Variable | Default | Purpose |
|---|---|---|
CONTEXT_MEMORY_API_KEY | required | Your cm_ bearer token. |
CONTEXT_MEMORY_PREFETCH_TIMEOUT | 1.5 | Seconds to wait for the per-prompt search before giving up. |
CONTEXT_MEMORY_PREFETCH_LIMIT | 5 | Max contexts injected per prompt. |
CONTEXT_MEMORY_PREFETCH_MAX_BYTES | 2000 | Hard cap on injected text size per prompt. |
CONTEXT_MEMORY_RECALL_TIMEOUT | 2 | Seconds the session-start recall waits per call. |
CONTEXT_MEMORY_ORIENTATION_LIMIT | 25 | Max project facts injected at session start. |
CONTEXT_MEMORY_RECALL_MAX_BYTES | 4000 | Hard cap on the surfaced recall text. |
CONTEXT_MEMORY_TOPIC_STOP_TIMEOUT | 2 | Seconds the topic-synthesis check waits before giving up. |
Troubleshooting
- Hook errors every turn (
node: not found). The plugin’s hooks run on Node, and it isn’t on thePATHClaude Code launched from. Install Node.js 18+ (see Requirements) and confirmnode --versionworks in the same shell you start Claude Code from, then restart. - No MCP tools / no recall. Run
/mcpto confirmcontext-memoryis listed and connected. If it’s connected but still silent, the key isn’t in the environment Claude Code launched from. Re-checkecho $CONTEXT_MEMORY_API_KEY, reload your shell, and restart Claude Code. If it isn’t listed at all, reinstall with user scope (Step 2). - Nothing happens, no errors. By design. Every hook fails open: a missing key, an unreachable backend, or a timeout makes it inject nothing rather than break your prompt. So silence usually means the key isn’t set or the backend wasn’t reachable.
- Still stuck? Email [email protected].