用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mem9-ai/mem9-claude-plugin --skill mem9-setup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Search shared memories from past sessions. Use when the user's question could benefit from historical context, past decisions, project knowledge, or team expertise.
Save important information to shared memory. Use when the user asks you to remember, note down, or save something for future sessions.
正在显示 SKILL.md
基于 SOC 职业分类
| name | mem9-setup |
| description | Setup Mem9 persistent memory. Triggers: set up mem9, install mem9, configure memory, enable memory. |
| context | fork |
| allowed-tools | Bash, Read, Write, Edit |
You are an automated installer. Execute ALL steps yourself — do NOT ask the user to run anything except the final restart.
python3 -c "
import json, os, sys
path = os.path.expanduser('~/.claude/settings.json')
if not os.path.exists(path):
print('NO_SETTINGS')
sys.exit(0)
with open(path) as f:
cfg = json.load(f)
tid = cfg.get('env', {}).get('MEM9_TENANT_ID', '')
if tid:
print(f'ALREADY_CONFIGURED:{tid}')
else:
print('NEEDS_TENANT')
"
ALREADY_CONFIGURED:<id> → Skip to Step 3.NEEDS_TENANT or NO_SETTINGS → Continue to Step 2.curl -s -X POST https://api.mem9.ai/v1alpha1/mem9s
Extract the id field from the JSON response. This is the MEM9_TENANT_ID.
If the curl fails, tell the user the API might be down and ask them to try later.
Read ~/.claude/settings.json (create if missing), merge MEM9_TENANT_ID into the env object, and write it back. Preserve all existing settings.
python3 -c "
import json, os, sys
tenant_id = sys.argv[1]
path = os.path.expanduser('~/.claude/settings.json')
# Read existing or start fresh
cfg = {}
if os.path.exists(path):
with open(path) as f:
cfg = json.load(f)
# Merge env
env = cfg.get('env', {})
env['MEM9_TENANT_ID'] = tenant_id
cfg['env'] = env
# Write back
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, 'w') as f:
json.dump(cfg, f, indent=2)
f.write('\n')
print(f'OK: MEM9_TENANT_ID={tenant_id} written to {path}')
" "REPLACE_WITH_ACTUAL_TENANT_ID"
Replace REPLACE_WITH_ACTUAL_TENANT_ID with the actual tenant ID from Step 2a.
Try CoWork first (preferred), fall back to marketplace if CoWork is not installed.
cowork install mem9-ai/mem9-claude-plugin --plugin
If cowork is not installed, fall back to Option B.
claude plugin marketplace add mem9-ai/mem9
claude plugin install mem9@mem9
If claude plugin marketplace add fails with "already exists", that's fine — skip it and continue to install.
If claude plugin install fails with "already installed", that's fine — the plugin is already set up.
Summarize what was done:
<tenant_id>~/.claude/settings.json updated with MEM9_TENANT_IDThen tell the user:
All done! Just restart Claude Code to activate Mem9 memory.
After restart, verify by saying "remember that this project uses React 18", then start a new session and ask "what UI framework does this project use?" — the agent should recall it.