The memory we recommend for Codex is Glen, shared memory for coding agents.Go to tryglen.com →
Setup2 min read

Glen, shared memory for coding agents

Setting up shared memory in OpenAI Codex

Run npx @tryglen/cli@latest install, choose Codex and sign in. The installer registers Glen's four hooks in ~/.codex/hooks.json; Codex only runs hooks you trust, so approve them when prompted or through /hooks. After that, each prompt goes to Glen and matching team memory comes back as context before the model reads it.

Get Glen for Codex
On this page
  1. What the installer puts in hooks.json
  2. Pausing or limiting recording
  3. Searching from ChatGPT too
  4. Frequently asked questions
  1. Run the installer. It needs Node.js. The installer looks for coding agents on your machine, asks which should get Glen, and installs the glen CLI.
    npx @tryglen/cli@latest install
  2. Sign in. A browser window opens. Create a free account, or join the organization your team already uses.
  3. Trust the hooks. The installer writes Glen's entries into ~/.codex/hooks.json. Codex won't run a hook until you trust it, so accept the prompt when Codex shows it, or run /hooks inside Codex and approve the four Glen entries.
    /hooks
  4. Bring in your history. Optional, and worth doing on day one. Importing your last 30 days of local sessions gives recall something to find straight away.
    glen import
  5. Work, then ask. Start a Codex session and prompt as usual; matching memory arrives with each prompt. To ask a question outright, run a search. The answer cites a source for every claim and takes about 10 seconds.
    glen search "why does the migration run before the backfill"

What the installer puts in hooks.json

Glen's Codex hooks
Codex eventCommandEffect
SessionStartglen session-startRuns once when a session opens
UserPromptSubmitglen ingestSends the prompt, prior reply, repo and branch; returns matching memory as additionalContext
Stopglen ingestRecords the prompt and the final reply
PostToolUse (Bash)glen pr-linkLinks each git commit to the session

If memory never shows up, the hooks are the first thing to check. An untrusted hook is skipped without running, and /hooks shows which ones Codex has approved.

Pausing or limiting recording

Glen's recording modes
CommandRecallRecording to team memory
glen incognitoKeeps workingStops
glen silentStops surfacing anythingKeeps going
glen offStopsStops

Glen does not train AI models on customer content. The details are in Glen's Codex docs and the privacy policy.

Searching from ChatGPT too

The ChatGPT connector searches the same memory your Codex sessions write to, which helps when you're planning outside the terminal. It reads; it does not record your chats. Other tools can connect through Glen's remote MCP server.

Frequently asked questions

Why aren't my Codex hooks running?

Codex skips hooks it hasn't been told to trust. Open /hooks in Codex and approve Glen's entries, then start a new session.

Where are Codex hooks configured?

In ~/.codex/hooks.json. Glen's installer adds its four entries there for you.

Do I need Codex memories turned on for Glen?

No. Glen works through hooks and its own hosted memory, so the memories = true setting makes no difference to it.

Does Glen slow Codex down?

Each hook adds a network round trip. In Glen's replay of 100 merged PRs on Codex 5.5, runs with Glen still finished 21% faster and used 29% fewer tokens.

More in this guide

Related guides on agent memory

Fix your agents’ amnesia.

Glen gives Codex the memory of every session your team has run. Start on your own or with up to two teammates. Your first 15,000 memories are free, no credit card.

Start free at tryglen.com