🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

codex-supermemory

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codex-supermemory

Persistent memory for OpenAI Codex CLI — powered by Supermemory

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
77
-58.6%
Maintainers
1
Weekly downloads
 
Created
Source

codex-supermemory

Persistent memory for OpenAI Codex CLI — powered by Supermemory

Codex forgets every session. codex-supermemory wires Supermemory into Codex CLI's hooks system so your coding agent remembers your stack, preferences, prior decisions, and the lessons learned across every project — automatically.

Features

  • 🧠 Automatic recall — relevant memories are injected into every prompt via the UserPromptSubmit hook.
  • 💾 Automatic capture — conversations are stored at the end of every session via the Stop hook.
  • 🏷️ Project + user scoping — memories are tagged per-project and per-user so context never leaks across repos.
  • 🔒 Privacy-aware — anything wrapped in <private>...</private> is redacted before being sent to Supermemory.
  • Zero-config install — one command sets up ~/.codex/config.toml and ~/.codex/hooks.json for you.
  • 🪶 No runtime deps in hooks — the hook scripts are pre-bundled with esbuild for fast cold starts.

Quick start

  • Get an API key at console.supermemory.ai/keys.

  • Set it in your shell profile (~/.zshrc, ~/.bashrc, etc.):

    export SUPERMEMORY_CODEX_API_KEY="sm_..."
    
  • Install the hooks:

    npx codex-supermemory install
    
  • Restart Codex CLI. That's it — memory is active.

How it works

Codex CLI supports a hooks system that lets external scripts run at specific lifecycle events. codex-supermemory registers two:

HookEventWhat it does
recallUserPromptSubmitSearches Supermemory for relevant past memories and your profile, then injects them into the prompt as additionalContext.
captureStopStores the full conversation transcript in Supermemory, tagged with both your project and user containers.

The installer:

  • Enables the codex_hooks feature flag in ~/.codex/config.toml
  • Registers the two hooks in ~/.codex/hooks.json
  • Copies pre-bundled hook scripts to ~/.codex/supermemory/

The hooks are tolerant: if Supermemory is unreachable, the API key is missing, or anything else fails, they exit cleanly without breaking your Codex session.

Configuration

Environment variables

VariablePurpose
SUPERMEMORY_CODEX_API_KEYRequired. Your Supermemory API key.
SUPERMEMORY_DEBUGSet to any truthy value to enable debug logging to ~/.codex-supermemory.log.

~/.codex/supermemory.json (optional)

Drop this file in to override defaults:

KeyTypeDefaultDescription
apiKeystringAPI key (env var takes precedence).
similarityThresholdnumber0.6Minimum similarity score for retrieved memories.
maxMemoriesnumber5Max memories injected per prompt.
maxProfileItemsnumber5Max profile items considered.
injectProfilebooleantrueWhether to fetch and inject the user profile.
containerTagPrefixstring"codex"Prefix for auto-generated container tags.
userContainerTagstringautoOverride the user container tag.
projectContainerTagstringauto (per-cwd)Override the project container tag.
filterPromptstring(sensible)Filter prompt used by Supermemory's stateful filter.
debugbooleanfalseEnable debug logging.

User and project tags are auto-derived from your git config user.email and the current working directory (both hashed) when not explicitly set.

Commands

codex-supermemory install     # set up hooks + config
codex-supermemory uninstall   # remove hooks + config (keeps your memories)
codex-supermemory status      # show current install status

Privacy

Anything wrapped in <private>...</private> is replaced with [REDACTED] before being sent to Supermemory. Use this for secrets, tokens, or anything you'd rather not have stored.

License

MIT

Keywords

codex

FAQs

Package last updated on 27 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts