What is the difference between Codex and Cline?
Codex is OpenAI's coding agent, built around OpenAI's models and a built-in sandbox; Cline is an open source coding agent from Cline Bot Inc. that works with almost any model provider and asks for approval before each action. Both run in an editor or the terminal and are Apache 2.0 licensed, so the choice mostly comes down to model freedom versus a single vendor, and approvals with checkpoints versus a sandbox.
Cline can even use OpenAI models through an OpenAI account sign-in, so the two are not either-or. Everything below comes from each project's official docs and repository as of 26 October 2026. For single-tool guides, see the Codex CLI guide and the Cline guide.
How does Codex work?
The openai/codex repository calls Codex a "Lightweight coding agent that runs in your terminal." It also comes as an IDE extension for VS Code and compatible editors, in the ChatGPT desktop app and in Codex cloud. The CLI installs in one line:
# macOS and Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# or with npm or Homebrew
npm install -g @openai/codex
brew install --cask codex
cd your-project
codex
You sign in with a ChatGPT account or an OpenAI API key. OpenAI's pricing page lists Codex plans from ChatGPT Free and Go (GPT-6 Luna in the desktop app, subject to rollout) up to Plus, Pro, Business, Edu and Enterprise, and the README recommends Plus, Pro, Business, Edu or Enterprise for the CLI. Codex runs OpenAI models such as gpt-6-astra, gpt-6.1-sol and gpt-6-luna, and --oss switches to a local model through LM Studio or Ollama.
How does Cline work?
Cline's overview sums it up as "Your AI-powered agent for complex work. Read files, write code, run commands, all with your approval." The source is at github.com/cline/cline, which describes it as "The open source coding agent in your IDE, terminal, & desktop!"
You install it as an extension or a CLI:
- VS Code and forks: search "Cline" in Extensions and install. It also runs in Cursor, Windsurf and Antigravity.
- JetBrains IDEs: install the Cline plugin from the Marketplace.
- Terminal:
npm i -g cline, thenclinefor an interactive session.
Then you pick a provider. Cline works with your own API key for cloud or local models, its usage-billed Cline provider, or ClinePass. Its OpenAI docs also describe an OpenAI Codex provider that signs in with your OpenAI account, with "No API key entry required."
Cline splits work into Plan and Act modes. In Plan mode it "cannot modify any files or execute commands"; in Act mode it carries out the plan.
How do Codex and Cline compare side by side?
| Codex | Cline | |
|---|---|---|
| Maker | OpenAI | Cline Bot Inc. |
| License | Apache 2.0 | Apache 2.0 |
| Where it runs | CLI, IDE extension, ChatGPT desktop app, cloud | VS Code and forks, JetBrains, CLI, desktop app, Zed and Neovim via ACP |
| Sign-in and billing | ChatGPT plan or OpenAI API key | Own API key, Cline provider, ClinePass, or OpenAI Codex sign-in |
| Models | OpenAI models; local via --oss |
Many providers, including local models |
| Default safety | Sandbox on: Auto preset in Git folders, network off | Asks before every edit and command; auto-approve is opt-in |
| Undo | Your own Git workflow | Checkpoints in a shadow Git repo |
| Planning | /plan |
Plan and Act modes, optionally with a different model for each |
| Project instructions | AGENTS.md |
.clinerules/, plus detected AGENTS.md, .cursorrules, .windsurfrules |
| Agent Skills | .agents/skills/, ~/.agents/skills/ |
.cline/skills/, .clinerules/skills/, .claude/skills/, .agents/skills/, ~/.cline/skills/, ~/.agents/skills/ |
| MCP | STDIO and Streamable HTTP in config.toml |
STDIO, Streamable HTTP and legacy SSE in cline_mcp_settings.json |
| Browser and web | Web search (--search for live results) |
Browser tool |
| Scripting | codex exec, with --json |
Headless cline with --json or piped input |
| Parallel work | Subagents, worktrees, codex cloud |
Subagents, Kanban with per-task worktrees |
How do they keep your code safe?
This is the clearest design difference.
Codex uses an OS sandbox. OpenAI's approvals and security docs say a version-controlled folder starts in the Auto preset, which reads, edits and runs commands inside the project and asks before editing outside it or using network access. "By default, the agent runs with network access turned off," and .git, .agents, .codex and .aws stay read-only. You change modes with /permissions. The Codex approvals and sandbox guide covers every option.
Cline uses approvals and checkpoints. The repository says "Every file edit and terminal command requires your approval." Its auto-approve page suggests a starting point of auto-approving only "Read project files" and leaving "edits, commands, browser, and MCP off until you have a specific reason." YOLO mode approves everything, and the docs warn: "Warning: This is dangerous."
To undo work, Cline's checkpoints save the state of your files after each tool action in "a shadow Git repository separate from your project's actual Git history." You can restore files, the conversation, or both, and "Your main Git repository stays untouched."
In short: Codex limits what commands can do, while Cline asks you about each one and lets you roll back.
How do instructions, skills and MCP compare?
Instructions. Codex reads AGENTS.md from a global file in ~/.codex and from the repo root down to your current folder; /init writes a first draft. Cline's rules docs list .clinerules/ or .cline/rules/ at the project root and a global rules folder, and say it also detects .cursorrules, .windsurfrules, AGENTS.md and ~/.agents/AGENTS.md. One AGENTS.md therefore works in both. See the AGENTS.md guide.
Skills. Both follow the Agent Skills format, a folder with a SKILL.md file. Codex scans .agents/skills up to the repo root plus ~/.agents/skills, and you call a skill with $name. Cline's skills docs list .cline/skills/, .clinerules/skills/ and .claude/skills/ in a project and ~/.cline/skills/ globally, with a 1,024 character description limit, and you trigger one with /skill-name. Cline's config page adds that it also reads skills in .agents/skills/ and ~/.agents/skills/, so a skill installed there for Codex can work in both tools. See Codex skills and Agent Skills.
MCP. Codex stores servers in config.toml and supports STDIO and Streamable HTTP. Cline's MCP docs use cline_mcp_settings.json, with STDIO, Streamable HTTP (recommended) and legacy SSE. The formats differ, so you configure each tool separately. See Codex MCP.
How do pricing and models compare?
Codex is paid through a ChatGPT plan, where usage counts against the plan, or an OpenAI API key billed per token. The Codex pricing guide has plan details. You get OpenAI's models, switched with /model.
Cline has no required subscription. You can bring your own key for a cloud or local model, buy usage through the Cline provider, or use ClinePass, listed at $9.99 a month as of October 2026, which it describes as "A low-cost monthly subscription that offers 2-5x the usage on popular open coding models compared to standard API rate." With the OpenAI Codex provider, Cline notes that "Available models depend on your OpenAI plan."
Cline also lets you set different models for Plan and Act, such as a strong model for planning and a cheaper one for edits.
How do you run them in scripts?
Both work headless:
# Codex: read-only by default in exec mode
codex exec "summarize the changes on this branch"
codex exec --json "summarize the repo structure"
# Cline: headless when output is redirected, stdin is piped, or --json is set
git diff | cline "review for potential regressions"
cline --json "list TODO comments"
The Codex non-interactive docs add codex exec resume --last for multi-stage pipelines, and the codex exec guide covers CI. Cline's CLI overview adds -p or --plan to start in Plan mode.
Which should you pick?
Start with where you work and how you want to pay.
Codex tends to fit when:
- You already pay for ChatGPT and want one vendor for the agent and the models.
- You want a sandbox with network off by default, without configuring it.
- You want to move between the CLI, the IDE extension, the desktop app and cloud tasks, with the CLI and IDE extension sharing one configuration.
Cline tends to fit when:
- You want to switch between providers, including open models through ClinePass or local models.
- You work in JetBrains, Zed or Neovim as well as VS Code.
- You want to approve each action and roll back with checkpoints.
- You want separate models for planning and doing.
You can also combine them: Cline's OpenAI Codex provider runs OpenAI models inside Cline with your OpenAI account sign-in. Keep shared rules in AGENTS.md and trying the other tool later costs little.
Keep your prompts and skills portable
Your rules and skills should not be tied to one agent. Kipt keeps prompts and Agent Skills as Markdown in a private GitHub repo you own, and installs every skill into Claude Code or Codex with one npx skills add command. If you keep pasting the same prompt into an agent, the free SKILL.md generator turns it into a skill folder.