Skip to main content
NeVibe · guide · 2026-10-24

Codex vs Cursor: choosing one and sharing files between them

Of all the pairs we compare, this one shares the most: both read AGENTS.md natively and both look for skills in .agents/skills. They part ways on subagents, hooks and the MCP config format.

How Codex and Cursor differ

Codex by OpenAI runs as a CLI and as an IDE extension. Its docs now live at learn.chatgpt.com; old developers.openai.com/codex links redirect there.

Cursor by Anysphere is a code editor with the agent, chat and autocomplete in one window.

So you are comparing an agent you call from the terminal or a side panel with an editor that has the agent built in. Their file formats, though, have converged more than any other pair in this section.

Comparison table

FeatureCodexCursorProject rulesAGENTS.md, AGENTS.override.md, 32 KiB cap by default.cursor/rules/*.mdc and AGENTS.md in root and subfoldersPath-scoped rulesno dedicated mechanism; nested AGENTS.md per folderglobs field in .mdcSkills.agents/skills/, ~/.agents/skills/, /etc/codex/skills.agents/skills/, .cursor/skills/, plus .claude/skills/ and .codex/skills/Installing a skill$skill-installer <name>, npx skills add <repo> -a codexplugin from GitHub, npx skills add <repo> -a cursorSubagentsTOML in .codex/agents/: name, description, developer_instructionsMarkdown in .cursor/agents/; Cursor also scans .codex/agents/Hookshooks.json or [hooks] in config.toml, 12 events.cursor/hooks.json; agent, Tab and app lifecycle eventsMCPTOML, [mcp_servers.<name>], codex mcp addJSON, .cursor/mcp.json, mcpServers keyPlugins/plugins in the CLI, team marketplaces synced from GitHubCustomize → From GitHub Repository, .cursor-plugin/marketplace.jsonSlash commandscustom prompts deprecated in favor of skills/migrate-to-skills moves commands into skills

Sources: Codex skills, Codex hooks, Codex plugins, Cursor skills, Cursor hooks.

Shared files: AGENTS.md and .agents/skills

If your team uses both, the shared layout costs almost nothing. Put rules in AGENTS.md and skills in .agents/skills, and both tools see them. Cursor merges nested AGENTS.md files with their parents, and Codex concatenates from the repo root down to the current folder, so per-folder rules behave similarly.

What you should not expect: a Cursor rule with globs firing in Codex. AGENTS.md has no frontmatter in Codex and is always read whole. A rule like "only for *.tsx" becomes a nested AGENTS.md in the components folder, or a skill with a clear description.

Subagents are murkier. Cursor lists .codex/agents/ among its search paths, but Cursor subagents are documented as Markdown and Codex agents are TOML. Whether Cursor parses the TOML files is not stated in its docs, and we have not tested it.

Rules: size, precedence, modes

Codex concatenates AGENTS.md files from the repo root down to the current folder, one file per folder, with files closer to the working directory coming later and overriding broader ones. An AGENTS.override.md next to it replaces that folder AGENTS.md. The global file lives in ~/.codex. The default cap is 32 KiB (project_doc_max_bytes): files beyond it are not added to the context, which is easy to miss.

Cursor works differently. An .mdc rule has four modes: always (alwaysApply: true), by file pattern (globs), agent-decided (only description) and manual via @-mention. Precedence runs Team, then Project, then User. There is no hard limit; the docs suggest keeping each rule under 500 lines. A migration trap: the current version ignores .md files in .cursor/rules, they need the .mdc extension.

Hooks and MCP: where you will convert

Both have hooks, in different formats. Codex uses PascalCase events (PreToolUse, PermissionRequest, PostCompact), and a non-managed hook must be approved through /hooks before it runs. Cursor uses camelCase (beforeShellExecution, afterFileEdit, beforeMCPExecution) and keeps hooks in .cursor/hooks.json.

MCP config lives twice: TOML for Codex, JSON for Cursor. Transports mostly match: Codex supports stdio and streamable HTTP with a bearer token or OAuth, and Cursor adds SSE. rulesync and ruler can generate both from one source; the manual route is in how to add an MCP server.

Which one fits you

  • You want to see every diff and use autocomplete: Cursor.
  • You hand the agent a whole task and review the result: Codex in the terminal.
  • Mixed team: keep AGENTS.md and .agents/skills; this is the cheapest pair to run side by side.

Collections: Codex skills, Cursor rules, MCP servers for Cursor.

FAQ

Codex vs Cursor: which should I use?

Cursor suits you if you edit code yourself and want autocomplete. Codex suits you when the agent should complete a task end to end. Their formats are compatible enough to use both.

Can Cursor read Codex skills?

Yes. Cursor looks for skills in .agents/skills, where Codex keeps them, and also in .codex/skills and ~/.codex/skills.

Do Codex and Cursor both read AGENTS.md?

Both read it natively, including nested files in subfolders. Codex loads up to 32 KiB of these files by default.

Can one MCP server work with both Codex and Cursor?

Yes, the server is the same, but you describe it twice: in ~/.codex/config.toml or with codex mcp add for Codex, and in .cursor/mcp.json for Cursor.

NeVibe catalog

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor