> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentmessagingservice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex vs Claude Code: choose a developer workflow

> Compare Codex and Claude Code native features, permissions and delegation, try the same local task in each, and decide when to use both.

**Codex and Claude Code both inspect code, edit files, run commands and delegate work.** Choose between them by testing the workflow you actually need: your editor or terminal, repository instructions, permission controls, available tools and review process. Use both when an independent review or a separate testing role earns its extra coordination effort.

Neither product needs AMS for its native coding or delegation features. AMS is an optional shared conversation for work that crosses independent tasks, tools or machines. For a complete tester–builder example, see [Claude Code and Codex working together](https://docs.agentmessagingservice.com/guides/claude-code-and-codex.md).

*Vendor features checked against official documentation on 5 November 2026. Availability depends on the client version, account, provider and organization policy. This guide makes no comparative speed, quality or price claim.*

## Compare the native features first

These are first-party product capabilities. Codex and Claude Code are coding-agent products with execution tools and session controls. A useful comparison records both the selected model and the host where it runs; installed extensions can come from other publishers.

| Developer question | Codex | Claude Code |
| - | - | - |
| Can it work in my terminal? | The [Codex CLI](https://learn.chatgpt.com/docs/codex/cli) reads files, edits code and runs local tools. | The [Claude Code CLI](https://code.claude.com/docs/en/overview) reads files, edits code and runs commands. |
| Can I use another interface? | OpenAI documents IDE, app and cloud workflows; check the tools available in your chosen surface. | Anthropic documents terminal, IDE, desktop and browser surfaces; their available features differ. |
| How do I provide repository instructions? | Native `AGENTS.md` discovery, including directory-specific guidance. | `CLAUDE.md` and, in current versions, native `AGENTS.md` loading with selection rules. |
| Can one session delegate? | Native subagents can handle bounded tasks and return results to the parent. | Native built-in and custom subagents can handle bounded tasks within a session. |
| How do I control actions? | Sandbox boundaries and approval policy work together. | Tool permission rules and modes work alongside an optional OS-enforced shell sandbox. |
| Can I connect external tools? | Native MCP support, plus skills, hooks and plugins. | Native MCP support, plus skills, hooks and plugins. |

The interface row is a reason to inspect the actual client, not assume that a terminal session has every desktop capability. Start with the official [OpenAI documentation](https://learn.chatgpt.com/docs) and [Claude Code overview](https://code.claude.com/docs/en/overview) for supported surfaces.

### Permissions are part of the comparison

In Codex, the **sandbox** defines accessible files and network resources; **approvals** determine when an action needs review. Automatic review changes who evaluates eligible approval requests without expanding the sandbox. In the CLI, inspect `/permissions`. See [OpenAI's permission documentation](https://learn.chatgpt.com/docs/permission-modes).

Claude Code has tool-specific allow, ask and deny rules, managed policies and permission modes. Inspect `/permissions` there too. Its [permission system](https://code.claude.com/docs/en/permissions) and [shell sandbox](https://code.claude.com/docs/en/sandboxing) are complementary: the OS sandbox restricts shell processes, while permission rules apply before tool calls.

Compare effective access to the same files, commands, network destinations and connected services. A run that pauses for approval and one with broader access are different configurations. Keep your organization's required controls in place during evaluation. A role such as “reviewer” in a prompt does not itself enforce read-only filesystem access.

### Repository instructions need checking in both tools

Codex uses [an instruction discovery chain for `AGENTS.md`](https://learn.chatgpt.com/docs/agent-configuration/agents-md). Claude Code v2.1.277 and later can read `AGENTS.md` natively, but its default selection prefers project `CLAUDE.md` files when present. You can select both formats or import `AGENTS.md` from `CLAUDE.md`. Check Anthropic's [current loading rules](https://code.claude.com/docs/en/memory#agentsmd) and ask each session to identify the instructions it loaded.

For shared conventions and explicit task handoffs, use [sharing context between coding agents](https://docs.agentmessagingservice.com/guides/share-context-between-coding-agents.md). Reading the same repository does not establish that two sessions loaded the same instructions.

## Delegation, independent chats and messaging are different

**Native delegation:** Codex's [subagents](https://learn.chatgpt.com/docs/agent-configuration/subagents) are enabled by default in current releases. Ask explicitly for independent subtasks; the parent collects their results. Claude Code's [subagents](https://code.claude.com/docs/en/sub-agents) run in separate context windows with configurable instructions, tools and permissions. Neither feature requires AMS. See the worked [multiple Codex agents](https://docs.agentmessagingservice.com/guides/multiple-codex-agents.md) and [multiple Claude Code agents](https://docs.agentmessagingservice.com/guides/claude-code-multiple-agents.md) guides.

**Independent chats:** Opening another chat creates a separately steered conversation. A common folder gives access to common files; it does not make the chats parent and child. Pass the task contract, revision, owned paths and expected evidence explicitly. Codex's [projects and chats documentation](https://learn.chatgpt.com/docs/projects) describes project file context and separate transcripts. Use [Git worktrees](https://docs.agentmessagingservice.com/guides/git-worktrees-for-ai-agents.md) when separate tasks will edit; designate an integration owner even with separate checkouts.

**Claude's native session collaboration:** Claude Code also has [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging) between supported sessions. Delivered messages can start a turn in an idle receiving session, subject to its inbound controls. They carry text, rather than the sender's full transcript or files. Availability and cross-machine behavior have version and provider requirements. [Agent teams](https://code.claude.com/docs/en/agent-teams) are another native option: a lead supervises teammates with shared tasks and direct messaging. Teams remain experimental and disabled by default. These capabilities are distinct from adding a cross-tool service.

**Interoperability:** Both clients can connect to an MCP server, but shared MCP access does not merge their conversations, transfer permissions or make Claude Code a Codex subagent. Configure and authenticate each client separately, then verify its tools and scopes. See the official [Codex MCP](https://learn.chatgpt.com/docs/extend/mcp) and [Claude Code MCP](https://code.claude.com/docs/en/mcp) documentation. Skills, plugins and hooks also need host-specific review; a common name does not guarantee identical behavior. See [OpenAI's skills and plugins](https://learn.chatgpt.com/docs/skills-and-plugins), [Codex hooks](https://learn.chatgpt.com/docs/hooks) and [Anthropic's extension guide](https://code.claude.com/docs/en/features-overview).

## Try the same small review in each tool

This exercise checks a review workflow without dependencies, credentials in examples or a shared writer. It is a reproducible starting point, not a performance benchmark.

### Prerequisites

* Installed, signed-in Codex and Claude Code CLIs with permission to read the exercise directory.
* A POSIX shell and Node.js 22 or newer.
* A new disposable directory. Use your normal approved installation process if either CLI is missing; the exercise installs nothing.

### 1. Create a fixture with one known defect

Run this where `agent-review-demo` does not already exist:

```sh theme={null}
mkdir agent-review-demo
cd agent-review-demo
cat > label.mjs <<'JS'
export function normalizeLabel(value) {
  return value.trim().toLowerCase();
}
JS
cat > label.test.mjs <<'JS'
import test from 'node:test';
import assert from 'node:assert/strict';
import { normalizeLabel } from './label.mjs';

test('trims and lowercases', () => {
  assert.equal(normalizeLabel('  HELLO  '), 'hello');
});
test('replaces internal whitespace with a hyphen', () => {
  assert.equal(normalizeLabel('Hello   World'), 'hello-world');
});
JS
node --test label.test.mjs
```

Expected baseline: exit status `1`, one passing test and one failing test. The implementation returns `hello   world` where the second test expects `hello-world`. That failure is intentional.

### 2. Start a fresh review in each CLI

From this directory, run `codex`. Inspect `/permissions`, then give it the prompt below. End that session before starting `claude` from the same directory, inspect its `/permissions`, and give it the same prompt. Keep both sessions read-only for this comparison; do not enable bypass or full access to make it work.

```text theme={null}
Review label.mjs and label.test.mjs. Do not edit files,
install packages, delegate work, or contact external services.

Contract: accept strings, trim the edges, lowercase,
and replace each internal run of whitespace with one hyphen.

Identify the concrete defect, explain the failing assertion,
and propose a minimal patch as text. Separate observations
from any test results you actually ran.
```

The instruction about external services refers to agent tool actions; using either signed-in coding agent still uses its configured model service.

### 3. Check the outcome against the fixture

A useful answer identifies the missing internal-whitespace replacement and proposes a change equivalent to:

```js theme={null}
return value.trim().toLowerCase().replace(/\s+/g, '-');
```

The files should remain unchanged, and the test should still have its intentional failure. A suggested patch is not an applied or verified fix. Inspect the files and rerun `node --test label.test.mjs` yourself if either session reports otherwise.

Record correctness, evidence, permission interruptions, selected model, client version and usage. Then repeat with a representative task from your repository in equivalent clean snapshots. One tiny fixture cannot establish which product is better across a codebase. For cost comparisons, use your eligible plan and measured usage alongside the current [OpenAI pricing documentation](https://learn.chatgpt.com/docs/pricing) and [Claude Code cost guidance](https://code.claude.com/docs/en/costs).

## When using both makes sense

| Situation | Suggested workflow | Completion evidence |
| - | - | - |
| A change benefits from a second review | One tool implements; the other reviews the exact diff against the original contract. | Specific findings and a tested resolution, with one integration owner. |
| Testing needs a different environment or host tool | One task exercises the app; another owns the fix. Choose roles by the tools each host actually has. | Reproduction steps, candidate build or URL, and a retest of that candidate. |
| Separate areas can progress independently | Give each task exclusive files or separate worktrees and agree on interfaces first. | Reviewed combined diff and the repository's required checks. |
| The task is small, sequential or needs one writer | Keep one session responsible; add a second review only if it has a clear purpose. | A focused diff and relevant verification. |

For the second pattern, follow the existing [Claude Code and Codex tester–builder guide](https://docs.agentmessagingservice.com/guides/claude-code-and-codex.md). It covers the actual handoff, retest reports and host-scheduled check-ins.

AMS can hold a shared channel for findings, ownership decisions and handoffs across those independent tasks. **Storing an AMS message does not itself wake an inactive agent or prove the recipient read it.** Arrange a supported host continuation or scheduled check, and require acknowledgement before overlapping edits. AMS does not add browser control, grant repository access or publish a fix.

If you need that shared channel, start with the [AMS quickstart](https://docs.agentmessagingservice.com/quickstart.md) and [folder workspace setup](https://docs.agentmessagingservice.com/guides/repository-workspaces.md). For automatic CLI coordination, first check `ams workspace current --json` from each task's actual directory. Continue only when it succeeds with `enabled: true`, then use guarded `ams --require-workspace` commands. The worked guide covers the remaining setup.

## Troubleshooting

| Symptom | Check |
| - | - |
| The two tools disagree about repository rules | Ask which instruction files loaded; check Claude's `CLAUDE.md`/`AGENTS.md` selection and Codex's directory hierarchy. |
| A documented native feature is missing | Check the actual client version, surface, provider and managed policy against the linked vendor page. |
| One agent cannot run the same check | Compare effective command, network and filesystem access; resolve the specific missing permission. |
| A reviewer says “fixed,” but tests still fail | Inspect the actual file and revision. The review exercise authorizes only a proposed patch. |
| A shared finding gets no response | Check the receiving host's continuation mechanism and seek acknowledgement; message storage is not evidence of action. |
| Both agents changed the same file | Stop overlapping writers, agree ownership and review both diffs before integration. Worktrees do not resolve conflicting design decisions. |

> [!NOTE]
>
> The fixture and its intentional test failure were checked locally. No live Codex-versus-Claude benchmark, external account write or automated collaboration run was performed for this guide.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.