⚡ Key takeaways
- Pick by what you already pay for. Claude Code needs a paid Claude plan or a Console account; Codex CLI works with a ChatGPT plan or an OpenAI API key.
- Both install natively on Windows. Only Codex also sandboxes natively; Claude Code needs WSL 2 for that.
- Both can edit your project without asking for every step, so start either one in a Git repo.
Claude Code vs Codex is a choice between two coding agents that live in your terminal and edit files in your project. They look alike on screen, and the real differences are account, Windows support and how much each one asks before it acts. This guide compares those three things from the vendors’ own docs, so you can pick one in a few minutes.
| Tool | Best for | Main limit |
|---|---|---|
| Claude Code | Claude subscribers | No free plan; sandbox needs WSL 2 |
| Codex CLI | ChatGPT subscribers | Needs a ChatGPT plan or API key |
Claude Code vs Codex: which account do you need?
Use the one that matches the subscription you already pay for. That decides most cases before any feature does.
Claude Code requires a Pro, Max, Ultra, Team or Enterprise plan, or a Console account. The free Claude plan does not include it. You can also run it through Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry.
Codex CLI is open source under the Apache-2.0 license. You sign in with a ChatGPT plan, which the README recommends, or use an OpenAI API key. Plans and limits change, so check the live pricing pages before you subscribe.
Windows: native install, and what the sandbox needs
Both tools install natively on Windows 11 with one PowerShell line. The difference is the sandbox that limits what the agent can touch.
- Open PowerShell.
- For Claude Code, run
irm https://claude.ai/install.ps1 | iex. - For Codex CLI, run
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex". - Open a new terminal, go to a project folder and type
claudeorcodex. Both ask you to sign in on first run.
Claude Code’s docs list sandboxing as not supported on native Windows. It is supported in WSL 2, so a sandboxed setup means running Claude Code inside WSL. Git for Windows is optional; without it, Claude Code runs shell commands through PowerShell.
Codex runs on Windows as a native app, a CLI and an IDE extension, and its docs describe a native Windows sandbox that you configure in config.toml, with mxc recommended and elevated as a legacy fallback. The same page lists causes when the elevated setup fails, such as a declined administrator prompt or blocked logon rights.
How much each one asks before it acts
Both agents can read files and run commands, so what matters is what happens without your approval.
Claude Code has several permission modes, from Manual to Auto. Interactive terminal sessions start in Auto, where a separate classifier model blocks risky actions. Press Shift+Tab to cycle through the modes.
Codex uses a sandbox plus an approval policy. Its sandbox modes are read-only, workspace-write and danger-full-access. The default workspace-write lets it edit inside the workspace and run routine commands, and network access stays off unless you enable it in config. It asks before it edits outside the workspace or needs the network. In a folder that is not under version control, Codex recommends read-only. Type /permissions to switch during a session.
Instruction files: CLAUDE.md and AGENTS.md
Codex reads AGENTS.md; Claude Code reads CLAUDE.md and can read a repo’s AGENTS.md instead, so one file can serve both. See AGENTS.md vs CLAUDE.md for the setup.
Claude Code vs Codex: how to choose
Pick by your situation, not by a benchmark:
- You already pay for one of them. Use Claude Code with a Claude plan, or Codex CLI with a ChatGPT plan.
- You need the agent sandboxed on Windows. Start with Codex’s native sandbox, or run Claude Code in WSL 2.
- You pay for neither. Look at our Claude Code alternatives or the OpenCode vs Claude Code comparison.
You can use both on the same repo. Running out of quota in one is a reason to switch to the other.
Frequently asked questions
Is Codex free?
The CLI software is free and open source, but you sign in with a ChatGPT plan or an OpenAI API key. Plan limits change, so check OpenAI’s current plan page.
Can I use Claude Code without a subscription?
Yes, with a Claude Console account or through Amazon Bedrock, Google Cloud or Microsoft Foundry. The free claude.ai plan does not include it.
Which one writes better code?
Results depend on the model, the task and your project, so try both on one small real task before you commit.
The Tested Weekly
One email a week with the guides we tested, sources linked. No spam.