---
title: "Codex vs Claude Code in November 2026: which agent fits your work"
type: "deep dive"
url: "https://aifordevs.org/articles/codex-vs-claude-code"
markdown: "https://aifordevs.org/articles/codex-vs-claude-code.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/articles/codex-vs-claude-code"
description: "Codex vs Claude Code, checked November 16, 2026: default models, plans, sandboxing, AGENTS.md, MCP, hooks, CI, cloud agents, and dated benchmarks."
author: "AI for Devs"
published: "2026-11-16"
level: "Intermediate"
topics: ["coding-agents", "models"]
---

# Codex vs Claude Code in November 2026: which agent fits your work

Codex vs Claude Code, checked November 16, 2026: default models, plans, sandboxing, AGENTS.md, MCP, hooks, CI, cloud agents, and dated benchmarks.

> **TL;DR**
>
> - As of November 16, 2026, Claude Code starts every paid plan on Claude Opus 5.5 at medium effort, and Codex points paid plans to GPT-6.1 Sol. The entry plan for each costs $20 a month.
> - The biggest Codex vs Claude Code difference is the default safety boundary. Codex runs commands inside an operating system sandbox with no network, while Claude Code starts in auto mode, where a classifier model reviews commands and the Bash sandbox stays off until you turn it on.
> - One instruction file now serves both agents: Codex reads AGENTS.md, and Claude Code reads it when no CLAUDE.md exists, or through an `@AGENTS.md` import.
> - On the third-party Terminal-Bench 4.1 board, Claude Code with Opus 5.5 resolves 65.76% of trials at $14.30 each, and Codex with GPT-6.1 Sol resolves 60.91% at $1.92 each.
> - Pick Claude Code for long interactive sessions and policy hooks; pick Codex for unattended runs, cost per task, native Windows, and GitLab cloud tasks.

