Codex memory
Automatic memory for Codex: hooks inject recalled context and capture the facts in your prompts, TOML + bearer env auth.
Overview
Install the MemorySync plugin and Codex remembers: lifecycle hooks inject relevant memories at session start and alongside each prompt of 24 characters or more (Codex supports additionalContext injection), re-inject after context compaction, and send every prompt to fact extraction the moment you send it (replies are not sent). The MCP server configures through Codex’s TOML with bearer_token_env_var — the documented environment-auth field — with OAuth as the keyless fallback. Every hook exits 0 on every failure, so memory can never break a session. The only memory vendor with working Codex automation on Windows: hooks are dependency-free Node scripts, no bash, no Python installers.
Setup status and requirements
- Supported version
- memorysync Codex plugin 1.5.0
- Last setup review
- 2026-10-01
- Permissions
- A MemorySync API key with read and write scopes (or OAuth via codex mcp login).
- Limits
- Hooks require Codex CLI/IDE (Codex Web runs no hooks or local config — every vendor shares this limit) and Node.js 18+ on PATH. Non-managed hooks need a one-time /hooks trust approval.
Capabilities
- Injected recall: session start, per prompt (24+ characters), and re-injected after compaction
- Automatic capture: each prompt sent for fact extraction; the Stop hook sends nothing
- TOML MCP config with bearer_token_env_var (plus codex mcp add one-liner)
- Cross-platform Node hooks — native Windows, macOS, Linux
- Session-safe by contract: every hook exits 0 on every failure, tested
- Same skills and MCP tools as the Claude Code and Cursor plugins
- Honest limits documented: Codex Web runs no hooks (true for every vendor)
Quick Start
# MCP in one command:codex mcp add memorysync --url https://mcp.memorysync.io/mcp --bearer-token-env-var MEMORYSYNC_API_KEY# Full plugin (hooks + skills):codex plugin marketplace add memorysyncio/memorysync-pluginscodex plugin add memorysync@memorysync# then trust the hooks once: /hooks
Use Cases
Codex CLI/IDE sessions that remember decisions across days and repos
Injected context so Codex starts every session already briefed
Per-project context with preferences that follow you
Guides and related pages
Related integrations
Explore More
Add long-term memory to Codex
Start free with 10,000 add requests a month and no credit card. Memory is stored per end user and comes back in every later session.
