Integrations

Claude Code

Install the Memsy plugin for Claude Code to get long-term memory via slash commands, skills, hooks, and a deep-retrieval subagent.

The @memsy-io/claude-code plugin wraps @memsy-io/mcp with Claude Code-native UX. The MCP server provides the tools and resources; the plugin adds the surface (slash commands, skills, hooks, agents) so Memsy is discoverable from inside Claude Code without you having to memorize the MCP tool names.

Plugin is strictly additive on top of the MCP — uninstalling the plugin leaves the MCP server working unchanged.

Install

Get an API key at app.memsy.io.

Set it in your shell (e.g. ~/.zshrc / ~/.bashrc):

export MEMSY_API_KEY=msy_...

Add the Memsy marketplace + install the plugin:

claude plugin marketplace add memsy-io/memsy
claude plugin install memsy@memsy

Restart Claude Code so it loads the plugin's MCP server.

Verify:

/memsy doctor

(or the namespaced form /memsy:memsy-doctor). You should see "Status: ok" with your active profile and actor_id.

Slash commands

/memsy <anything> — universal entry point

This is the one slash to remember. The memsy skill reads what you typed after the slash, classifies intent, and runs the matching workflow.

/memsy what did we decide about billing storage?     → searches memories
/memsy remember we picked Postgres for billing       → stores a memory
/memsy switch to work                                → switches profile
/memsy list                                          → lists recent memories
/memsy doctor                                        → runs the health check
/memsy setup                                         → first-time walkthrough
/memsy proactive on | /memsy proactive off           → toggle auto-save (session)
/memsy confirm on   | /memsy confirm off             → toggle ask-before-save
/memsy modes                                         → show current mode state
/memsy                                               → shows the menu above

In-session mode toggling: /memsy proactive, /memsy confirm, and /memsy autocontext change behavior for the current session only. The change is acknowledged immediately and applies to subsequent turns. To make the change persistent across Claude Code restarts, set the corresponding env var (MEMSY_PROACTIVE, MEMSY_CONFIRM_STORE, MEMSY_SESSION_AUTOCONTEXT) in your shell. /memsy autocontext is a special case — it fires at SessionStart, so the in-session toggle takes effect at the next launch, not the current one.

Routing rules: leading verbs (remember, save, switch to, list, doctor, setup) pick the intent; bare topics default to search — the safest fallback, since mis-storing creates noise that's hard to undo. When ambiguous, the router asks rather than guessing.

/memsy:<name> — explicit namespaced fast paths

CommandArgsDescription
/memsy:memsy-remember <text>free textStore a fact / decision / note
/memsy:memsy-org [name]profile nameSwitch active profile / org. No-arg lists profiles.
/memsy:memsy-setupnoneFirst-time walkthrough — pick default role(s), team(s), pin actor_id
/memsy:memsy-doctornoneHealth + identity diagnostic with per-error next-step pointers
/memsy:memsy-checkpointnoneReview and save save-worthy content from the current conversation
/memsy:memsy-indexnoneOne-shot ingest of a structured codebase summary

Skills (auto-fire on natural phrasing, no slash needed)

SkillFires onBehavior
memsy-recall"what did we decide", "remember when", "context on X", "do we have anything about Y"Extracts the topic from your message, calls memsy_search, surfaces results grouped by theme.
memsy-remember"remember that", "save this decision", "note that", "store this"Calls memsy_ingest with the substance. Refuses secret-shaped tokens, too-short content, transient scratch.
memsy-setupAny Memsy MCP failure or "memsy isn't working"Diagnoses by symptom (tool-not-found / 401 / ECONNREFUSED / Node missing), walks through the matching fix.

MCP-level prompts (work in Cursor / VS Code / Cline too)

These come from the MCP server itself, so they're available in any MCP host — not just Claude Code:

PromptDescription
/memsy:recall-contextStructured recall — Claude Code prompts you for topic and limit.
/memsy:proactive-modeSwitch the session into proactive recall mode for the rest of the conversation.
/memsy:setup-defaultsSame as /memsy-setup, host-agnostic version.
/memsy:summarize-and-storeSummarize the recent turns into a single memory and store it.

Hooks

SessionStart auto-context (opt-in)

When MEMSY_SESSION_AUTOCONTEXT=on is set in the shell that launches Claude Code, the plugin's SessionStart hook injects a "Memsy recall" context block before your first message — surfacing the most recent N memories from the active profile.

Env varDefaultPurpose
MEMSY_SESSION_AUTOCONTEXToffSet to on to enable auto-context.
MEMSY_SESSION_CONTEXT_LIMIT6How many memories to surface. Clamped to 1–20.

Turn it off by unsetting MEMSY_SESSION_AUTOCONTEXT and restarting Claude Code. The hook is silent unless explicitly opted in.

Proactive mode (opt-in)

When MEMSY_PROACTIVE=on is set in the launch shell, the SessionStart hook tells Claude to actively watch the conversation for save-worthy content — preferences, intents, plans, decisions, learnings — and store it without you having to say "remember that".

Example: with MEMSY_PROACTIVE=on, if you say:

I really like football and plan to go to the FIFA World Cup 2026. Find me ticket sites.

Claude answers the ticket question normally, then appends:

→ saved to Memsy: "I really like football and plan to go to the FIFA World Cup 2026" (event abcd1234)

The save piggybacks on the substantive answer — it doesn't interrupt.

