Skip to main content
codex-supermemory wires Supermemory into the OpenAI Codex CLI via hooks and the hosted Supermemory MCP server. Your agent gets two layers of memory:
  • Implicit (hooks) — automatically recalls context before each prompt and captures completed turns in the background.
  • Explicit (MCP tools) — lets you or the agent search, save, list, and forget memories on demand.
Prefer to keep everything on your machine? This plugin works with self-hosted Supermemory — run npx supermemory local, then export SUPERMEMORY_API_URL="http://localhost:6767" (or set baseUrl in ~/.codex/supermemory.json) and use the API key printed on first boot.

Install the plugin

This command:
  • Copies the pre-bundled hook scripts and MCP proxy to ~/.codex/supermemory/
  • Registers the supermemory MCP server in ~/.codex/config.toml
  • Registers SessionStart, UserPromptSubmit, PreToolUse, and Stop hooks in ~/.codex/hooks.json
  • Installs the supermemory-status and supermemory-index skills under ~/.codex/skills/
Restart Codex CLI after installing.

Authenticate

Browser auth is preferred. Start Codex CLI — a browser window opens to authenticate with Supermemory. Alternatively, set an API key from API Keys:

How it works

Once installed, the plugin runs on every Codex session:
  • Recall modes — Set recallMode to "advisory" to let the model decide when to search, or "off" to disable prompt recall.
  • Privacy — Content wrapped in <private>...</private> is redacted before storage.

Memory scopes

Codex, Claude Code, and OpenCode use one container per repository:
Automatic captures go to this container with sm_scope: personal metadata. Explicit saves through the MCP tools are passed to the hosted server unchanged, so they land in your account’s active space, not the repository container. The hash comes from the normalized Git remote, so clones and linked worktrees share memory while same-named repositories do not collide. Codex still reads the older codex_user_*, codex_project_*, and other per-tool containers, so existing memories stay searchable. Override the container in ~/.codex/supermemory.json if needed:
Set SUPERMEMORY_ISOLATE_WORKTREES=true to keep each worktree isolated.

Explicit memory

Search, save, list, and forget go through the hosted Supermemory MCP tools, using the same credentials as the hooks. The installer also adds two skills: Example prompts:

Verify installation

Uninstall

This removes the hook registrations, MCP server entry, and skills. Your existing memories in Supermemory are preserved.

Configuration

Create ~/.codex/supermemory.json to override defaults:

Logging

Next steps

GitHub repository

Source code, issues, and detailed README.

Cursor plugin

Memory for your Cursor chats.