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 after each 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.

Get Your API Key

Create a Supermemory API key from the API Keys page, then export it in your shell profile:

Install the Plugin

This command:
  • Copies hook and skill scripts to ~/.codex/supermemory/
  • Enables codex_hooks = true in ~/.codex/config.toml
  • Registers UserPromptSubmit (recall) and Stop (capture) hooks in ~/.codex/hooks.json
  • Installs supermemory-search, supermemory-save, supermemory-forget, and supermemory-status skills to ~/.codex/skills/
Restart Codex CLI after installing.

How It Works

Once installed, the plugin runs automatically on every Codex session:
  • Recall — Before each prompt, relevant memories and your user profile are fetched from Supermemory and injected as additional context.
  • Capture — After each session ends, the conversation transcript is ingested into Supermemory, scoped to the current project and user.
  • Privacy — Content wrapped in <private>...</private> tags is redacted before storage.

Memory Scopes

Memories are tagged with two container tags per session, auto-derived from your environment: Tags are generated automatically — no configuration needed. You can override them in ~/.codex/supermemory.json if needed:

Explicit Memory Skills

The installer includes four skills that Codex auto-discovers from ~/.codex/skills/. They use the same SUPERMEMORY_CODEX_API_KEY as the hooks — no separate login needed. These skills let you interact with memory explicitly — for example:

Verify Installation

Expected output when everything is configured:

Uninstall

This removes the hook registrations and skill scripts from ~/.codex/supermemory/, removes skill directories from ~/.codex/skills/, and disables codex_hooks in ~/.codex/config.toml. Your existing memories in Supermemory are preserved.

Configuration

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

Logging

Enable debug logging to trace hook activity:

Next Steps

GitHub Repository

Source code, issues, and detailed README.

Claude Code Plugin

Memory plugin for Claude Code.