Skip to main content
codex-supermemory wires Supermemory into the OpenAI Codex CLI via hooks and skills. Your agent gets two layers of memory:
  • Implicit (hooks) — automatically recalls context before each prompt and captures conversations incrementally during the session.
  • Explicit (skills) — lets you or the agent save, search, and manage 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 hook and skill scripts to ~/.codex/supermemory/
  • Enables codex_hooks in ~/.codex/config.toml
  • Registers UserPromptSubmit (recall) and Stop (flush) hooks in ~/.codex/hooks.json
  • Installs explicit memory skills under ~/.codex/skills/
Restart Codex CLI after installing.

Authenticate

Browser auth is preferred. Start Codex CLI — on your first prompt a browser window opens to authenticate with Supermemory. Alternatively:
  • Use $supermemory-login / /supermemory-login inside Codex
  • Or set an API key from API Keys:

How It Works

Once installed, the plugin runs on every Codex session:
  • Incremental capture — Memories are saved every N turns (default: 3) so mid-session context is available for later prompts in the same session.
  • Privacy — Content wrapped in <private>...</private> is redacted before storage.

Memory Scopes

Override tags in ~/.codex/supermemory.json if needed:
Set SUPERMEMORY_ISOLATE_WORKTREES=true to keep each worktree isolated.

Explicit Memory Skills

Example prompts:

Verify Installation

Uninstall

This removes hook registrations and skill scripts. 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.

Claude Code Plugin

Memory plugin for Claude Code.