Claude Code vs Cursor vs Codex: instructions, memory, extensions
How Claude Code, Cursor, and Codex compare on instruction files, memory, skills, subagents, hooks, and MCP, and how to set up a repo that works with all three.
Many teams no longer pick one coding agent. One engineer lives in Cursor, another in Claude Code, and the platform team tries Codex. The question that matters day to day isn't which model is smartest. It's whether the repository's rules, skills, and context reach all three.
This comparison covers how each tool handles instructions, memory, and extensions, from each vendor's documentation checked on 16 November 2026: Claude Code, Cursor, and Codex. It doesn't cover pricing, usage limits, or model quality, which change too often to compare fairly.
Side by side
| Claude Code | Cursor | Codex | |
|---|---|---|---|
| Main instruction file | CLAUDE.md (reads AGENTS.md when there's no CLAUDE.md) | .cursor/rules/*.mdc and AGENTS.md | AGENTS.md |
| Scoped instructions | .claude/rules/ with paths | Rules by globs, description, or @-mention | Nested AGENTS.md per directory |
| Self-written memory | Auto memory, on by default, machine-local | No dedicated memory page in its current docs | Memories, opt-in, machine-local |
| Skills | .claude/skills/ | .cursor/skills/, .agents/skills/, and loads .claude/skills/ and .codex/skills/ | Skills |
| Subagents | Yes | Yes | Yes |
| Hooks | Yes, in settings files | Yes, in hooks.json; can load Claude Code hooks | Docs point to pre-commit hooks and linters |
| MCP | claude mcp add, .mcp.json | .cursor/mcp.json | codex mcp add, config.toml |
| Plugins | Plugins and marketplaces | Plugins | Not in its customization overview |
Instructions
All three read a markdown instruction file at the start of work, and all three advise keeping it short.
- Claude Code reads CLAUDE.md from the organization, user, and project levels, recommends under 200 lines, and loads
.claude/rules/files withpathsonly when matching files are touched. Since v2.1.277 it reads AGENTS.md when no CLAUDE.md exists. See CLAUDE.md examples. - Cursor uses
.mdcproject rules that load always, by file pattern, by relevance, or when @-mentioned, plus AGENTS.md for plain instructions. See Cursor rules vs skills vs AGENTS.md vs CLAUDE.md. - Codex reads a global AGENTS.md from
~/.codex/and every AGENTS.md from the git root down, closer files taking precedence, capped at 32 KiB by default. Its docs suggest asking the agent to update AGENTS.md whenever you correct it. See AGENTS.md examples.
Memory
- Claude Code has auto memory on by default: notes Claude writes about your preferences and corrections, stored per repository on your machine.
- Codex has Memories, off by default, stored locally under
~/.codex/. - Cursor's current docs index doesn't list a separate memory feature; persistent context lives in rules and AGENTS.md.
None of these is shared with teammates or across tools. See how Claude Code memory works and Codex memory.
Extensions
The three have converged here:
- Skills are supported by all three. Cursor reads skills from Claude Code's and Codex's folders for compatibility, so a skill in
.claude/skills/can serve more than one tool. - Subagents exist in all three, for delegating focused work to a separate context.
- Hooks are documented in Claude Code and Cursor, and Cursor can load hooks configured for Claude Code. Codex's customization guide recommends pre-commit hooks, linters, and type checkers alongside AGENTS.md.
- MCP works in all three, each with its own config location.
A repository that works with all three
AGENTS.md # shared instructions: commands, gotchas, boundaries
CLAUDE.md # "@AGENTS.md" plus Claude Code specifics, if any
.cursor/rules/ # only for Cursor-specific scoping
.claude/rules/ # only for Claude Code path-scoped rules
.claude/skills/ # shared skills, loaded by Claude Code and Cursor
MCP servers still need configuring per tool, and memory stays per tool and per person.
What none of them shares
Each tool remembers on one machine, and the repository only holds what someone wrote into it. A decision made in a planning meeting or a Slack thread reaches none of the three unless someone edits a file, and then it has to be kept current in that file.
Where Lockstep fits
Lockstep keeps those decisions in one shared record, captured from PRDs, Slack, and pull requests and binding when their owner approves them. Claude Code gets an automatic briefing at the start of each session. Cursor can query the same record through Lockstep's MCP server, without the automatic briefing. Codex isn't supported yet.
See how it works.
Sources checked 16 November 2026
- https://code.claude.com/docs/en/features-overview
- https://code.claude.com/docs/en/memory
- https://cursor.com/docs/rules
- https://cursor.com/docs/skills
- https://cursor.com/docs/hooks
- https://learn.chatgpt.com/docs/customization/overview
- https://learn.chatgpt.com/docs/agent-configuration/agents-md
- https://learn.chatgpt.com/docs/customization/memories
Related reading
For moving between Cursor and Claude Code, see how to share memory between Cursor and Claude Code. For choosing between Claude Code's extensions, see CLAUDE.md vs skills vs hooks vs subagents. For choosing a front end, see Claude Code desktop vs CLI vs VS Code. For what agentic coding means, see vibe coding vs agentic coding. For Google's terminal agents, see Gemini CLI vs Claude Code vs Codex CLI. For Google Antigravity in the mix, see Cursor vs Antigravity vs Claude Code. For Cursor against GitHub Copilot, see Cursor vs GitHub Copilot. For every major alternative in one place, see Claude Code alternatives.
Frequently asked questions
- What is the difference between Claude Code, Cursor, and Codex?
- All three are AI coding agents that read an instruction file and support skills, subagents, and MCP servers. Claude Code's instruction file is CLAUDE.md, with on-by-default auto memory. Cursor uses .mdc project rules plus AGENTS.md. Codex uses AGENTS.md, with an opt-in Memories feature.
- Can one repository work with Claude Code, Cursor, and Codex?
- Yes. Put shared instructions in AGENTS.md, which Codex and Cursor read and Claude Code reads when there is no CLAUDE.md or through an @AGENTS.md import. Put skills in .claude/skills/, which Claude Code reads natively and Cursor also loads. Use .mcp.json-style config per tool for MCP servers.
- Do Claude Code, Cursor, and Codex share memory?
- No. Claude Code's auto memory and Codex's Memories are both stored on your machine and not shared across tools or teammates. Shared context has to come from files in the repository or a shared MCP server.
- Which is better, Claude Code or Cursor?
- It depends on how you work. Cursor is an editor with an agent built in; Claude Code is a terminal-first agent with extensions in the editor and desktop. This comparison covers how each handles instructions and context, not model quality or pricing, which change often.
- Do Cursor and Codex support hooks?
- Cursor documents hooks configured in hooks.json, and can load hooks from Claude Code's configuration. Codex's customization docs describe AGENTS.md, Memories, skills, MCP, and subagents, and recommend pairing AGENTS.md with pre-commit hooks and linters for enforcement.
Keep reading