AI coding agents compared: Claude Code, Codex, Cursor
Compare Claude Code, Codex CLI, Copilot CLI, Cursor, OpenCode and Windsurf: terminal vs IDE, provider lock-in, MCP, open source and cost.
On this page6 sections
Short: pick Claude Code if you live in the terminal and want deep Anthropic-model agents that also reach into your IDE, desktop and web; pick Cursor if you want the model inside an editing surface; pick Codex CLI if you are in the OpenAI ecosystem and want an open-source terminal agent. Need to swap models freely? OpenCode is the model-agnostic choice. All of these are agents that read your repo, edit files and run commands.
1. The comparison table
| Tool | Surface | Model / provider | MCP | Open source | Cost |
|---|---|---|---|---|---|
| Claude Code | Terminal + IDE/desktop/web | Anthropic Claude (3rd-party in CLI) | Yes | No | Plan or API key |
| Codex CLI | Terminal (+ IDE ext) | OpenAI (ChatGPT or API) | Yes | Yes, Apache-2.0 | Plan or API key |
| Copilot CLI | Terminal | GitHub models + bring-your-own | Yes | No | Copilot plan |
| Cursor | IDE (AI editor) | Many (Anthropic, OpenAI, Google, xAI) | Yes | No | Plan or API key |
| OpenCode | Terminal | Model-agnostic (75+ providers) | Yes | Yes | Free app, bring your own key |
| Windsurf | IDE (now Devin Desktop) | Multiple models | Yes | No | Plan |
Every tool here speaks MCP, so the real split is terminal versus editor and how tied you are to one provider.
2. Terminal agents vs IDE agents
Terminal agents (Claude Code, Codex CLI, Copilot CLI, OpenCode) run in your shell: they grep, run tests, read the output and loop, staying editor-agnostic. IDE agents (Cursor, Windsurf) put the model inside the editing surface with tab completions and inline edits. Claude Code blurs the line by shipping IDE, desktop and web surfaces too; see Claude Code vs Cursor.
3. Model lock-in and open source
Codex CLI is tied to OpenAI, Claude Code to Anthropic (with third-party providers in the CLI), Gemini CLI to Google. Copilot CLI defaults to GitHub-hosted models but accepts an OpenAI-compatible, Azure or Anthropic endpoint. OpenCode and Aider are model-agnostic and open source; Cursor mixes providers but is closed. To choose a model, see pick an AI model.
4. Current churn to know
Two things moved in 2026. Windsurf was renamed Devin Desktop by Cognition. And Google moved unpaid Gemini CLI users to Antigravity CLI, per its GitHub repo.
5. Pick one and start
Read the matching first-steps guide: Codex CLI, Copilot CLI, Cursor or OpenCode.
Verify it worked
windsurf: command not foundThe editor is now Devin Desktop; relaunch the renamed app or reinstall it from Cognition.- Gemini CLI feels outdated on the free tier Unpaid users were moved to Antigravity CLI; switch to it or add a paid Gemini API key.
- Copilot CLI has no source to fork It is not open source; use Codex CLI or OpenCode if you need an auditable agent.
Source: Claude Code overview.