Blog

Claude Code, Codex and Cursor memory compared

All three coding agents now remember something between sessions, in different ways and different places. Here is what each one writes down, where it keeps it, how to turn it off, and the gap all three share.

Checked against each vendor’s documentation on October 21, 2026.

Side by side

Memory in Claude Code, Codex and Cursor
Claude CodeCodexCursor
Instructions you writeCLAUDE.md (or AGENTS.md)AGENTS.md.cursor/rules, AGENTS.md
Notes it writes itselfAuto memoryMemoriesMemories UI removed in 2.1
On by default?Yes, in local sessionsNo—
Where~/.claude/projects/, a folder per repo~/.codex/memories/Export to a rule file
ScopeOne repository, all its worktreesYour Codex homeOne project’s rules
Control/memory, autoMemoryEnabled/memories per chat, config.tomlEdit rules
Knows your other agents?NoNoNo

Claude Code

Claude Code has two systems. CLAUDE.md files are instructions you write; they load at the start of every session (and since 2.1.277 it can read AGENTS.md instead, see AGENTS.md vs CLAUDE.md).

Auto memory is what Claude writes itself: corrections you made, preferences it noticed, things it learned about the codebase. It’s on by default in local sessions and lives in ~/.claude/projects/<project>/memory/, one folder per repository shared across its worktrees, with a MEMORY.md index and a file per topic. The first 200 lines or 25KB of the index load into every session. Open /memory to see entries and toggle it, or set autoMemoryEnabled: false in a project’s settings. Details in Anthropic’s memory docs.

Codex

Codex reads AGENTS.md for instructions, from ~/.codex/ and from the repository root down to your working folder.

Memories are off by default. Turn them on in the ChatGPT desktop app under Settings › Personalization, or with memories = true under [features] in config.toml. Two settings split the job: memories.generate_memories decides whether new chats feed memory, memories.use_memories whether existing memories go into new sessions. /memories changes both for the current chat only. They’re stored in ~/.codex/memories/, and OpenAI says not to edit them by hand and to keep rules that must always apply in AGENTS.md. See OpenAI’s memories docs.

Cursor

Cursor’s durable memory is its rules: .mdc files in .cursor/rules/ that apply always, by file glob, when the agent judges them relevant, or when you mention them, plus User Rules in settings and AGENTS.md files. See Cursor’s rules docs.

Cursor used to have Memories it wrote from chats. In 2.1 the screen to manage them went away; Cursor staff on its forum recommended running Export memories from the command palette and moving the result into rules, and later replies disagreed about whether the feature still runs. If you relied on it, export now and treat rules as the source of truth.

What none of them knows

Each agent remembers its own sessions in one repository. None of them knows:

  • what you did in the other agent yesterday;
  • what was decided on a call, or in Slack, or in a ticket you read;
  • what you were looking at in the browser when the bug showed up.

So you paste it. That’s the job of a shared source every agent can read, usually an MCP memory server. Cachejay is one: on your Mac it reads Claude Code and Codex session logs (only what you and the agent said, not tool output), plus screen text and calls, and files them by project. Claude Code, Codex and Cursor all connect to it over MCP, so a Cursor session can ask what you settled in Claude Code this morning. It doesn’t read Cursor’s own chat history.

If you use two agents

  1. One instruction file: AGENTS.md, with CLAUDE.md importing it.
  2. Each agent’s own memory on for what it learns about the codebase. Review it now and then; it can learn the wrong lesson.
  3. One shared source for what happened, so switching agents mid-task doesn’t mean re-explaining. See share context between AI agents, and setup for Claude Code, Codex and Cursor.

Questions

Where does Claude Code store its memory?

Instructions you write live in CLAUDE.md files in your project and home folder. Notes Claude writes itself (auto memory) live in ~/.claude/projects/<project>/memory/, with a MEMORY.md index whose first 200 lines or 25KB load into every session.

Are Codex memories on by default?

No. Local Codex memories are off by default. Turn them on in Settings › Personalization in the ChatGPT desktop app, or with memories = true under [features] in config.toml. They’re stored in ~/.codex/memories/.

What happened to Cursor Memories?

Cursor removed the Memories management screen in version 2.1 and pointed people to exporting memories into rules. Replies from Cursor staff on its forum differ on whether the feature still runs underneath, so treat rules and AGENTS.md as Cursor’s supported memory.

Can Claude Code and Codex share memory?

Not natively; each keeps its own. Shared instructions can live in AGENTS.md. Shared memory of what happened needs an outside source both can read, such as an MCP memory server.

Stop explaining your day to ChatGPT

Install it, connect the apps you use, and get on with your work. Free for 14 days, no card.