drayGet started

Coding agents Facts checked 12 October 2026

Codex memory

Codex reads the AGENTS.md files you write before it starts work. Its own memories are off by default and stay on one machine. Dray saves each Codex turn to your Dray account, where every agent you connect can search it.

Get started

Needs macOS or Linux with Node.js 18 or later.

ON THIS PAGE

How Codex remembers on its own

  • Codex reads AGENTS.md files before doing any work. In its home folder (~/.codex, or wherever CODEX_HOME points) it reads AGENTS.override.md if there is one, otherwise AGENTS.md. Only the first file there that isn’t empty counts. OpenAI docs: AGENTS.md
  • It then walks from the project root, usually the Git root, down to the current folder and takes at most one file from each: AGENTS.override.md, then AGENTS.md, then any fallback names you set. Files closer to the current folder come later, and it stops at 32 KiB by default (project_doc_max_bytes). OpenAI docs: AGENTS.md
  • Local Codex memories are off by default. Turn them on in the ChatGPT desktop app (Settings > Personalization > Enable Codex memories) or with memories = true under [features] in config.toml. They are separate from ChatGPT’s memory on the web. OpenAI docs: memories
  • Memories live in ~/.codex/memories/ as summaries, durable entries, recent inputs and supporting evidence. Codex skips active or short-lived sessions, redacts secrets and updates them in the background once a chat has gone idle. OpenAI docs: memories
  • /memories sets memory for the current chat. memories.use_memories decides whether existing memories are used, and memories.generate_memories decides whether new chats add to them. OpenAI docs: memories
  • OpenAI’s advice is to keep required team guidance in AGENTS.md and treat memories as a recall layer, not the only source for rules. Deleting memories resets that machine’s memory store. OpenAI docs: memories

Where your history lives

  • Codex keeps its local state under CODEX_HOME (~/.codex by default), including session transcripts such as ~/.codex/history.jsonl. [history] persistence = "none" turns that off, and history.max_bytes caps its size. OpenAI docs: configuration
  • codex resume continues an interactive session by ID, or the most recent one. With --last it stays in the current folder unless you add --all. /resume opens the saved-session picker, and codex fork makes a copy. OpenAI docs: commands
  • /archive takes a session off the lists without deleting its transcript. OpenAI docs: commands

What Dray adds

  • When a Codex turn ends, Dray’s hooks save what you typed and the answer the turn ended on to your Dray account. Archived sessions are saved too.
  • Images you attach to a prompt, inline or as a local file, are saved with their turn while dray images is on. Dray: connect
  • Anything in the text that looks like a key or password is removed on your computer before it is sent. Dray: connect
  • Setup trusts Dray’s hooks for you through Codex itself. /hooks lists them, and turns any of them off. Dray: connect
  • Setup adds Dray’s memory tools to ~/.codex/config.toml. The Codex CLI, the IDE extension and the ChatGPT desktop app share that config, so one connection covers all three. Dray: connect OpenAI docs: MCP
  • Codex can then search what you saved from your other agents and web chats, and they can search what Codex saved. Dray does not read ~/.codex/memories/.
  • Setup adds Dray’s commands to ~/.codex/skills. In Codex they start with $, not /: $link links this chat with your other chats, $link CODE joins a link another chat made, $unlink leaves it, and $dray-status checks what Dray has saved. Codex answers a typed /link with “Unrecognized command” and never passes it on, so when another chat gives you /link CODE, send $link CODE here. Dray: connect

Set it up

Watch Codex setup0:41 · YouTube

One command sets up Codex and the other agents it finds on your computer. It needs Node.js 18 or later on macOS or Linux, and no Chrome extension.

Terminal
curl -fsSL https://api.withdray.com/cli/install.sh | sh
  1. Your browser opens Dray. Use the same Dray account as your web chats and choose Connect coding agents. This approves the computer.
  2. Setup lists the agents it found, all ticked. Untick any you want to leave out with the arrow keys and space, then press Enter.
  3. For Codex, setup writes hooks to ~/.codex/hooks.json, adds Dray to ~/.codex/config.toml, puts a block of Dray instructions in the AGENTS.md in your Codex folder, adds Dray’s $link and other commands to ~/.codex/skills and trusts the hooks. It offers to import the last 30 days of your Codex sessions.
  4. Restart Codex, and the ChatGPT app’s Codex, to use it.

To set up Codex on its own, or add it later:

Terminal
dray setup --agents codex

Memory tools only, by hand

To connect only the memory tools by hand, run these two commands. Connecting this way does not save your sessions.

Terminal
codex mcp add dray --url https://mcp.withdray.com/mcp
codex mcp login dray

The second command opens Dray’s sign-in page. Check with codex mcp list, or /mcp inside Codex.

Limits

  • Not saved: tool calls, command output, file contents, the agent’s reasoning, subagent threads, and the narration before a turn’s last tool call. Dray: connect
  • A Codex prompt is saved when its turn ends, not while the turn is still running.
  • codex exec runs are not saved unless you run dray config scripted on.
  • Codex reviews hooks before they run and records trust against each hook’s hash, so a changed hook is skipped until you trust it. Dray’s daily update never adds or trusts a Codex hook. A changed one waits for /hooks or your next dray setup. OpenAI docs: hooks
  • Importing older, compressed Codex sessions needs Node.js 22.15 or later.
  • If you set memories.disable_on_external_context = true, Codex keeps chats that used MCP tools, Dray’s included, out of its own memories. Dray still saves them. OpenAI docs: memories
  • This computer’s sign-in lasts about 90 days. After that, new sessions wait on your computer until you sign in again. Dray: connect
  • Uploading and learning are separate steps, so a new session may take a while to show up in a search. Saved sessions count toward your plan’s monthly allowance like any other messages. Dray: connect

Sources

Facts checked on 12 October 2026 against these pages.