Cursor memories vs rules: what each agent keeps
Cursor removed Memories in 2.1, so rules are what lasts. What Cursor, Claude Code, Codex and Gemini CLI each remember, where, and what crosses between them.
On this page
Cursor rules are instructions you write; Cursor Memories were notes its agent saved from your chats. Cursor removed Memories from the editor in version 2.1, so in Cursor today, rules are the only thing that lasts from one chat to the next, and old memories can be exported into a rule. The other big coding agents still keep both layers: a file of instructions you write, and notes the agent writes for itself. The instructions can be shared between tools through AGENTS.md. The notes never leave the tool that wrote them.
This is as of November 2026, from each tool’s own documentation, linked in each section. Claude Code memory: what it keeps, and where maps everything Claude Code remembers, and every guide on it.
| Instructions you write | Notes the agent writes | Where the notes live | Notes on by default | |
|---|---|---|---|---|
| Cursor | .cursor/rules/*.mdc, User Rules, Team Rules, AGENTS.md |
None in the editor since 2.1. Automations keep a memory per automation | Outside the automation’s working files | Automations: yes |
| Claude Code | CLAUDE.md, .claude/rules/, or AGENTS.md when there’s no CLAUDE.md |
Auto memory: preferences, corrections, project context | ~/.claude/projects/<project>/memory/ |
Yes, in local sessions |
| Codex | AGENTS.md, global and per project |
Memories generated in the background from past chats | ~/.codex/memories_v2/ (or memories/) |
No |
| Gemini CLI | GEMINI.md, global, project and subfolders |
Facts the agent adds to memory files; Auto Memory drafts, if you turn it on | ~/.gemini/GEMINI.md, the repo’s GEMINI.md, a private folder per project |
Auto Memory: no |
Cursor memories vs rules
Cursor’s rules come in four kinds. Project Rules are .mdc files in .cursor/rules, checked in with the code. Each one is applied always, when the agent judges it relevant from its description, when a file matching its globs is in context, or only when you @-mention it. User Rules are your preferences across all projects, set in Cursor’s settings. Team Rules are managed from the dashboard on Team and Enterprise plans, and an admin can enforce them. AGENTS.md is the plain alternative: Markdown with no frontmatter, at the root or in subfolders. When rules conflict, Team Rules win over Project Rules, which win over User Rules.
Two details trip people up. A plain .md file in .cursor/rules is ignored: project rules must be .mdc. And the docs say rules “do not impact Cursor Tab or other AI features”, only the agent.
Memories were different: notes the agent saved from your conversations, not something you wrote. In November 2025 a Cursor team member confirmed on the forum that “the Memories feature was intentionally removed starting from version 2.1.x”. The way out is the Export memories command, which saves them to an .mdc file you add as a User or Project Rule. The old Memories docs page now redirects to the docs home.
Memory came back in one place. Cursor Automations, agents that run on triggers, have a memory tool that is on by default. Each automation keeps notes (MEMORIES.md by default) across its own runs, stored outside its working files, which you can view and edit in its settings. The docs warn to use it with caution when an automation handles untrusted input, because a misleading entry affects later runs. Those notes belong to that one automation, not to your editor chats.
So, memories or rules? In the editor, there is no choice left: anything Cursor must know next week goes in a rule or AGENTS.md.
Does Codex have memory?
Yes, but it’s off by default. Codex memories turn useful context from earlier chats into local memory files, in the background, once a chat has been idle long enough. Codex skips short or active sessions and redacts secrets from what it generates. You turn it on in the desktop app’s settings, or in config.toml:
[features]
memories = trueThe files live under your Codex home, ~/.codex by default, in memories_v2/ for a fresh setup. /memories in the CLI or app decides, for the current chat only, whether it may use existing memories and whether it feeds future ones. The docs call the files generated state and say not to rely on editing them by hand. ChatGPT on the web has its own, separate memory.
What Codex must always follow goes in AGENTS.md. Codex reads a global one from ~/.codex, then one per folder from the project root down to where you are, closer ones last. It stops adding files at 32 KiB by default (project_doc_max_bytes). The memories page says the same: memories are “a helpful recall layer, not the only source for rules that must always apply.”
Claude Code: CLAUDE.md and auto memory
Claude Code has the two layers side by side, and both load at the start of every session. CLAUDE.md holds your instructions, at the user, project or organization level, with .claude/rules/ for rules scoped to paths. Since v2.1.277 it reads a repository’s AGENTS.md when there’s no CLAUDE.md in your folder or above it.
Auto memory is on by default in local sessions. Claude saves notes about you, your corrections, ongoing work and where things are, one Markdown file each, under ~/.claude/projects/<project>/memory/. The first 200 lines or 25KB of the MEMORY.md index load each session; the rest is read when needed. Every worktree of a repository shares the folder, but it is machine-local: “Files are not shared across machines or cloud environments.”
Of the four, Claude Code’s built-in memory is the most developed, and a separate post asks when it’s enough.
Gemini CLI: GEMINI.md and memory files
Gemini CLI joins every GEMINI.md it finds and sends them with each prompt: the global one in ~/.gemini, those in your workspace and its parents, and those in subfolders as the agent touches them. The context.fileName setting adds other names, such as AGENTS.md. /memory show shows what was loaded, /memory reload rereads it.
When you ask it to remember something, the agent edits a memory file: personal preferences go in the global GEMINI.md, shared project instructions in the repository’s, private project notes in a per-project private memory folder. They load in every later session. Auto Memory goes further: an experimental feature, off by default, that mines past sessions in the background and drafts memory changes and skills into an inbox you review with /memory inbox.
One thing to know before you build on it: Gemini CLI’s docs say it “was replaced by Antigravity CLI on June 18th, 2026” for unpaid tier and Google One users. This post doesn’t cover Antigravity CLI.
What crosses from one agent to another
Instructions can cross. Notes can’t.
Reads AGENTS.md |
|
|---|---|
| Cursor | Yes, at the root and in subfolders |
| Codex | Yes, it’s Codex’s own file |
| Claude Code | Yes, when there’s no CLAUDE.md (or always, with a setting) |
| Gemini CLI | When you add it to context.fileName |
So one AGENTS.md can give all four the same rules. A separate post covers how to set that up.
What each agent learned is another matter. Claude Code’s notes sit in ~/.claude, Codex’s in ~/.codex, Gemini’s in ~/.gemini and the project, and Cursor’s editor keeps none. No agent reads another’s folder, and none of them syncs between your machines. If you correct Claude Code in the morning and open Cursor in the afternoon, you correct it again.
When the built-in memory is enough
If you use one agent, on one machine, the built-in layers are often all you need. Put what must hold in the instruction file, check it in, and let Claude Code’s auto memory or Codex’s memories pick up the rest. Nothing to install, nothing to run. In Cursor, a well-scoped set of rules does the job Memories used to.
Two signs it isn’t enough: you switch between agents and they don’t know what the other learned, or the notes have grown past what loads at the start and you need to search them instead.
One memory for all four
Memorinth gives all four agents one memory: a cortex of Markdown files on your disk, served over MCP. One command connects each of them:
$ memorinth setup cursor
$ memorinth setup codex
$ memorinth setup gemini
$ memorinth setup claude-codeOr memorinth init finds the ones installed and connects them at once. Each gets the memory tools and a session-start hook that hands it a briefing of current decisions, facts and recent memories. Every note says which agent wrote it, such as source: agent:cursor, and all of them read the same notes, so what Codex learned this morning, Cursor knows this afternoon.
It doesn’t replace the instruction files. Rules still belong in AGENTS.md, CLAUDE.md or .cursor/rules; the cortex is for what agents learn. What goes where draws that line, and Memory for Cursor, Codex and other MCP clients has the setup for each agent, with every file it changes in Connect one agent.