What qualifies for proactive saves:

  • Preferences: "I like X", "my favorite is Y", "I prefer Z"
  • Intents / plans: "I want to do X", "I plan to Y", "I'm going to Z"
  • Decisions: "we decided X", "going with Y", "switching to Z"
  • Constraints discovered: "X doesn't work because Y"
  • Learnings: "turns out X", "the trick is Y"

What it skips: ephemeral chatter ("let me try X"), questions ("how do I X?"), already-stored content (no double-save), too-short content, and anything that looks like a secret.

Combine with MEMSY_CONFIRM_STORE=on to get watch + ask before storing each one — Claude proactively notices save-worthy content but checks with you before persisting.

Confirm-before-store mode (opt-in)

When MEMSY_CONFIRM_STORE=on is set in the launch shell, the SessionStart hook emits a [memsy modes: confirm-before-store] line into Claude's context. Every single-item save surface (memsy-remember skill on auto-fire, /memsy:memsy-remember <text> command, and the /memsy remember <text> smart-router branch) reads that line and asks for confirmation before calling memsy_ingest:

Memsy will store:
  picked Postgres for billing because it's already deployed

Save? (y / n / edit "<new text>")
  • y / "save it" → stores.
  • n / "don't" → not stored.
  • edit "..." → stores the edited text instead.

/memsy:memsy-checkpoint and /memsy:memsy-index are unaffected — they always confirm by design (they batch multiple memories and show the list before any save).

This is independent of MEMSY_SESSION_AUTOCONTEXT — you can enable confirmation without enabling auto-context (or vice versa). Both modes accept on/true/1/yes/enabled.

Why not auto-store on session end? Claude Code's SessionEnd and Stop hooks don't pipe their stdout back into Claude, so an auto-save hook can't actually call MCP tools to store anything. We ship /memsy-checkpoint as a user-initiated command instead — safer (no surprise noise) and actually functional.

Subagent: memsy-archivist

For deep multi-query retrieval ("what's our full thinking on X", "audit all our past decisions on Y"), Claude Code can delegate to the memsy-archivist subagent. It runs 3–5 query variants in parallel, dedupes, clusters by theme, and returns a structured summary instead of a flat list — plus an explicit list of gaps it noticed.

Subagents in Claude Code are invoked explicitly (they don't auto-fire from description matching). Trigger it by asking:

Do a deep memsy dive on rate limiting decisions across all our services.

Environment reference

VarPurpose
MEMSY_API_KEYRequired. Your msy_... key.
MEMSY_BASE_URLOverride API endpoint (default: https://api.memsy.io/v1).
MEMSY_PROFILESelect a named profile from ~/.memsy/config.json.
MEMSY_ACTOR_IDPin a stable actor_id (else derived from git config user.email or $USER@hostname).
MEMSY_DEFAULT_ROLE_IDSComma-separated default role filters for searches.
MEMSY_DEFAULT_TEAM_IDSComma-separated default team filters for searches.
MEMSY_SESSION_AUTOCONTEXTon to enable SessionStart auto-context. Default: off.
MEMSY_SESSION_CONTEXT_LIMITHow many memories the auto-context surfaces. Default: 6, clamped 1–20.
MEMSY_CONFIRM_STOREon to ask for confirmation before every single-item memory store (the auto-fire memsy-remember skill, the /memsy:memsy-remember command, and the /memsy remember <text> smart-router branch). Bulk operations like /memsy:memsy-checkpoint and /memsy:memsy-index already confirm by design, regardless of this flag. Default: off. Accepts on/true/1/yes/enabled.
MEMSY_PROACTIVEon to make Claude actively watch the conversation for save-worthy content — preferences, intents, plans, decisions, learnings — and store them via memsy_ingest without requiring explicit verbs like "remember that". Equivalent to running /memsy:proactive-mode once per session, but turned into the default. Combine with MEMSY_CONFIRM_STORE=on to get "watch + ask before storing each one." Default: off.

Full env reference: see the MCP docs.

Local development

Iterating on the MCP server itself? Point the plugin at your local build:

# 1. Build the MCP
cd /path/to/memsy/mcp
npm install && npm run build

# 2. Rewrite the plugin's .mcp.json to use the local build
cd /path/to/memsy/plugins/claude-code
./install.sh --dev /path/to/memsy

# 3. Restart Claude Code

Switch back to the published npm version:

./install.sh --prod

Troubleshooting

SymptomLikely causeFix
/memsy says "Unknown command"Plugin not installed or not enabledclaude plugin list — should show memsy enabled. If not, claude plugin enable memsy.
/memsy:memsy-doctor (or /memsy doctor) reports Status: ❌ with auth errorMEMSY_API_KEY not in the MCP child's envConfirm echo $MEMSY_API_KEY in the shell you launched claude from. Restart Claude from that shell.
Long delay before tools loaddist/server.js missing (local-dev mode)cd mcp && npm install && npm run build, restart Claude Code.
command not found: node in MCP logsinstall.sh --dev not run, Node not on PATHRe-run ./install.sh --dev /path/to/memsy and restart Claude Code.
SessionStart auto-context not appearingMEMSY_SESSION_AUTOCONTEXT not set, or session not restarted after settingexport MEMSY_SESSION_AUTOCONTEXT=on && claude — child inherits launch env.
Wrong org's memories surfacingActive profile mismatch/memsy switch <profile> or set MEMSY_PROFILE in your shell.

Uninstall

claude plugin uninstall memsy

The MCP server (@memsy-io/mcp) is unaffected — uninstalling the plugin only removes the slash commands, skills, hooks, and agent. The MCP keeps working in any other host where you've configured it (Cursor, VS Code, Cline, Continue.dev, Zed).