From mem9
Initializes, repairs, or checks Mem9 memory plugin setup in a Claude Code environment. Verifies Node.js, provisions API keys, and writes auth config.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mem9:setupThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when the user asks to set up Mem9, diagnose why memory is not working, or manually retry initialization.
Use this skill when the user asks to set up Mem9, diagnose why memory is not working, or manually retry initialization.
node is installed and version >= 18.${CLAUDE_PLUGIN_DATA} is available.${CLAUDE_PLUGIN_DATA}/auth.json.Provision an API key and write ${CLAUDE_PLUGIN_DATA}/auth.json:
set -euo pipefail
plugin_data_dir="${CLAUDE_PLUGIN_DATA}"
test -n "$plugin_data_dir"
node -e 'process.exit(Number(process.versions.node.split(".")[0]) >= 18 ? 0 : 1)'
plugin_version="unknown"
if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json" ]; then
plugin_version="$(node -e 'const fs=require("node:fs"); const data=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); process.stdout.write(data.version || "unknown");' "${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json")"
fi
response="$(curl -sf --max-time 8 -X POST \
-H "User-Agent: mem9-plugin/claude-code/${plugin_version}" \
https://api.mem9.ai/v1alpha1/mem9s)"
api_key="$(printf '%s' "$response" | node -e 'const fs=require("node:fs"); const data=JSON.parse(fs.readFileSync(0,"utf8")); process.stdout.write(data.id || "");')"
test -n "$api_key"
auth_file="${plugin_data_dir}/auth.json"
mkdir -p "$(dirname "$auth_file")"
node -e 'const fs=require("node:fs"); const authPath=process.argv[1]; const apiKey=process.argv[2]; const payload={base_url:"https://api.mem9.ai",api_key:apiKey,created_at:new Date().toISOString(),source:"manual_setup_skill"}; fs.writeFileSync(authPath, JSON.stringify(payload, null, 2) + "\n");' "$auth_file" "$api_key"
Node.js 18+.${CLAUDE_PLUGIN_DATA} is missing, tell the user this skill must run from the Mem9 Claude plugin environment.npx claudepluginhub mem9-ai/mem9 --plugin mem9Diagnoses and resolves Memsy MCP tool failures (auth errors, network issues, missing tools) and guides through setup steps.
Stores a single fact, preference, or instruction to Mem9 when the user explicitly asks Claude to remember something.
Installs, configures, or upgrades ClaudeMemory: checks gem version, runs doctor, inits databases, adds version markers, and reports status.