claude-mem
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
supermemoryai/claude-supermemory is a plugin that gives Claude Code persistent memory across sessions, powered by Supermemory. Use it when you want context and session history retained and searchable, shipping agents, commands and MCP servers.
Claude Code
> /plugin marketplace add supermemoryai/claude-supermemory> /plugin install supermemory@supermemory-plugins
GitHub Copilot
$ copilot plugin marketplace add supermemoryai/claude-supermemory$ copilot plugin install supermemory@supermemory-plugins
Persistent memory for Claude Code, powered by Supermemory
Conceptual overview. Some command names in the image predate the current plugin; see Commands for what's available now.
A Claude Code plugin that gives your agent persistent memory across sessions using Supermemory. Your agent remembers what you worked on, across sessions and across projects.
Install · Features · How it works · Shared containers · Configuration · Commands · Privacy
Requires Node.js 18+ on your PATH. The memory hooks run as Node scripts.
/plugin marketplace add supermemoryai/claude-supermemory
/plugin install supermemory
Set your API key (get one at console.supermemory.ai), or just start a session and let browser login handle it:
export SUPERMEMORY_CC_API_KEY="sm_..."
Migrating from the old claude-supermemory plugin
That plugin was renamed to supermemory, so it won't update in place. Migrate with:
/plugin marketplace update supermemory-plugins
/plugin install supermemory@supermemory-plugins
Then, only if you still have the old plugin installed, remove it:
/plugin uninstall claude-supermemory@supermemory-plugins
| 🧠 Direct recallWhen authenticated, the hook searches substantive prompts before Claude sees them and injects fresh matches. No permission prompt or MCP tool call. | 🔎 Hosted MCP toolssearch_memory, listSpaces, whoAmI, and more are available through the same credentials as the hooks, subject to your Claude Code permissions. |
| 💾 Auto captureAt the end of a session, the Stop hook saves new conversation content in the background. It asks Supermemory to retain durable context rather than transient Git state. | 🏷️ Shared repo memoryAutomatic captures use the repository container shared with Codex and OpenCode and carry sm_scope: personal metadata. |
🧭 Deep multi-container searchThe context-gatherer subagent fans out several searches across a project's containers and returns a synthesized brief. | ⚙️ Project configPer-repo settings, API keys, and container tag overrides via .claude/.supermemory-claude/config.json. |
🗂️ Codebase index/supermemory:index saves architecture, conventions, and how to run into this project's container. | 👋 Session contextLoads profile facts at session start and shows a welcome-back notice when you return to a project after 6+ hours. |
On Claude Code 2.1.250, local marketplace install/update and the SessionStart and UserPromptSubmit command hooks were verified, but claude plugin validate rejects the recall mod's classic.SessionStart event. The strip is not available on that version; other older versions and install sources have not been verified.
Claude Code supports hooks and MCP servers. supermemory registers four hooks, in lifecycle order:
SessionStart → UserPromptSubmit → PreToolUse → Stop
| Step | Hook | Event | What it does |
|---|---|---|---|
| 1 | session-start | SessionStart | Bootstraps auth and loads profile context plus a welcome-back notice. It does not install a statusline; an old auto-installed one is removed. |
| 2 | recall-directive | UserPromptSubmit | Searches Supermemory directly with the prompt and injects fresh matches, deduplicated within the session. |
| 3 | recall-approve | PreToolUse | Displays read-only Supermemory activity without approving calls or changing their input. |
| 4 | capture | Stop | Saves the completed conversation delta in the background. |
By default, recall is performed by the hook itself, not delegated to the model. It searches
substantive prompts when authenticated, without waiting for Claude to choose a tool call.
Setting recallDirective switches to advisory mode: the hook stops searching and instead
tells Claude when it should decide to search on its own.
The hooks are tolerant: if Supermemory is unreachable, the API key is missing, or anything else fails, they exit cleanly without breaking your Claude Code session. A capture that fails is reported the next time a session starts.
MCP tool calls follow your Claude Code permission rules. The PreToolUse hook
only displays recall activity and records search counts; it does not approve
calls or change their input. The index and status commands do not grant blanket
shell access. Direct recall and capture still run as the lifecycle hooks you
enabled when installing the plugin.
The MCP declaration passes https://mcp.supermemory.ai/mcp literally to the
bundled proxy as its default endpoint. The proxy uses that argument for the
standard hosted configuration, shares the hooks' authentication, and supplies
the current repository's default container. Existing SUPERMEMORY_MCP_URL,
custom API backend settings, API keys, stored credentials, and OAuth refresh
remain supported. Running the proxy without the argument retains its previous
endpoint resolution.
The optional recall-strip mod observes classic.SessionStart and
classic.UserPromptSubmit. It calls next(e) with the original event, reads
returned memory facts for its terminal display, and returns the same result
object. It does not replace the first user message, edit permission settings,
register agents, or alter tool inputs. Its ui.render hook adds the expandable
recall strip above the terminal prompt. The Directory's static policy check may
still require a reviewer to confirm this pass-through behavior.
The credential-related review holds require review of the existing Supermemory
sign-in flow, not a replacement of users' keys. Credentials are used for the
configured Supermemory API and MCP endpoints. No new user_config credential
flow is introduced by this change. Directory acceptance and publisher ownership
must be confirmed in the submission portal; local validation is not approval.
Claude Code, Codex, and OpenCode all generate the same container tag for a given repository, so new memories are shared:
repo_<project-name>__<remote-hash> default container for capture and MCP memory tools
sm_scope: personal metadata on automatic captures
The hash is derived from the normalized Git remote, so clones share memory while
same-named repositories do not collide. Repositories without a remote fall back to
a local path identity. Linked worktrees (git worktree add, Conductor, Claude
Squad, claude --worktree) resolve to the main checkout's identity, with or
without a remote. Set SUPERMEMORY_ISOLATE_WORKTREES=true to use the worktree
path instead of the remote identity.
Unlike Codex, this plugin does not read older per-tool legacy containers
(codex_user_*, opencode_project_*, and similar); it only ever uses the single
unified identity above, overridden via the project namespace setting
or the compatible repoContainerTag / SUPERMEMORY_REPO_TAG settings.
By default the hooks make no Supermemory calls (no profile, no prompt recall, no capture) for sessions nobody is typing into. They decide this only from signals Claude Code sets:
| Session | Signal | Opt back in |
|---|---|---|
| Background subagent results relayed to the main session | the <task-notification> turn (origin.kind: "task-notification" in the transcript; scheduled fires and inbox messages still count as yours) | captureSubagents: true / SUPERMEMORY_CAPTURE_SUBAGENTS=true |
claude -p and GitHub Action runs | CLAUDE_CODE_ENTRYPOINT is claude-code-github-action, or sdk-cli while that Claude Code process is itself in print mode (CLAUDE_CODE_SESSION_ATTENDED=0, or -p / --print / --output-format on older builds) | captureHeadless: true / SUPERMEMORY_CAPTURE_HEADLESS=true |
Subagents never run these hooks: Claude Code fires only SubagentStart and
SubagentStop inside them, so their work reaches memory only through the
main session. Claude Code's own helper prompts (session titles, prompt
suggestions, the auto mode classifier) never run these hooks either.
An interactive claude that merely inherited CLAUDE_CODE_ENTRYPOINT=sdk-cli
(for example one started from a shell a claude -p run spawned) stays on.
Agent SDK apps (sdk-ts, sdk-py), including editors such as Zed that drive
Claude Code over ACP, are treated as interactive and keep recall and capture.
To keep an SDK app out of memory, run it without this plugin: leave "user"
out of the SDK's settingSources, or disable the plugin for that app.
Sessions started by Conductor or Vibe Kanban (CONDUCTOR_WORKSPACE_PATH,
CONDUCTOR_SESSION_ID or VK_WORKSPACE_ID set) are real user work and stay
on even though they run through claude -p; set captureOrchestrated: false
or SUPERMEMORY_CAPTURE_ORCHESTRATED=false to turn them off. Crystal sets no
such variable, so its claude -p sessions count as headless.
For swarms that replay one task across many sessions, two local indexes in
~/.supermemory-claude (hashes only) cut repeats:
[opening prompt already captured from this machine: <hash>] marker in place
of the prompt. Opt out with dedupeOpeningPrompt: false /
SUPERMEMORY_DEDUPE_OPENING_PROMPT=false.recall-cache.json instead of calling the API. A
failed or timed-out search is never cached. Opt out with dedupeRecallQueries: false /
SUPERMEMORY_DEDUPE_RECALL_QUERIES=false.| Variable | Purpose |
|---|---|
SUPERMEMORY_CC_API_KEY | Your Supermemory API key (browser auth is preferred). |
SUPERMEMORY_API_URL | Override the Supermemory REST base URL; custom URLs default to legacy compatibility. |
SUPERMEMORY_MCP_URL | Override the hosted MCP endpoint (default https://mcp.supermemory.ai/mcp). |
SUPERMEMORY_AUTH_URL | Override the browser-auth base URL. |
SUPERMEMORY_REPO_TAG | Project-scope override; used when no project scope setting is set. |
SUPERMEMORY_ISOLATE_WORKTREES | Set to true to key the project container on the worktree path instead of the Git remote. |
SUPERMEMORY_DEBUG | Set to true to enable debug logging. |
SUPERMEMORY_CAPTURE_SUBAGENTS | true/1/yes/on or false/0/no/off; overrides captureSubagents. |
SUPERMEMORY_CAPTURE_HEADLESS | true/1/yes/on or false/0/no/off; overrides captureHeadless. |
See 12 claude-supermemory alternatives
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
Gives Claude Code long-term memory through Hindsight. It recalls relevant past context before answering, retains durable facts as the agent learns them, and reflects over stored memory.
Local-first memory for Claude Code. It stores conversations verbatim in a private palace you can search before answering about past work, people, projects, or decisions, with optional shared-brain hub setup.
Gives Claude Code a private memory that stays on your machine. It stores past conversations word for word, so you can ask what was decided, what happened before, or who was involved and get the original context back. It can also hand tasks to other agents.
Install it with the command on its page. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it