Codex vs Claude Code is now a choice between two agents with mostly matching features: both run in a terminal, an IDE, a desktop app, and the cloud, and both read AGENTS.md, connect to MCP servers, and load Agent Skills. The differences that matter sit in the defaults, such as which model a session starts on, what a command can touch before anyone approves it, and what a solved task costs. Every claim below was checked against OpenAI's and Anthropic's own docs on November 16, 2026, for Claude Code v2.1.325 and Codex CLI 0.169.0. Model rankings live in the [best LLM for coding](https://aifordevs.org/articles/best-llm-for-coding) comparison, so this page sticks to the two agent tools.

## Codex vs Claude Code at a glance

Claude Code and Codex cover the same surfaces and extension points. They differ in safety defaults, source licensing, model reach, and where cloud work can start. Both versions below were released on November 13, 2026.

| | Claude Code (Anthropic) | Codex (OpenAI) |
| --- | --- | --- |
| Version checked | v2.1.325 | CLI 0.169.0 |
| Surfaces | Terminal, VS Code and Cursor, JetBrains, desktop app, web, mobile, Slack | Terminal, IDE extension for VS Code, Cursor, and Windsurf, Xcode and JetBrains integrations, ChatGPT desktop app, web, mobile, Slack, Linear |
| Source | Proprietary | CLI and SDK under Apache 2.0; IDE extension and cloud closed |
| Default model on paid plans | Opus 5.5, medium effort | GPT-6.1 Sol, per OpenAI's guidance |
| Default local safety | Auto mode: a classifier reviews commands; Bash sandbox off | Auto preset: OS sandbox, workspace writes only, no network |
| Project instructions | CLAUDE.md, or AGENTS.md when no CLAUDE.md exists | AGENTS.md and AGENTS.override.md |
| Settings | `settings.json` at user, project, local, and managed levels | `config.toml` for user, trusted project, and managed `requirements.toml` |
| Headless | `claude -p`, Agent SDK for Python and TypeScript | `codex exec`, Codex SDK for TypeScript |
| CI | `anthropics/claude-code-action@v1` | `openai/codex-action@v1` |
| Cloud tasks | Cloud sessions; cloning needs GitHub | Codex Cloud; GitHub, GitLab, or no repository |
| Model sources | Claude models only, from Anthropic, Bedrock, Google Cloud, or Foundry | Any Responses API provider, plus Ollama and LM Studio |

Claude Code began reading AGENTS.md in v2.1.277 on September 18, 2026, and Codex CLI has an `/import` command that copies a Claude Code setup, so a team can trial both agents on one repository without rewriting its instructions.

## Default models and model choice

Claude Code starts on Claude Opus 5.5 and Codex starts on GPT-6.1 Sol for paid plans. Both switch models mid-session with `/model` and expose effort levels.

In Claude Code, the `default` setting resolves to Opus 5.5 on Pro, Max, Ultra, Team, Enterprise, the Anthropic API, Amazon Bedrock, and Google Cloud. Microsoft Foundry still defaults to Sonnet 4.5. Opus 5.5, Sonnet 5.5, and Haiku 5.5 start at `medium` effort, with `low` through `max` available. Fable 5.2, Anthropic's most capable model, is never the default; select it with `/model fable`. Pro bills Fable to usage credits, and Max and Ultra include it for up to half the weekly limit.

Codex reads the model from `config.toml`, and with none set it uses a recommended model from OpenAI's catalog. After GPT-5.5 retired from ChatGPT sign-in on October 14, 2026, OpenAI's guidance is GPT-6.1 Sol on Plus, Pro, Business, Enterprise, and Edu, and GPT-6 Luna on Free and Go. GPT-6 Astra is the most capable option, GPT-6.1 Terra the fast one, and GPT-6.1 Sol runs with a 500,000-token default context window in Codex. Effort runs from Low to Extra High, plus Max and an Ultra setting that splits a task across subagents.

The tools part ways on models from other vendors. Claude Code reaches Claude models through Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or any [gateway](https://code.claude.com/docs/en/llm-gateway) that speaks the Anthropic format, and Anthropic does not support routing it to non-Claude models. Codex accepts any custom provider with a compatible Responses API endpoint and ships built-in `ollama` and `lmstudio` providers for local models.

## Plans and pricing on November 16, 2026

Both vendors charge $20 a month for the entry plan that includes the CLI, and both sell heavier individual plans at $100 and $200. Codex adds a free tier, an $8 Go plan, and a $500 Pro option, while Claude's free plan has no Claude Code.

| Plan level | Claude, for Claude Code | ChatGPT, for Codex |
| --- | --- | --- |
| Free | $0; no Claude Code | $0; GPT-6 Luna in the desktop app, subject to rollout |
| Low cost | None | Go, $8 a month; GPT-6 Luna in the desktop app |
| Entry | Pro, $20 monthly or $17 a month billed annually | Plus, $20 a month; CLI, IDE extension, web, iOS, code review, GPT-6.1 Sol |
| Heavy use | Max, $100: 5x Pro usage per 5 hours and per week, $100 of API credits. Ultra, $200: 10x Pro weekly usage, no 5-hour limit for verified accounts, $200 of API credits | Pro at $100, $200, or $500 a month; no five-hour limit; Ultrafast mode on $500 |
| Team | Standard seat $25 monthly or $20 annually; Premium seat $125 or $100, with 5x Standard usage | Business, $25 per user monthly or $20 annually, 2 users or more |
| Enterprise | $20 per seat a month billed annually, 20-seat minimum, usage at API rates | Contact sales; flexible pricing runs on credits |
| Pay per token | Anthropic Console API key | OpenAI API key, without cloud features |

Anthropic publishes no message count for Claude Code. OpenAI publishes estimates for Codex: Plus covers 15 to 160 local GPT-6.1 Sol messages per five-hour window, 5 to 45 on GPT-6 Astra, and 350 to 3,000 on GPT-6 Luna, with weekly limits on top. Anthropic says enterprise deployments of Claude Code average about $13 per developer per active day, and its plan usage is shared with Claude on the web, desktop, and mobile.

With an API key, you pay token rates instead. Claude Opus 5.5 costs $4 per million input tokens and $20 per million output, and GPT-6.1 Sol costs $2 and $10 at short context, rising to $4 and $15 at long context. Codex on a ChatGPT plan charges no long-context surcharge for GPT-6.1 Sol. The [Claude API pricing guide](https://aifordevs.org/articles/claude-api-pricing) and the [LLM pricing dataset](https://aifordevs.org/data/llm-pricing) carry the full rate tables.

Speed costs extra on both. Codex Fast mode draws on included limits at 2.5x the Standard rate, and Anthropic's fast mode for Opus 5.5 and Fable 5.2 runs up to 2.5x faster at 2x standard pricing.

## Sandboxing and approval modes compared

Codex fences commands with the operating system by default, while Claude Code reviews them with a second model by default. That difference decides how much you can leave either agent unattended.

Codex's Auto preset pairs a `workspace-write` sandbox with `on-request` approvals. Commands run inside Seatbelt on macOS, bubblewrap on Linux and WSL2, or the native Windows sandbox, with writes limited to the workspace and network access off. Going outside the workspace or onto the network triggers an approval prompt, and `.git`, `.codex`, `.agents`, and `.aws` stay read-only inside the workspace. For a folder outside version control, Codex recommends `read-only` mode instead.

Setting `approvals_reviewer = "auto_review"` sends eligible prompts to a reviewer agent that checks for data exfiltration, credential probing, and destructive actions, and fails closed on errors. The `--yolo` flag removes both the sandbox and the prompts.

Claude Code v2.1.283 and later start interactive sessions in [auto mode](https://code.claude.com/docs/en/permission-modes). Reads and edits in the working directory run, and nearly everything else goes to a classifier, Claude Sonnet 5 by default. It blocks actions that escalate beyond your request, target unrecognized infrastructure, or appear driven by hostile content. The Bash sandbox, built on Anthropic's open-source sandbox runtime, stays off until you run `/sandbox`, and it works on macOS, Linux, and WSL2 only. On native Windows, Claude Code runs commands unsandboxed.

**Figure 1.** At launch, Codex fences commands with the operating system and asks before leaving the fence, while Claude Code sends the same actions to a classifier model. In headless runs, both refuse edits until you widen their permissions.

Headless runs are stricter in both tools. `codex exec` starts in a read-only sandbox, and from v2.1.302 `claude -p` starts in Manual mode, denying any call that needs approval unless an allow rule, hook, or callback approves it. Destructive MCP tool calls get a check in both: Codex always prompts when a tool advertises a destructive annotation, and Claude Code's classifier reviews MCP calls in auto mode.

Anthropic's own docs warn that auto mode reduces prompts but does not guarantee safety. For unattended local work, the OS boundary Codex applies by default is the stronger guarantee. Claude Code reaches the same place once you turn on its sandbox or run it inside a container.

## AGENTS.md and CLAUDE.md: one file for both agents

Keep your rules in AGENTS.md and add a CLAUDE.md that imports it. Codex ignores CLAUDE.md by default, and Claude Code skips AGENTS.md once any CLAUDE.md exists.

Codex builds its instruction chain once per session: `~/.codex/AGENTS.md` first, then one file per directory from the repository root down to the working directory, checking `AGENTS.override.md` before `AGENTS.md`. It stops adding files at 32 KiB by default, set by `project_doc_max_bytes`. Claude Code v2.1.277 and later load AGENTS.md only when no `CLAUDE.md`, `.claude/CLAUDE.md`, or `CLAUDE.local.md` sits in the working directory or above it.

**Figure 2.** Both agents read the same rules only when the repository has AGENTS.md alone, or a CLAUDE.md that imports it. A CLAUDE.md without the import hides AGENTS.md from Claude Code, and Codex never reads CLAUDE.md unless you list it as a fallback filename.

The fourth row is the layout to use. The import line comes first, and anything only Claude Code needs goes below it:

```markdown title="CLAUDE.md"
@AGENTS.md

## Claude Code only

Ask before running database migrations.
```

Settings live in different files. Claude Code uses JSON `settings.json` files, and Codex uses `config.toml` in `~/.codex` or a trusted project's `.codex` folder. Codex CLI's [`/import` command](https://learn.chatgpt.com/docs/import) converts a Claude Code setup: instruction files become AGENTS.md, `settings.json` becomes `config.toml`, and up to 50 chats from the last 30 days come along. [Context engineering](https://aifordevs.org/articles/context-engineering) covers what to put in the file and how to keep it short.

## MCP, skills, subagents, and hooks

Both agents implement [MCP](https://aifordevs.org/glossary#mcp) and the open Agent Skills format, so servers and `SKILL.md` folders move between them with little change. The gaps are in delegation and hooks: Claude Code delegates to subagents without being asked and fires hooks at 33 lifecycle events, while Codex delegates when asked and fires hooks at 14.

| Extension point | Claude Code | Codex |
| --- | --- | --- |
| MCP transports | stdio, HTTP, WebSocket, and SSE (deprecated) | STDIO and streamable HTTP |
| MCP config | `~/.claude.json` for local and user scope, `.mcp.json` for project scope | `~/.codex/config.toml` or a trusted `.codex/config.toml`, shared by app, CLI, and IDE |
| Skills | `.claude/skills/<name>/SKILL.md`, run as `/name` or loaded automatically | `.agents/skills` up to the repository root and in your home folder, run as `$name` or loaded automatically |
| Subagents | Built-in Explore and Plan; custom Markdown agents in `.claude/agents/`; delegates when a task matches an agent's description | Delegates when you ask, when AGENTS.md or a skill says to, or on its own at Ultra effort; custom TOML agents in `.codex/agents/` |
| Hooks | 33 events; command, HTTP, MCP tool, prompt, and subagent handlers | 14 events; scripts or MCP tools; non-managed hooks need trust before they run |

An MCP server you build works in both, since each takes the same stdio command or streamable HTTP URL, and [building an MCP server](https://aifordevs.org/articles/build-an-mcp-server) walks through one. Codex reads each server's `instructions` field, and OpenAI advises keeping its first 512 characters self-contained.

Because Claude Code delegates by description, a well-described reviewer subagent runs without a prompt, while Codex waits for you, AGENTS.md, or a skill to ask. Claude Code's agent teams, which coordinate several full sessions, are experimental and off by default.

Claude Code's 33 hook events include `PreToolUse`, `PermissionRequest`, `FileChanged`, `WorktreeCreate`, and `PreModelSwitch`. Codex's 14 events include `PreModelRequest` and `PostModelRequest`, which fire around every model call. If your team enforces rules in code around the agent, Claude Code gives you more places to do it.

## Headless runs, CI, and cloud agents

Both tools run unattended from a script, a GitHub workflow, or the vendor's cloud. Codex has safer defaults in untrusted checkouts and reaches more repository hosts from its cloud, and Claude Code has more ways to trigger a cloud run.

`claude -p` and `codex exec` both print the final answer to stdout. Claude Code adds `--output-format json` or `stream-json`, and a `--bare` flag that skips hooks, skills, MCP servers, and CLAUDE.md, which Anthropic plans to make the default for `-p`. Without `--bare`, a `-p` run in a folder you never trusted still runs that folder's hooks and connects its `.mcp.json` servers. `codex exec` streams JSON Lines with `--json` and checks the final answer against a schema with `--output-schema`. Since 0.169.0, it keeps project config and MCP servers off in untrusted directories unless you pass `--trust`.

In GitHub Actions, `anthropics/claude-code-action@v1` answers `@claude` mentions in issues and pull requests and can push commits, and `/install-github-app` sets it up from the CLI. `openai/codex-action@v1` installs the CLI, starts a Responses API proxy so the key stays out of the job's environment, and runs `codex exec`. Each vendor also offers a managed pull request review, and both document GitLab setups.

[Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web) run Claude Code on Anthropic-managed infrastructure for Pro, Max, Ultra, and Team plans, and for Enterprise premium seats. `claude --cloud` sends a task from the terminal, and scheduled tasks, in research preview, fire on a schedule, an API call, or a GitHub event. Cloning and pull requests in Anthropic-hosted environments require GitHub. [Codex Cloud](https://learn.chatgpt.com/docs/cloud) starts tasks from the web, the desktop app, mobile, or `codex cloud exec`, can begin with no repository, and checks out GitHub or GitLab repositories through reusable environments.

## Benchmark results and who ran them

On third-party boards, Claude Code holds the top score and Codex holds the lower cost per task. Every row pairs an agent with a model, and no board runs one model in both agents, so these numbers compare products rather than agent loops alone.

[Terminal-Bench 4.1](https://www.tbench.ai/), hosted by Stanford, Harbor, and Laude Institute, updated its task verifiers on November 9, 2026, and runs 66 tasks five times each. Each row names the maker of its agent and model but not who submitted the run. On November 16, the best Claude Code rows were Opus 5.5 and Fable 5.2 at max effort, both at 65.76%, and the best Codex row was GPT-6.1 Sol at max effort, at 60.91% ±2.97.

**Figure 3.** Claude Code rows hold the top Terminal-Bench 4.1 score, and Codex rows hold the low-cost end. Claude Code with Kimi K3.1 Pro lands beside Codex with GPT-6.1 Sol, so the model moves cost more than the agent does.

The cost per solved trial widens the gap. This script divides each row's published total cost by its trials and its resolved trials, and it ran on Python 3.15.1 with no dependencies:

```python title="tb_cost.py"
TRIALS = 330  # 66 tasks, 5 trials each

rows = [
    # agent, model, resolved trials, total cost in USD
    ("Claude Code", "Opus 5.5", 217, 4718.65),
    ("Claude Code", "Kimi K3.1 Pro", 197, 1086.66),
    ("Codex", "GPT-6.1 Sol", 201, 634.24),
    ("Codex", "GPT-6 Astra", 199, 3267.18),
]

for agent, model, solved, cost in rows:
    print(
        f"{agent:<12} {model:<14} {solved / TRIALS:6.2%}"
        f"  ${cost / TRIALS:6.2f} a trial  ${cost / solved:6.2f} a solved trial"
    )
```

```text
Claude Code  Opus 5.5       65.76%  $ 14.30 a trial  $ 21.74 a solved trial
Claude Code  Kimi K3.1 Pro  59.70%  $  3.29 a trial  $  5.52 a solved trial
Codex        GPT-6.1 Sol    60.91%  $  1.92 a trial  $  3.16 a solved trial
Codex        GPT-6 Astra    60.30%  $  9.90 a trial  $ 16.42 a solved trial
```

[Artificial Analysis](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-codex) runs its own Coding Agent Index v2.1, built from FrontierCode-AA 2.0, Terminal-Bench 4.1, and SWE-Atlas-QnA-AA, and dates no individual row. Its headline pair puts Claude Code with Fable 5.2 at xhigh effort at 58 against Codex with GPT-6 Astra at max at 53. Claude Code took 94.7 turns and 9.75 million tokens per task against 40.8 turns and 3.47 million for Codex, and cost $15.47 per task against $7.63. At matched scores the costs split the same way: Codex with GPT-6.1 Sol scored 52 at $1.51 a task, and Claude Code with Fable 5.2 at medium effort scored 53 at $2.89.

The Claude Code rows for Kimi K3.1 Pro and DeepSeek V4.1 Flash show the agent running other vendors' models, a setup Anthropic does not support. To choose a model rather than an agent, use the [best LLM for coding](https://aifordevs.org/articles/best-llm-for-coding) picks.

## Run Codex and Claude Code through one gateway

A gateway between both agents and the providers gives one place to hold provider keys, set budgets, and log every request, and it lets you change models without touching each laptop. [Bifrost](https://www.getmaxim.ai), an [open-source AI gateway](https://github.com/maximhq/bifrost), has documented setups for both agents.

[Claude Code connects](https://docs.getbifrost.ai/cli-agents/claude-code) through the Anthropic-compatible `/anthropic` path: set `ANTHROPIC_BASE_URL` to the gateway and `ANTHROPIC_AUTH_TOKEN` to a Bifrost virtual key. To keep billing on Claude subscriptions, sign in with `/login` and send the virtual key in an `x-bf-vk` header instead, so Bifrost applies governance and logging while plan limits still apply.

[Codex CLI connects](https://docs.getbifrost.ai/cli-agents/codex-cli) as a named custom provider on the `/openai/v1` path:

```toml title="~/.codex/config.toml (not run here)"
model = "openai/gpt-6.1-sol"
model_provider = "bifrost"

[model_providers.bifrost]
name = "Bifrost"
base_url = "http://localhost:8080/openai/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"
requires_openai_auth = false
supports_websockets = false
```

Codex appends `/responses` to the base URL, so the trailing `/v1` is required, and `OPENAI_API_KEY` holds the virtual key. Codex signed in with ChatGPT can also pass through Bifrost with the key in an `x-bf-vk` header, but routing, fallbacks, and non-OpenAI models do not apply on that path. The [Bifrost CLI](https://docs.getbifrost.ai/quickstart/cli/coding-agents) skips the file edits and launches either agent with the gateway, credential, and model set for that process only:

```bash title="not run here"
bifrost claude --model anthropic/claude-opus-5-5
bifrost codex --model openai/gpt-6.1-sol
```

Comparing models in one agent comes down to [routing rules](https://docs.getbifrost.ai/providers/routing-rules), CEL expressions scoped to a virtual key, team, customer, or the whole gateway. A rule can rewrite the model name Claude Code sends for its `sonnet` alias, so the same client can run Opus 5.5 one week and Sonnet 5.5 the next. Keep a recognizable Claude model name in that value if you rely on auto mode, because an arbitrary alias can stop Claude Code from treating the model as auto-mode capable. Codex needs the full `provider/model` ID at launch, and a non-OpenAI model must handle Responses tool calls through Bifrost.

[Budgets](https://docs.getbifrost.ai/features/governance/budget-and-limits) sit on each developer's virtual key and reset daily, weekly, monthly, quarterly, or yearly, alongside token and request limits per minute, hour, or day. They nest from customer to team to virtual key to provider config, and a request must pass every level. Both agents send a session header that Bifrost uses for [session affinity](https://docs.getbifrost.ai/providers/session-affinity), so a session and its subagents stay on one provider and key and keep hitting the same prompt cache. The [skills repository](https://docs.getbifrost.ai/features/skills-repository) can also serve as a skills marketplace for both agents, so one versioned `SKILL.md` reaches each.

Both agents mostly run on employee laptops, outside any shared config. [Bifrost Edge](https://www.getmaxim.ai/edge) extends the gateway's governance to those machines: it routes traffic from Claude Code, Codex CLI, and the Codex desktop app through the same gateway, so the budgets, guardrails, and audit logs set there apply without per-laptop setup. Edge requires the Enterprise gateway, and its [supported applications](https://docs.getbifrost.ai/edge/supported-applications) page lists what it covers. The Bifrost details here describe its docs as of November 16, 2026.

## Codex or Claude Code: picks by situation

If you can fund only one, choose Claude Code for long interactive sessions on hard code and for teams that enforce policy through hooks. Choose Codex for unattended runs, cost per solved task, native Windows, local models, and cloud tasks on GitLab. The table gives one pick per situation, dated November 16, 2026.

| Situation | Pick | Evidence |
| --- | --- | --- |
| Long interactive sessions on hard problems | Claude Code | Top Terminal-Bench 4.1 rows at 65.76%; Opus 5.5 by default |
| Unattended local runs | Codex | OS sandbox with no network by default; `codex exec` starts read-only and ignores untrusted project config |
| Cost per solved task | Codex with GPT-6.1 Sol | $3.16 per solved Terminal-Bench 4.1 trial, against $21.74 for Claude Code with Opus 5.5 |
| Native Windows | Codex | Native Windows sandbox; Claude Code's sandbox needs WSL2 |
| Policy enforced around the agent | Claude Code | 33 hook events with HTTP, MCP tool, prompt, and subagent handlers |
| Cloud tasks on GitLab or with no repository | Codex | Codex Cloud checks out GitLab repositories and can start empty |
| Local or open-weight models | Codex | Built-in Ollama and LM Studio providers; Claude Code supports Claude models only |
| Source you can read and patch | Codex | CLI is Apache 2.0; Claude Code is proprietary |
| A team using both | Both, behind one gateway | One AGENTS.md, one budget per developer, one log for both agents |

To settle it on your own code, take 10 to 20 recent merged tasks, give both agents the same AGENTS.md and a matched effort level, and count the diffs you would merge per dollar spent. Rerun that set when the [coding agents hub](https://aifordevs.org/topics/coding-agents) or the [news feed](https://aifordevs.org/news) reports a new model or a changed default. Both tools changed defaults this fall: Claude Code moved to auto mode in v2.1.283 on September 25, 2026, and Codex replaced GPT-5.5 for ChatGPT sign-in on October 14.

## Questions

### Is Codex better than Claude Code?

Neither wins everywhere as of November 16, 2026. Claude Code with Opus 5.5 posts the higher Terminal-Bench 4.1 score, 65.76%, while Codex with GPT-6.1 Sol reaches 60.91% at about one-seventh the cost per solved trial. Codex has the safer local defaults and a native Windows sandbox. Claude Code has more hook events and delegates to subagents without being asked.

### Which is cheaper, Codex or Claude Code?

The entry plans cost the same, $20 a month for Claude Pro or ChatGPT Plus. Codex also runs on a free tier and an $8 Go plan with GPT-6 Luna, while Claude's free plan has no Claude Code. Per task, Codex costs less: on Terminal-Bench 4.1, GPT-6.1 Sol in Codex cost $1.92 per trial against $14.30 for Opus 5.5 in Claude Code.

### Does Claude Code read AGENTS.md?

Yes. Claude Code v2.1.277 and later load AGENTS.md as project instructions when no CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md exists in the working directory or above it. When a CLAUDE.md exists, Claude Code reads only that file unless it imports AGENTS.md with an @AGENTS.md line. Codex reads AGENTS.md and ignores CLAUDE.md unless you list it as a fallback filename.

### Can Claude Code use OpenAI models, or Codex use Claude models?

Both can reach other vendors through a gateway, but only OpenAI supports it. Anthropic does not support routing Claude Code to non-Claude models, although Terminal-Bench 4.1 lists Claude Code runs with Kimi and DeepSeek models. Codex accepts any custom provider with a compatible Responses API endpoint, so a gateway that translates those calls can serve other models, and it ships Ollama and LM Studio providers.

### Is Codex open source?

The Codex CLI and Codex SDK are open source under Apache 2.0 in the openai/codex repository on GitHub. The IDE extension and Codex Cloud are not. Claude Code is not open source: its GitHub repository holds the changelog, plugins, and examples under an all-rights-reserved notice tied to Anthropic's commercial terms, although the runtime behind its Bash sandbox is an open-source package.

### Which coding agent is safer to run unattended?

Codex, at default settings. It runs commands inside an operating system sandbox with writes limited to the workspace and no network, and codex exec starts read-only. Claude Code starts interactive sessions in auto mode, where a classifier model reviews commands but the Bash sandbox stays off until you enable it. Turn that sandbox on, or use a container, before long unattended Claude Code runs.

### Can a team use Codex and Claude Code together?

Yes, and it takes less setup than it did a year ago. Keep project rules in AGENTS.md with a CLAUDE.md that imports it, reuse the same MCP servers and SKILL.md skills, and route both agents through one gateway so each developer has one budget and one log stream. Codex CLI's /import command copies an existing Claude Code setup into Codex.

## Sources

1. [Anthropic, Claude Code overview (read November 16, 2026)](https://code.claude.com/docs/en/overview)
2. [Anthropic, Claude Code changelog, v2.1.325 (November 13, 2026)](https://code.claude.com/docs/en/changelog)
3. [Anthropic, Claude Code model configuration](https://code.claude.com/docs/en/model-config)
4. [Anthropic, Claude Code permission modes](https://code.claude.com/docs/en/permission-modes)
5. [Anthropic, Configure the sandboxed Bash tool](https://code.claude.com/docs/en/sandboxing)
6. [Anthropic, Claude Code memory, CLAUDE.md, and AGENTS.md](https://code.claude.com/docs/en/memory)
7. [Anthropic, Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp)
8. [Anthropic, Claude Code subagents](https://code.claude.com/docs/en/sub-agents)
9. [Anthropic, Claude Code agent teams](https://code.claude.com/docs/en/agent-teams)
10. [Anthropic, Claude Code skills](https://code.claude.com/docs/en/skills)
11. [Anthropic, Claude Code hooks reference](https://code.claude.com/docs/en/hooks)
12. [Anthropic, Run Claude Code programmatically](https://code.claude.com/docs/en/headless)
13. [Anthropic, Claude Code GitHub Actions](https://code.claude.com/docs/en/github-actions)
14. [Anthropic, Use Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web)
15. [Anthropic, Claude Code scheduled tasks](https://code.claude.com/docs/en/routines)
16. [Anthropic, Manage Claude Code costs](https://code.claude.com/docs/en/costs)
17. [Anthropic, Claude Code with other LLM gateways](https://code.claude.com/docs/en/llm-gateway)
18. [Anthropic, Claude plans and pricing (read November 16, 2026)](https://claude.com/pricing)
19. [Anthropic, Claude API pricing (read November 16, 2026)](https://platform.claude.com/docs/en/about-claude/pricing)
20. [Anthropic, claude-code repository and license](https://github.com/anthropics/claude-code)
21. [OpenAI, Codex CLI](https://learn.chatgpt.com/docs/codex/cli)
22. [OpenAI, Codex release rust-v0.169.0 (November 13, 2026)](https://github.com/openai/codex/releases/tag/rust-v0.169.0)
23. [OpenAI, Models in ChatGPT Work and Codex (read November 16, 2026)](https://learn.chatgpt.com/docs/models)
24. [OpenAI, Codex pricing and usage limits (read November 16, 2026)](https://learn.chatgpt.com/docs/pricing)
25. [OpenAI, Agent approvals and security](https://learn.chatgpt.com/docs/agent-approvals-security)
26. [OpenAI, Sandbox](https://learn.chatgpt.com/docs/sandboxing)
27. [OpenAI, Custom instructions with AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md)
28. [OpenAI, Import from another agent](https://learn.chatgpt.com/docs/import)
29. [OpenAI, Model Context Protocol in ChatGPT and Codex](https://learn.chatgpt.com/docs/extend/mcp)
30. [OpenAI, Codex subagents](https://learn.chatgpt.com/docs/agent-configuration/subagents)
31. [OpenAI, Build skills](https://learn.chatgpt.com/docs/build-skills)
32. [OpenAI, Codex hooks](https://learn.chatgpt.com/docs/hooks)
33. [OpenAI, Codex non-interactive mode](https://learn.chatgpt.com/docs/non-interactive-mode)
34. [OpenAI, Codex GitHub Action](https://learn.chatgpt.com/docs/github-action)
35. [OpenAI, Codex Cloud](https://learn.chatgpt.com/docs/cloud)
36. [OpenAI, Codex Cloud environments](https://learn.chatgpt.com/docs/environments/cloud-environments)
37. [OpenAI, Codex IDE extension](https://learn.chatgpt.com/docs/codex/ide)
38. [OpenAI, Codex configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference)
39. [OpenAI, Codex gateway compatibility requirements](https://learn.chatgpt.com/docs/enterprise/gateway-compatibility)
40. [OpenAI, Codex open-source components](https://learn.chatgpt.com/docs/open-source)
41. [OpenAI, API pricing (read November 16, 2026)](https://developers.openai.com/api/docs/pricing)
42. [Terminal-Bench 4.1 official leaderboard (Stanford, Harbor, Laude Institute), read November 16, 2026](https://www.tbench.ai/)
43. [Terminal-Bench news, Terminal-Bench 4.1 post (November 9, 2026)](https://www.tbench.ai/news)
44. [Artificial Analysis, Claude Code vs. Codex, Coding Agent Index v2.1 (read November 16, 2026)](https://artificialanalysis.ai/agents/coding-agents/comparisons/claude-code-vs-codex)
45. [Bifrost reference for AI systems (llm-info)](https://www.getmaxim.ai/llm-info)
46. [Bifrost docs, Claude Code](https://docs.getbifrost.ai/cli-agents/claude-code)
47. [Bifrost docs, Codex CLI](https://docs.getbifrost.ai/cli-agents/codex-cli)
48. [Bifrost docs, Bifrost CLI coding agents](https://docs.getbifrost.ai/quickstart/cli/coding-agents)
49. [Bifrost docs, Budget and limits](https://docs.getbifrost.ai/features/governance/budget-and-limits)
50. [Bifrost docs, Routing rules](https://docs.getbifrost.ai/providers/routing-rules)
51. [Bifrost docs, Session affinity](https://docs.getbifrost.ai/providers/session-affinity)
52. [Bifrost docs, Skills repository](https://docs.getbifrost.ai/features/skills-repository)
53. [Bifrost docs, Edge supported applications](https://docs.getbifrost.ai/edge/supported-applications)

## Cite this deep dive

AI for Devs. "Codex vs Claude Code in November 2026: which agent fits your work." Published November 16, 2026. https://aifordevs.org/articles/codex-vs-claude-code

- Page: https://aifordevs.org/articles/codex-vs-claude-code
- Markdown: https://aifordevs.org/articles/codex-vs-claude-code.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
- Published: 2026-11-16
