# Codex vs Cline

_Codex runs OpenAI models in a sandbox and comes with every ChatGPT plan. Cline is a free agent for any provider that asks before it acts and checkpoints every step._

Codex and Cline are Apache 2.0 [coding agents](/learn/concepts/ai-engineering/coding-agents). Each reads your code, edits files and runs commands until a task is done. OpenAI builds Codex as a terminal agent with an IDE extension, a desktop app and a cloud agent. Cline started as a VS Code extension and added a CLI, a desktop app, a JetBrains plugin and cloud agents. Facts on this page were checked against each tool's own docs, pricing page and repository as of December 4, 2026.

## Decision Table

| | Codex | Cline |
| --- | --- | --- |
| License | Apache 2.0 for the `openai/codex` CLI | Apache 2.0 |
| Price | Included in every ChatGPT plan, from Free. Or an API key at API prices | Free. You pay your model provider, or $9.99 per month for ClinePass |
| Models | OpenAI models, such as GPT-6.2 Astra and GPT-6.2 Sol | Any configured provider, OpenAI-compatible endpoints and local models |
| Default safety | Sandbox on. Writes limited to the workspace | The extension asks before each edit and command. No sandbox documented |
| Undo | Your own git history | Checkpoints in a shadow git repository after each tool use |
| Where it runs | Terminal first, plus an IDE extension, a desktop app and Codex Web | Editor first, plus a CLI, a desktop app and cloud agents |

## At a Glance

| | Codex | Cline |
| --- | --- | --- |
| Pricing | ChatGPT Free, Go $8, Plus $20, Pro from $100, Business $25 per user billed monthly | Free extension. Pay-as-you-go Cline credits, ClinePass at $9.99 per month, or your own key. Enterprise at custom pricing |
| Models | GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra, GPT-6 Luna. Custom providers need a Responses API endpoint | Anthropic, OpenAI, Google, OpenRouter, Bedrock, Vertex and others, local models through Ollama or LM Studio |
| Permissions | Sandbox modes `read-only`, `workspace-write`, `danger-full-access`. Approval policies `on-request` or `never` | Plan and Act modes. Auto Approve toggles per action type, and a YOLO mode that approves everything |
| OS sandbox | Seatbelt on macOS, native sandbox on Windows, bubblewrap on Linux and WSL2 | None documented for local runs |
| Editors | VS Code, Cursor and Windsurf extension | VS Code, Cursor, Windsurf, JetBrains IDEs and Zed |
| Project instructions | `AGENTS.md` | `.clinerules/`, `AGENTS.md`, `.cursorrules`, `.windsurfrules` |
| MCP | Yes | Yes |
| Headless and CI | `codex exec` | `cline --json`, piped input |

## Models and Cost

Codex runs OpenAI models. OpenAI recommends GPT-6.2 Astra for demanding work and GPT-6.2 Sol for everyday coding. Usage comes out of your ChatGPT plan, or out of your API bill if you sign in with a key. A custom provider works only if it exposes a Responses API endpoint.

Cline charges nothing for the agent. You pick Cline's pay-as-you-go credits, ClinePass at $9.99 per month for open coding models, or your own key. Cline can also sign in with an OpenAI account through its OpenAI Codex provider, so a ChatGPT plan can pay for either agent. Available models depend on your OpenAI plan.

If you only use OpenAI models, Codex is the shorter path. If you switch between vendors or run local models, Cline fits. [Best LLM for Coding](./best-llms-for-coding-agents.mdx) compares the models.

## Sandboxing, Approvals and Undo

Codex starts in a sandbox. In `workspace-write` mode it edits files in the workspace, runs routine commands and asks when it needs to go further. On Linux and WSL2 it needs `bubblewrap`.

The Cline extension asks before each file edit and terminal command until you turn on Auto Approve. Its docs recommend turning on only Read project files at first. Cline documents no sandbox for local runs, and YOLO mode approves every action. The Cline CLI defaults `--auto-approve` to `true`, so check it before you script Cline.

Cline's checkpoints save your files to a shadow git repository after each tool use, separate from your real history. You can restore the files, the conversation, or both. Codex leaves undo to your own commits.

## When to Pick Which

- **Pick Codex** if you pay for ChatGPT, want a sandbox on from the start, work in the terminal, or want to hand tasks to Codex Web.
- **Pick Cline** if you want any provider or local models, an agent in JetBrains or Zed, approval before each step, or checkpoints that undo one step at a time.
- **Pick both** if you have a ChatGPT plan. Run Codex in the terminal and point Cline's OpenAI Codex provider at the same plan.

## Alternatives

- **Claude Code:** Anthropic's agent for Claude models. See [Claude Code vs Codex CLI](./claude-code-vs-codex-cli.mdx) and [Claude Code vs Cline](./claude-code-vs-cline.mdx).
- **OpenCode:** an MIT-licensed terminal agent for almost any model. See [Codex vs OpenCode](./codex-vs-opencode.mdx) and [OpenCode vs Cline](./opencode-vs-cline.mdx).
- **Cursor, now Grok Build:** an editor with an agent built in. See [Codex vs Cursor](./codex-vs-cursor.mdx) and [Cursor (now Grok Build) vs Cline](./cursor-vs-cline.mdx).

## Running Several Agents at Once

Cline's Kanban board gives each card its own [git worktree](/learn/concepts/git/git-worktrees). For Codex, you create a worktree per session yourself. Treq runs either agent in an isolated [workspace](/docs/concepts/workspaces) and stacks dependent changes for review.

## Sources

Checked December 4, 2026:

- [Codex repository](https://github.com/openai/codex), [Codex pricing](https://learn.chatgpt.com/docs/pricing), [Codex models](https://learn.chatgpt.com/codex/models), [Codex sandboxing](https://learn.chatgpt.com/codex/sandboxing), [AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md), [Non-interactive mode](https://learn.chatgpt.com/docs/non-interactive-mode)
- [Cline repository](https://github.com/cline/cline), [Cline overview](https://docs.cline.bot/cline-overview), [Cline pricing](https://cline.bot/pricing), [ClinePass](https://docs.cline.bot/getting-started/clinepass), [Auto Approve](https://docs.cline.bot/features/auto-approve), [Checkpoints](https://docs.cline.bot/core-workflows/checkpoints), [Rules](https://docs.cline.bot/customization/cline-rules), [CLI overview](https://docs.cline.bot/usage/cli-overview), [OpenAI Codex provider](https://docs.cline.bot/provider-config/openai)

## Next Steps

- [Codex Alternatives](./codex-alternatives.mdx): other agents if you are leaving Codex
- [Best Coding Agent CLIs](./best-coding-agent-clis.mdx): every current terminal agent in one table
- [Review AI-Generated PRs](/learn/how-to/review-ai-generated-prs): check agent output before it merges
