Skip to main content
The Crosmos Codex plugin adds project memory to the OpenAI Codex CLI. It recalls relevant context before each prompt, saves session context through lifecycle hooks, and gives you a crosmos-save skill for explicit notes. Use this plugin when you want Codex to remember project decisions, preferences, and prior work without manually calling memory tools. If you only need callable memory tools, use MCP instead.

Prerequisites

  • OpenAI Codex CLI
  • Node.js 18 or later
  • A Crosmos API key from the Crosmos Console
  • At least one Crosmos memory space
Keys use the csk_ prefix. The installer can save your key to ~/.crosmos/credentials.json, or you can set CROSMOS_API_KEY before installing.

Install

The installer validates your API key, resolves a memory space, registers Codex hooks, copies the bundled plugin script, and installs the crosmos-save skill. After installing, open Codex and run:
Review and approve the Crosmos hooks. Codex requires this trust step before non-managed hooks can run.
Run the package with npx. Do not install it globally, because its binary is named codex and a global install can shadow the OpenAI Codex CLI.

Verify

The status command checks your API key, API base URL, hook registration, installed bundle, installed skill, and resolved memory space. If recall or capture is not running after a successful install, run /hooks in Codex and confirm the hooks are approved.

How it works

The plugin uses Codex lifecycle hooks and the Crosmos SDK. Memory failures do not block your Codex session. The installed crosmos-save skill lets you ask Codex to save a specific note:
Codex can then run the bundled save command with a concise note. Automatic capture still happens through hooks.

What gets installed

The installer backs up existing files before it changes them. It does not edit ~/.codex/config.toml.

Configuration

Configure the plugin with environment variables or ~/.codex/crosmos.json. Environment variables override the config file. Example config file:
If neither spaceId nor spaceName is set, the plugin resolves the first available memory space and caches its ID in ~/.codex/crosmos.json.

Troubleshooting

Hooks are not running

Open Codex and run:
Review and approve the Crosmos hooks. If hooks are disabled in ~/.codex/config.toml, remove this setting:

No API key is configured

Set CROSMOS_API_KEY or rerun the installer:

No memory space is available

Create a memory space in the Crosmos Console, then rerun:
You can also pin a specific space with CROSMOS_SPACE_ID or CROSMOS_SPACE_NAME.

CODEX_HOME points somewhere else

By default, the installer writes to ~/.codex. If CODEX_HOME is set, the installer stops before writing unless you pass --force.
Use --force only when you intentionally want to install into that Codex home.

Debug hook behavior

Enable debug logging:
Logs are written to /tmp/crosmos-codex-<session>.log.

Uninstall

Uninstall removes the Crosmos hook entries, bundled script, skill directory, and ~/.codex/crosmos.json. Existing memories in Crosmos are preserved.

Next steps

MCP

Connect Crosmos memory tools to AI clients.

Memory tools

See the callable memory tool schemas.