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
| Claude Code | Codex | Cursor | |
|---|---|---|---|
| Instructions you write | CLAUDE.md (or AGENTS.md) | AGENTS.md | .cursor/rules, AGENTS.md |
| Notes it writes itself | Auto memory | Memories | Memories UI removed in 2.1 |
| On by default? | Yes, in local sessions | No | — |
| Where | ~/.claude/projects/, a folder per repo | ~/.codex/memories/ | Export to a rule file |
| Scope | One repository, all its worktrees | Your Codex home | One project’s rules |
| Control | /memory, autoMemoryEnabled | /memories per chat, config.toml | Edit rules |
| Knows your other agents? | No | No | No |
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
- One instruction file: AGENTS.md, with CLAUDE.md importing it.
- Each agent’s own memory on for what it learns about the codebase. Review it now and then; it can learn the wrong lesson.
- 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.