mem9-ai/mem9/setup
Claude Code and agent skill by mem9-ai/mem9
- community
Checking that the SKILL.md file is still in the repository.
Inspect and configure mem9 for Codex through the single setup entrypoint.
Install
npx vskill@latest install mem9-ai/mem9/setupSKILL.md
Mem9 Setup
Resolve ./scripts/setup.mjs relative to this skill directory.
If you need the current CLI surface, flags, or examples, run node ./scripts/setup.mjs --help first. Use command-specific help when needed, for example node ./scripts/setup.mjs profile save-key --help.
Know the two home directories before setup:
CODEX_HOMEfalls back to~/.codexon macOS/Linux.MEM9_HOMEfalls back to~/.mem9on macOS/Linux.- Codex integration files live under
$CODEX_HOME, including$CODEX_HOME/hooks.json,$CODEX_HOME/config.toml, and$CODEX_HOME/mem9/. - mem9 credential profiles live in
$MEM9_HOME/.credentials.json.
When you mention local paths to the user, use symbolic or home-relative paths such as $CODEX_HOME/mem9/config.json, $MEM9_HOME/.credentials.json, or ~/.mem9/.credentials.json. Most users can leave both variables unset. On macOS/Linux, the defaults are equivalent to starting Codex from a shell with:
On Windows PowerShell, use:
For isolated state, set different values before starting Codex and use the same values in trusted-shell profile save-key commands.
Run this workflow:
- Inspect the current mem9 state first:
- Use the JSON summary to decide the next action with the user.
Pay attention to runtime, plugin, globalConfig, projectConfig, and profiles. When you present saved profiles to the user, copy profiles.items[*].displaySummary verbatim. Keep the API key preview beside the profile label. Do not rewrite it into generic text like key saved. profiles.items[*].apiKeyPreview helps match a saved profile to the dashboard key without exposing the full secret. profiles.items[*].manualSaveKeyCommand is the exact trusted-shell command for saving a key onto an existing profile. profiles.manualSaveKeyTemplate is the placeholder version for a brand-new profile. Global updateCheck settings live under globalConfig.summary.updateCheck.
- After
inspect, stop and present the available setup choices before you run anything else.
Show:
- saved profiles from
profiles.items[*].displaySummary
Example: default (019d...4356) · https://api.mem9.ai
profile createfor creating a new mem9 API keyprofile save-keyfor attaching a key from a trusted shell
Do not jump straight to scope apply. scope apply only runs after the user has chosen a profile and that profile already has an API key.
- Keep the default flow global-first.
Apply project scope only when the user explicitly asks for a repo-local profile, Agent ID, timeout, or recall prompt-length override. Remote release-check settings live in user scope.
- When the user wants mem9 to create a new API key, run:
- When the user wants to provide the key manually, do not ask them to paste the secret into Codex.
Prefer a trusted shell plus MEM9_API_KEY. The trusted shell must use the same CODEX_HOME and MEM9_HOME that Codex will use. If inspect already returned a matching profiles.items[*].manualSaveKeyCommand, show that exact command. Otherwise use profiles.manualSaveKeyTemplate. Only run profile save-key inside Codex when MEM9_API_KEY is already present in the process environment.
Example trusted-shell flow:
- After the profile exists with an API key, apply the global config:
- When the user explicitly wants a project override, run one of:
Project scope keeps profileId, agentId, defaultTimeoutMs, searchTimeoutMs, and recallMinPromptLength. User scope also owns updateCheck.enabled and updateCheck.intervalHours.
agentId is optional. Add --agent-id <id> to a scope apply command only when the user explicitly asks for an Agent ID. Leaving the flag out keeps the agentId already in that scope's file. Project scope never copies the user-scope agentId; it inherits it at runtime.
Common flags:
inspectprofile createprofile save-keyscope applyscope clear--profile <profile-id>--label <profile-label>--base-url <mem9-api-base-url>--provision-api-key--api-key-env MEM9_API_KEY--scope user|project--agent-id <id>--default-timeout-ms <ms>--search-timeout-ms <ms>--recall-min-prompt-length <chars>--update-check enabled|disabled--update-check-interval-hours <hours>--cwd <repo-root>
--update-check flags apply to scope apply --scope user. --agent-id takes 1-100 characters with no control characters and applies to both scopes. MEM9_AGENT_ID overrides it at runtime, the same variable name the Claude Code plugin uses. Recall ignores it, and the X-Mnemo-Agent-Id header stays codex. --recall-min-prompt-length defaults to 5; use 0 to recall on every non-empty stripped user prompt. Most mem9 plugin releases take effect after a Codex restart. Migration releases may ask for $mem9:setup once after restart.
scope apply and scope clear install or repair the managed mem9 runtime in $CODEX_HOME. They enable the Codex hooks feature, repair $CODEX_HOME/hooks.json, install stable shims in $CODEX_HOME/mem9/hooks/, and write install metadata to $CODEX_HOME/mem9/install.json. Codex 0.129.0+ uses hooks = true; Codex 0.122.0 through 0.128.x uses codex_hooks = true.
Do not ask the user to paste API keys into the Codex TUI. Prefer MEM9_API_KEY plus a trusted-shell profile save-key command. Direct edits to $MEM9_HOME/.credentials.json remain a fallback. Do not print API keys.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcodex-plugin/skills/setup/SKILL.md
Popularity
- Repository stars
- 1,172
- Repository forks
- 118
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mem9-ai/mem9/setup)