Qwen Code vs Codex CLI
Both are alternatives to Claude Code. Here's how they stack up — verified facts, no spin.
Also searched as Codex CLI vs Qwen Code — same comparison, one verdict.
Qwen Code keeps your data local by default and Codex CLI keeps it in the vendor's cloud — for most teams that single fact decides it.
Qwen Code
An Apache-2.0 agent that measures itself against Claude Code and runs on any provider.
Qwen Code (Apache-2.0, from the Qwen team at Alibaba Cloud) is an open-source coding agent for the terminal, IDE plugins for VS Code, JetBrains and Zed, a desktop app, a web UI and chat. It began as a fork of Google's Gemini CLI v0.8.2 and has developed independently since v0.1. Its README compares it to Claude Code feature by feature (subagents and agent teams, skills, hooks, MCP, plan mode, sandboxing) and it is multi-protocol: OpenAI, Anthropic, Gemini and Qwen APIs, any third-party provider, or local models through Ollama or vLLM. It has deep integrations for Alibaba's own Qwen models, which is both its strength and its bias.
Codex CLI
OpenAI's Apache-2.0 terminal agent, included in the ChatGPT plan you may already pay for.
Codex CLI is OpenAI's coding agent that runs locally on your computer, and unlike Claude Code its client is open source under Apache-2.0. For a subscriber it is the most direct like-for-like swap: sign in with ChatGPT and it draws on your plan (OpenAI's pricing page lists the CLI from Plus at $20/month, with Pro plans at $100, $200 or $500), or use an API key at API rates. It also has a documented local path: pass `--oss` to run against Ollama or LM Studio, and custom OpenAI-compatible providers can be added in its config. The same agent is available as IDE extensions, a desktop app and a cloud agent.
Side by side
6 points of comparison, every one read from a verified field. Green marks the side that wins a row outright. A dash means we do not hold that fact — never that it is zero.
| Qwen Code | Codex CLI | |
|---|---|---|
| Sovereignty ScoreOur transparent 0–100 composite for data ownership and exit cost. | 91 | 79 |
| Open source | Yes | Yes |
| Self-hostable | Yes | Yes |
| Local-first data | Yes | No |
| License | Apache-2.0 | Apache-2.0 |
| Pricing | Free and open source (Apache-2.0); you pay your chosen provider, or nothing beyond hardware with a local model. | Free, open-source client (Apache-2.0). Included with ChatGPT plans, with the CLI listed from Plus ($20/month) and Pro from $100/month; or an API key at API rates. Local models via --oss cost nothing extra. Verified on OpenAI's Codex pricing page 2026-10-03. |
Qwen Code edges it on the Sovereignty Score, but the right pick depends on the trade-offs below.
Qwen Code
Strengths
- +Near feature parity with Claude Code on paper, per its own comparison table: subagents, skills, hooks, MCP, plan mode and sandbox
- +Multi-protocol: OpenAI, Anthropic, Gemini and Qwen APIs, any third-party provider, or local Ollama and vLLM
- +A wide surface: terminal, VS Code, JetBrains and Zed plugins, desktop app, web UI and SDK
- +Very active, with commits daily and about 28k GitHub stars
Trade-offs
- −Tuned first for Qwen models; other providers work, but that is where the integration is deepest
- −The parity table is the project's own claim, so test it on your repository before relying on it
- −The default standalone installer downloads from an Alibaba Cloud storage bucket; npm (Node 22+) and Homebrew are alternatives if your policy cares where binaries come from
Codex CLI
Strengths
- +An open-source client (Apache-2.0) you can read, audit and fork
- +Uses a ChatGPT plan you may already pay for, so there is no second subscription
- +Documented local mode: `--oss` with Ollama or LM Studio, plus custom OpenAI-compatible providers
- +A similar spread of surfaces to Claude Code: terminal, IDE extensions, desktop app and cloud agent
Trade-offs
- −The client is open but the default models and the plan are OpenAI's, so you trade one vendor's subscription tie for another's
- −Codex shares usage with ChatGPT under OpenAI's plan limits, the same shape of constraint as Claude's plans
- −Project instructions live in AGENTS.md, so CLAUDE.md conventions need moving across
- −Local mode is a supported path rather than the tuned experience; expect a capability gap against OpenAI's hosted models
Which one fits you
The trade-offs above, turned into a decision. Find the line that describes your team.
Choose Qwen Code
if your data should stay on machines you control, and near feature parity with Claude Code on paper, per its own comparison table: subagents, skills, hooks, MCP, plan mode and sandbox.
Choose Codex CLI
if an open-source client (Apache-2.0) you can read, audit and fork.
Neither, yet
if both carry a real cost you should weigh first — tuned first for Qwen models; other providers work, but that is where the integration is deepest, and the client is open but the default models and the plan are OpenAI's, so you trade one vendor's subscription tie for another's. If either of those is a dealbreaker for your team, the shortlist is wrong rather than the choice.
Qwen Code vs Codex CLI — common questions
Is Qwen Code a better fit than Codex CLI for ai coding assistants?
It depends on what you are optimising for, and the honest split is this: Qwen Code scores 91 to Codex CLI's 79 on data ownership and exit cost, so it is the safer choice if you care about being able to leave. Codex CLI earns its place on a different axis — an open-source client (Apache-2.0) you can read, audit and fork. Neither is a wrong answer for every team; the table above is the actual comparison.
What happens if we want to switch later?
Qwen Code keeps its data local or in open formats, so leaving is an export rather than a negotiation. Codex CLI is still self-hostable, so the files stay on your server either way — but it is not local-first by design, so check what its export produces before you rely on it.
Can I self-host Qwen Code or Codex CLI?
Both can be self-hosted. The difference is what it costs you in time rather than whether it is possible — see the setup and maintenance rows above.
Are Qwen Code and Codex CLI both alternatives to Claude Code?
Yes — both appear in our Claude Code comparison, which is why they are worth putting side by side. People usually arrive here already having decided to move off Claude Code and now choosing between the two replacements, which is a narrower and much easier question.
More ai coding assistants comparisons
Related alternative guides
Facts verified 2026-10-03. Licenses and pricing change — spotted something out of date? That's a correction we want.