Codex alternatives: 6 coding agents to use instead of Codex CLI
Updated By Agent Radar6 min read
Short answer
Codex alternatives compared: Claude Code, OpenCode, Gemini CLI, Cline, OpenHands and Goose, with licenses, GitHub stars, latest releases and which one keeps your ChatGPT sign-in.
Top pick: Claude Code. Anthropic's agentic coding tool for the terminal, with MCP and hooks.
Quick comparison
| Pick | License | Pricing | Source |
|---|---|---|---|
| 1.Claude Code | Not stated | Usage comes from a Claude plan or Anthropic API billing. | anthropics/claude-code on GitHub |
| 2.OpenCode | MIT | Free client; you pay your model provider or subscription. | anomalyco/opencode on GitHub |
| 3.Gemini CLI | Apache-2.0 | Free CLI; a free Google account tier, a Gemini API key, Vertex AI or a paid Google plan. | google-gemini/gemini-cli on GitHub |
| 4.Cline | Apache-2.0 | Free software; model providers bill separately. | cline/cline on GitHub |
| 5.OpenHands | MIT | MIT-licensed; model providers bill separately. Hosted plans are priced by OpenHands. | OpenHands/OpenHands on GitHub |
| 6.Goose | Apache-2.0 | Apache-2.0 client. Provider access is separate. | aaif-goose/goose on GitHub |
Codex CLI is a strong default: Apache-2.0, written in Rust, with a sandbox, MCP, and a ChatGPT sign-in that shares one allowance across the CLI, desktop app, IDE extension and cloud tasks. People still look for a Codex alternative when they want different models, an editor-first workflow, a self-hosted version of cloud tasks, or simply fewer releases to keep up with. Codex shipped stable 0.170.0 on November 18, 2026, with alpha builds of two later versions out the same week.
Short answer
Want another vendor terminal agent? Use Claude Code. Want to keep your ChatGPT sign-in but not be tied to OpenAI? Use OpenCode. Want the same Apache-2.0 license with a free tier? Use Gemini CLI. Prefer approving each step in VS Code? Use Cline. Want open-source cloud-style tasks and automations? Use OpenHands. Need an agent that also drives non-code tools? Try Goose.
Pick by what you need
| You want | Start with | License | GitHub stars (Nov 19, 2026) | Latest stable release |
|---|---|---|---|---|
| Anthropic's own terminal agent | Claude Code | No open-source license on GitHub | about 156,000 | v2.1.328, Nov 19, 2026 |
| ChatGPT sign-in plus other providers | OpenCode | MIT | about 228,000 | v2.3.2, Nov 18, 2026 |
| Google models, free tier sign-in | Gemini CLI | Apache-2.0 | about 109,000 | v0.69.0, Nov 19, 2026 |
| IDE extension, SDK or CLI | Cline | Apache-2.0 | about 72,000 | v4.1.26, Oct 26, 2026 |
| Self-hosted agents and automations | OpenHands | MIT | about 94,000 | v1.42.0, Nov 18, 2026 |
| Extensible agent beyond code | Goose | Apache-2.0 | about 57,000 | v1.60.1, Nov 18, 2026 |
For comparison, openai/codex had about 136,000 stars on the same day. The order above is editorial, not a benchmark.
What you give up by leaving Codex
Three things do not come with you. First, the shared ChatGPT allowance: only OpenCode in this list can sign in with ChatGPT. Second, Codex's sandbox and approval rules, now written as permission profiles; every other agent has its own model for this, so recheck what it may run without asking. Third, cloud tasks, GitHub code review and Slack, which are tied to OpenAI's hosted Codex. OpenHands is the nearest open-source replacement for that part.
The alternatives
Claude Code
Claude Code is Anthropic's agentic coding tool for the terminal. It works on your codebase, runs commands, handles git workflows and supports MCP and hooks. It ships almost daily: v2.1.328 landed on November 19, 2026. The repository reports no open-source license. Full comparison: Claude Code vs Codex.
OpenCode
OpenCode is the MIT-licensed agent with terminal, desktop and web clients on one shared service. It connects to OpenAI with an API key or a ChatGPT sign-in, plus GitHub Copilot, Azure, OpenRouter and OpenAI-compatible servers. Since 2.3.1 it keeps timed-out shell commands running in the background and adds automations. See OpenCode alternatives if you want the reverse view.
Gemini CLI
Gemini CLI is Google's Apache-2.0 terminal agent. You can start with a free Google account tier and move to a Gemini API key, Vertex AI or a paid Google plan. 0.69.0 adds a daily token heatmap and fails fast on exhausted quotas. More in Gemini CLI alternatives.
Cline
Cline is an Apache-2.0 coding agent you can use as an IDE extension, a CLI or an SDK. It suits people who want to watch and approve each step in the editor. It releases less often than Codex: the last stable tag is v4.1.26 from October 26, 2026. See Cline alternatives.
OpenHands
OpenHands is the MIT-licensed project for building and running coding agents. It has a CLI, a local GUI, an agent SDK and scheduled or event-driven automations, and works with any model. If what you like about Codex is handing off a task and coming back to a branch, this is the open-source way to get that on your own machines. See OpenHands alternatives.
Goose
Goose is an Apache-2.0 agent described by its repository as an extensible AI agent that goes beyond code suggestions. It fits jobs that mix code with other tools through extensions. Note the GitHub repository now lives at aaif-goose/goose; the old block/goose address redirects.
How to switch without losing work
Keep project rules in one AGENTS.md at the repository root; OpenCode reads it, and you can copy or link it to CLAUDE.md for Claude Code. Move MCP server entries from ~/.codex/config.toml into the new tool's config one at a time and sign in again where they use OAuth. Recreate your sandbox limits on purpose rather than accepting the new tool's defaults. Then run the same task in Codex and the new agent and compare the diffs and token use before you switch for good.
Sources checked November 19, 2026: GitHub repositories, releases and licenses, and each tool's page on this site. We did not benchmark these agents. More in the coding agents category.
The picks
- Rank 1
Claude Code
Anthropic's agentic coding tool for the terminal, with MCP and hooks.
Pros
- The closest like-for-like swap: a vendor terminal agent with sandboxing, MCP and hooks.
- Largest community here: about 156,000 GitHub stars on November 19, 2026.
Cons
- No open-source license on the repository, unlike Apache-2.0 Codex.
- Centred on Claude models; your ChatGPT plan does not carry over.
Pricing Usage comes from a Claude plan or Anthropic API billing.
MIT-licensed coding agent with terminal, desktop and web clients and any-provider model access.
Pros
- Can sign in with ChatGPT, so you can keep the plan you use for Codex and still switch providers.
- About 228,000 stars; 2.3.2 shipped on November 18, 2026.
Cons
- Defaults change between minor versions; read release notes before updating.
- Not built by a model vendor, so new OpenAI features may arrive later than in Codex.
Pricing Free client; you pay your model provider or subscription.
Google's Apache-2.0 terminal agent for Gemini models.
Pros
- Same Apache-2.0 license as Codex, and a free Google tier to start.
- v0.69.0 shipped on November 19, 2026.
Cons
- Built around Gemini models.
- Pre-1.0 version numbers and frequent changes.
Pricing Free CLI; a free Google account tier, a Gemini API key, Vertex AI or a paid Google plan.
Apache-2.0 coding agent available as an IDE extension, CLI or SDK.
Pros
- Lets you approve each step in the editor instead of a terminal.
- Works with many model providers.
Cons
- Last stable tag is v4.1.26 from October 26, 2026.
- Less suited to headless CI runs than Codex's exec mode.
Pricing Free software; model providers bill separately.
MIT-licensed project to build and run coding agents locally or as automations, with any model.
Pros
- Closest open-source answer to Codex cloud tasks: scheduled and event-driven automations and an agent SDK.
- About 94,000 stars; v1.42.0 shipped on November 18, 2026.
Cons
- Heavier to run than a single CLI binary; the local GUI uses Docker.
- More moving parts if you only want a terminal pair programmer.
Pricing MIT-licensed; model providers bill separately. Hosted plans are priced by OpenHands.
Apache-2.0 extensible AI agent, originally from Block, that goes beyond code suggestions.
Pros
- Extension-based, so it fits work that mixes code with other tools.
- About 57,000 stars; v1.60.1 shipped on November 18, 2026.
Cons
- Less focused on repository editing than Codex.
- The GitHub repository moved from block/goose to aaif-goose/goose; update old links and scripts.
Pricing Apache-2.0 client. Provider access is separate.
Questions
What is the best Codex alternative?
Claude Code if you want another vendor terminal agent and mostly use Claude models. OpenCode if you want to keep a ChatGPT sign-in but also use other providers. Gemini CLI if you want the same Apache-2.0 license and a free Google tier to start.
Is there an open-source alternative to Codex?
Codex CLI itself is open source under Apache-2.0. Open-source alternatives include OpenCode (MIT), Gemini CLI, Cline and Goose (Apache-2.0) and OpenHands (MIT). Claude Code has no open-source license on its repository.
Codex vs Claude Code: which should I use?
Pick by your models and plan. Codex uses a ChatGPT plan's Codex allowance or OpenAI API billing; Claude Code uses a Claude plan or Anthropic API billing. Both run in the terminal with sandboxing and MCP. Our Claude Code vs Codex comparison goes into detail.
Can I keep my AGENTS.md when I leave Codex?
Mostly. OpenCode reads AGENTS.md and falls back to CLAUDE.md, and several other agents read AGENTS.md too. Claude Code reads CLAUDE.md, so copy or link the file. Codex sandbox profiles and config.toml settings do not port.