Claude Code memory
How Claude Code remembers between sessions with CLAUDE.md and auto memory, where it keeps transcripts, and what Dray saves for your other agents to search.
Coding agents Facts checked 12 October 2026
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.
~/.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.mdAGENTS.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.mdmemories = true under [features] in config.toml. They are separate from ChatGPT’s memory on the web. OpenAI docs: memories~/.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: memoriesCODEX_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: configurationcodex 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: commandsdray images is on. Dray: connect/hooks lists them, and turns any of them off. Dray: connect~/.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/memories/.~/.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
Watch Codex setupOne 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.
curl -fsSL https://api.withdray.com/cli/install.sh | sh~/.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.To set up Codex on its own, or add it later:
dray setup --agents codexTo connect only the memory tools by hand, run these two commands. Connecting this way does not save your sessions.
codex mcp add dray --url https://mcp.withdray.com/mcp
codex mcp login drayThe second command opens Dray’s sign-in page. Check with codex mcp list, or /mcp inside Codex.
codex exec runs are not saved unless you run dray config scripted on./hooks or your next dray setup. OpenAI docs: hooksmemories.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: memoriesFacts checked on 12 October 2026 against these pages.