One-Line Summary: Codex CLI is OpenAI's terminal coding harness — the OpenAI counterpart to Claude Code — while Cursor is the dominant IDE-coding harness; together they bracket the design space of single-developer agentic coding tools.
Prerequisites: What is an AI harness, claude-code-as-harness
What Are Codex CLI and Cursor?
Both are coding harnesses. They differ in surface, opinion, and ecosystem.
Codex CLI is OpenAI's terminal harness, philosophically very close to Claude Code: a binary you invoke as codex (or npx @openai/codex), it reads project memory from AGENTS.md files, supports MCP, has approval modes (auto, manual), can plan multi-step changes, and integrates with sandboxes. It is OpenAI's answer to the same question Anthropic answered with Claude Code: how do we ship a first-party agentic coding harness.
Cursor is an IDE-coding harness — a fork of VS Code with deep agent integration. Its "agent mode" lets the agent take many actions per turn (edit multiple files, run commands, run tests), gated by user approval at sensible boundaries. Cursor's distinguishing UX is the inline Cmd-K editor where the agent rewrites the selection in place, Tab for predictive completions across the file, and a chat panel that knows the codebase. Cursor's memory primitives are .cursorrules (project rules) and a chat-history vector store.
How They Work
For the user, the loops differ. Codex CLI is a turn-based REPL similar to Claude Code: type, watch the agent act and ask permission, type again. Cursor's "agent mode" is a longer-horizon mode where the agent runs many tools per turn before returning to the user, more like Devin or ruflo's autopilot than Claude Code's default.
For the developer extending these harnesses, the surfaces differ more. Codex CLI exposes config files, MCP, and approval modes. Cursor exposes .cursorrules, MCP, and a (limited) tool extension API. Cursor does not have first-class hooks or sub-agents in the way Claude Code or ruflo do.
Why It Matters
Two reasons. First, the harness market is multipolar; understanding Codex CLI and Cursor is necessary even if you primarily use Claude Code, because tools and patterns have to work across them. Second, they exemplify two different design philosophies — IDE-tight (Cursor) vs CLI-composable (Codex CLI) — and the trade-offs between them recur across the broader landscape.
Key Technical Details
- Codex CLI memory:
AGENTS.mdfiles (analogous toCLAUDE.md). - Codex CLI approval modes:
manual(every action),on-failure(act, ask if anything fails),auto(full autopilot). - Codex CLI sandbox: Optional; runs file/network ops in a restricted env.
- Cursor agent mode: Higher per-turn budget; runs until "done" or budget exhausted.
- Cursor
.cursorrules: Project-local rules baked into every chat. - Cursor MCP: Configured per-workspace via
~/.cursor/mcp.jsonor workspace settings. - Cursor predictive cursor: Anticipates next edit location; not a multi-agent feature but an IDE one.
- Pricing: Cursor is subscription; Codex CLI is per-token (your OpenAI key).
How Harnesses & Frameworks Implement This
| Feature | Claude Code | Codex CLI | Cursor |
|---|---|---|---|
| Memory file | CLAUDE.md | AGENTS.md | .cursorrules |
| Hooks | ✅ rich | partial (approval modes) | ✗ |
| Sub-agents | ✅ | ✗ | ✗ |
| Slash commands | ✅ | partial | ✅ |
| MCP | ✅ | ✅ | ✅ |
| IDE integration | extensions exist | ✗ | ✅ native |
| Autopilot | optional | auto mode | agent mode |
| Pricing | per-token | per-token | subscription |
Connections to Other Concepts
claude-code-vs-codex-vs-cursor.md— The full side-by-side comparison.claude-code-as-harness.md— The Claude Code reference for context.the-2026-harness-landscape.md— The broader category map.
Further Reading
- OpenAI, Codex CLI docs (2025–2026) — The current reference.
- Cursor, Documentation — Particularly the rules and MCP sections.