
Persistent Memory for Claude Code, Cursor and Codex
Claude Code, Cursor and Codex each keep memory on one machine, apart from your chat tools. Here is how to share it across all of them, step by step.
Claude Code, Cursor and Codex each have their own memory, and none of it reaches the others or your chat assistant. To share it, put repo facts in one AGENTS.md all three read, keep a dated handoff note, and for everything that should follow you across tools and machines, connect them to one memory server over MCP.
Smart about code, dumb about you
Coding agents can read a codebase faster than you can. What they don't know is you: your conventions, the decision you made yesterday, the fix you already found for the bug they're about to hit again. Each tool remembers something, but only for itself.
Claude Code loads CLAUDE.md files you write and an auto memory that Claude writes for itself. Auto memory is stored per repository under ~/.claude/projects/, and Anthropic's docs say plainly that it is "machine-local" and "not shared across machines or cloud environments."
Cursor has project rules in .cursor/rules, user rules in settings, and Memories that it generates from your chats. Cursor's docs say those memories "are scoped to your project."
Codex reads AGENTS.md files and can keep local memories in ~/.codex/memories/. Those memories are off by default, and the setting applies per machine. OpenAI's docs also state that "ChatGPT web uses ChatGPT memory, while local Codex clients use a separate local memory store." So Codex and ChatGPT don't share memory, even on the same account.
The result: a decision you made in Claude Code on Tuesday is invisible to Cursor on Wednesday, and your chat assistant never hears about either.
Step 1: Put repo facts in one AGENTS.md
All three tools can read the same instructions file, so write it once.
- Create AGENTS.md at the root of the repository.
- Write the facts a new teammate would need on day one: how to build and test, the folder layout, the conventions, and the decisions that aren't obvious from the code.
- Keep it short. Codex stops reading at 32 KiB by default, and shorter files are followed more reliably in every tool.
- Commit it. The file travels with the repo to every machine and every teammate.
Codex reads AGENTS.md by default. Cursor reads a plain AGENTS.md placed in the project root. Claude Code reads AGENTS.md when there's no CLAUDE.md in the working directory or above it. If you already have a CLAUDE.md, keep it and import AGENTS.md from it rather than maintaining two copies.
Step 2: Keep your personal preferences in the user-level file
Repo facts belong to the team. Your own habits belong to you, and each tool has a place for them that applies to every project.
- Claude Code: ~/.claude/CLAUDE.md.
- Cursor: User Rules in Cursor Settings.
- Codex: ~/.codex/AGENTS.md (or AGENTS.override.md).
Write the same short list in each: language and style preferences, how you want commits written, what to ask before doing. Three files are a small price, but they'll drift unless you update all three each time, and a stale rule is worse than none, because the agent follows it with confidence.
Step 3: Leave a dated handoff note
The thing most people want from "memory" isn't rules. It's yesterday's context: what was tried, what broke, what's next. No tool shares that for you, so write it down.
- Add a HANDOFF.md to the repo, or a notes folder that's in .gitignore if it should stay private.
- At the end of each session, ask the tool to append three lines: the date, what changed, and the next step.
- At the start of the next session, in any tool, say "read HANDOFF.md first."
This is the simplest working version of shared memory, and it costs nothing. The weakness is that it only follows the repo, not you. It won't tell your chat assistant how you like to work, and it can't search across projects.
Step 4: For memory that follows you, use one MCP memory server
Claude Code, Cursor, Codex, Claude and ChatGPT all support the Model Context Protocol. That means a single memory service can be connected to all of them, and anything saved in one is readable in the rest.
When you pick one, check four things:
- Which clients it supports today, by name. A server that works in Claude Code but not in ChatGPT only solves half the problem.
- Whether memories are per project or per person. Project memory is useful; personal memory is what makes a new tool feel like it already knows you.
- Who holds the data, where the keys live, and whether you can read the access record.
- Whether you can see, fix and delete what it keeps, and export everything in a standard format and leave.
Notes saved from a coding session give another connected assistant the project decision and next step. Demonstration with sample data.
Where Penny fits
Penny is a memory service that works this way, built so the upkeep isn't your job. It connects over MCP to Claude, ChatGPT, Perplexity, Cursor, Codex, and Claude Code. The Claude Code, Cursor and Codex plugins bring your preferences and the project's accumulated memory into the start of every session, with the project recognized from your repo. When a coding session ends, its secret-scrubbed transcript feeds background processing that updates that project's memory for next time. Your chat tools read the same account, so a rule you set once is the rule every tool starts from.
Penny keeps different kinds of things as what they are: notes, to-dos, the things you track, and how you like things done. When an agent needs a detail, Penny's search looks by meaning and by exact words at once and brings the right note into the session.
You can read, fix or delete anything Penny keeps, and export everything from your dashboard anytime: a complete JSON file, your notes as Markdown and your trackers as CSV. Memory is encrypted with AES-256-GCM under a 256-bit key unique to you, and Penny holds the keys, because AI tools need to read memory in plain text to use it. Every time Penny's service decrypts your memory, it's on record in your dashboard and sealed into a public, tamper-evident log. The engine is proprietary.
Free to start: 14 days, no card. After that it's $59 a year for founding members, locked for life, or $99 a year on the standard plan. Connecting Claude or ChatGPT requires a paid plan with them.
Frequently asked questions
Does Claude Code's auto memory sync between my laptop and desktop? No. Anthropic's documentation says auto memory is machine-local and not shared across machines or cloud environments. CLAUDE.md files committed to the repo do travel with it.
Can Codex use my ChatGPT memory? No. OpenAI's documentation says ChatGPT web uses ChatGPT memory while local Codex clients use a separate local store. The two don't read each other.
Is one AGENTS.md enough for all three tools? For repo instructions, yes. Codex and Cursor read it at the project root, and Claude Code reads it when no CLAUDE.md is present or when your CLAUDE.md imports it. It doesn't carry session history or personal preferences; use Steps 2 to 4 for those.
