The right Codex alternative depends on the reason for leaving. If it’s other models, OpenCode is the closest swap: open source like Codex CLI, but with 75+ providers and local models. If it’s results, Claude Code is the one agent with rows above Codex on the public Terminal-Bench 4.0 leaderboard as of 7 November 2026, by margins close to the benchmark’s own error bars. If it’s usage limits, switching may not be needed at all. And for anyone who likes Codex, its native Windows sandbox and its ChatGPT plan, staying is the answer.
One thing to get right first: Codex CLI is already open source, under Apache-2.0. An “open-source Codex alternative” isn’t more open than Codex; it’s open source and free to use any model.
Why do people look for a Codex alternative?
-
Usage limits. Codex on a ChatGPT plan shares one allowance with the rest of ChatGPT. Plus and Business have limits per rolling five-hour window, weekly limits can apply on top, and once they run out you buy credits or wait. See Codex pricing.
-
It’s built around OpenAI’s models. Codex can use local models through Ollama or LM Studio, and other providers only if they speak OpenAI’s Responses API: that’s the only protocol its config accepts. You can’t point it at any provider that offers a standard chat endpoint.
This is a direction, not an oversight. OpenAI’s push of the Responses API, with built-in tools, state, background tasks and tracing moves a model vendor up the stack into the runtime itself. A harness built on that API follows the vendor’s choices about where tools and state live.
-
Windows friction. Codex runs natively in PowerShell with its own sandbox, which is more than most agents offer. But the recommended sandbox needs recent Windows 11 builds, the fallback needs administrator setup, and users report repeated elevation prompts. Dev servers started in the background stop when the command that started them exits.
-
Approval prompts. In the default mode Codex asks before commands that leave the sandbox, and on a real task that adds up.
Can you fix it without switching?
Often.
For limits, use an API key instead of your ChatGPT plan. Usage is then billed per token at API rates and doesn’t touch your ChatGPT allowance. See Codex: API key vs subscription for when that’s cheaper.
For other models, run a local model:
codex --oss --local-provider ollama
Or add a provider that supports the Responses API to ~/.codex/config.toml:
model_provider = "myprovider"
[model_providers.myprovider]
name = "My provider"
base_url = "https://api.example.com/v1"
env_key = "MY_PROVIDER_API_KEY"
wire_api = "responses"
This only works in the user-level ~/.codex/config.toml. A project’s .codex/config.toml can’t set model_provider or model_providers, so a provider block in the repo is ignored.
For prompts, keep the sandbox and hand routine approvals to Codex’s reviewer:
codex --approve-for-me
That uses the workspace-write sandbox with an automatic reviewer. Don’t reach for --yolo instead: it removes the sandbox too. See YOLO mode.
On Windows, see Codex on Windows for the sandbox options, or run Codex in WSL if you need Linux tooling anyway.
The main Codex alternatives
| Tool | Open source | Models | Pick it if |
|---|---|---|---|
| OpenCode | Yes, MIT | 75+ providers; ChatGPT and Copilot sign-in; Ollama, LM Studio, llama.cpp | You want a terminal agent like Codex CLI with any model |
| Claude Code | No | Claude only | You want the top benchmark results and pay for Claude |
| Cline | Yes, Apache-2.0 | Many providers; can sign in with your ChatGPT plan | You want the agent in VS Code or JetBrains |
| Kilo Code | Yes, MIT; owned by Anaconda | 500+ models via Kilo Gateway, your keys, local | You want an IDE agent with a free-models option |
| GitHub Copilot | No | Many vendors through GitHub | You want a free tier, or your team is on GitHub |
| Contenox | Yes, Apache-2.0 | ChatGPT and Claude (through Claude Code) plans, Copilot unofficially; API keys; local | You want a Windows desktop app with readable permission rules |
You can keep paying for ChatGPT and still switch tools: OpenCode, Cline and Contenox all sign in with a ChatGPT plan.
Codex vs Claude Code
| Codex | Claude Code | |
|---|---|---|
| License | CLI: Apache-2.0 | Proprietary; public repo, all rights reserved |
| Models | OpenAI; local; Responses API providers | Claude only |
| Free plan | ChatGPT Free includes Codex | No; needs a paid Claude plan or Console account |
| Windows | Native, with a Windows sandbox | Native; sandbox only in WSL 2 |
| Terminal-Bench 4.0, best row | 58.18% (GPT-6 Astra, GPT-6.1 Sol) | 64.85% (Opus 5.5) |
| Surfaces | CLI, IDE extension, ChatGPT desktop app, cloud | Terminal, VS Code, JetBrains, desktop, web |
On the Terminal-Bench 4.0 leaderboard, Claude Code holds the top two rows. Codex’s best rows sit just above Claude Code with Fable 5.1 and a few points below Opus 5.5 and Sonnet 5.5. Each score has a margin of about 3 points, so treat them as close. Pick by the plan already paid for and by platform: Codex does more natively on Windows. Practitioners don’t treat it as either-or: in a Hacker News thread from November 2026 on current setups, Claude Code is the most common answer and Codex shows up mostly as the reviewer next to it.
Codex vs OpenCode
| Codex CLI | OpenCode | |
|---|---|---|
| License | Apache-2.0 | MIT |
| Models | OpenAI; local; Responses API providers | 75+ providers, local, OpenCode’s own model plans |
| Sign in with a plan | ChatGPT | ChatGPT Plus/Pro, GitHub Copilot |
| Windows | Native, with a Windows sandbox | Native install; docs recommend WSL |
| Interfaces | CLI, IDE extension, ChatGPT desktop app, cloud | Terminal, desktop app (beta), IDE extension |
| Read-only mode | --sandbox read-only |
The plan agent (Tab to switch) |
OpenCode wins on model choice; Codex wins on Windows and on its sandbox. Both can sign in with ChatGPT, so you can try OpenCode on the same plan before you decide.
The Claude-plan gotcha: OpenCode can’t use a Claude Pro or Max subscription. Anthropic doesn’t allow it, and OpenCode removed those plugins in version 1.3.0. Use an Anthropic API key there.
Who should stay with Codex
- You pay for ChatGPT and its limits are fine for your work.
- You work on native Windows and want a sandbox without WSL.
- You use Codex’s cloud tasks or the ChatGPT desktop app alongside the CLI.
- You want an open-source agent and OpenAI’s models are the ones you use.
Contenox
Contenox is a free, open-source desktop app, built Windows-first. It signs in with a ChatGPT plan by device code, or takes Claude, Copilot, API keys or a local model, switchable per session. The difference from Codex: what the agent may do without asking is a rule set that can be read and changed under Permissions, not a reviewer model’s call; the destructive commands and credential stores stay gated or blocked (built-in tools and permissions). On Windows, a sandbox limits writes to the project folder. Download it here.
Related guides
- Best AI coding agents: the full ranking with criteria
- Open source AI coding agents: license and status for each
- Codex API key vs subscription: the limits fix
- Codex on Windows: sandbox setup and its traps
- Claude Code alternative: the same question from the other side