March 17, 202610 min readai-cli-tools

Claude Code vs Codex CLI: Local workflows, permissions, and cloud handoff (2026)

Compare Claude Code and Codex CLI by local repository workflows, permissions, authentication, subagents, cloud handoff, and practical use cases.

DH
Danny Huang

Bottom Line Up Front

Claude Code and Codex CLI are both terminal clients for working with a local project. Neither should be described as a simple "local versus cloud" choice. Claude Code's official workflows start from a project directory and cover exploration, refactoring, tests, and scripts. Codex CLI's official guide says to start in a repository, inspect files, edit them, and run the tools already installed on your machine. (Claude Code workflows; Codex CLI, checked 2026-10-27.)

Codex can hand work to a cloud environment, but that is an explicit separate path such as codex cloud and codex apply. The cloud environment, files, credentials, and local processes are not the same thing as the local CLI session. Codex CLI also supports subagents. Calling it cloud-first or single-agent is inaccurate. (Codex CLI reference; Codex subagents, checked 2026-10-27.)

The useful decision is about control and workflow: which provider you already use, where code is allowed to run, which authentication path fits your team, and whether you need focused subagents or an experimental team of sessions. Use those conditions to choose the workflow that fits.

For the broader landscape, see the AI CLI Tools Complete Guide.

Architecture Comparison

FeatureClaude CodeCodex CLI
Primary surface in this articleTerminal client started in a project directoryTerminal client started in a repository
Local repository workReads, edits, and runs project tools subject to its permission configurationReads, edits, and runs local tools subject to sandbox and permission settings
Cloud or other surfacesClaude Code also has separate desktop, IDE, web, and cloud documentation; those are not silently treated as the CLIcodex cloud and Codex Cloud are separate workflows; local and cloud environments have different files and access
AuthenticationAnthropic Console, a Claude Pro or Max subscription, or supported enterprise providersChatGPT sign-in or an API key for local CLI use; cloud requires ChatGPT sign-in
PermissionsPermission modes, allowed tools, and project settings control local actionsSandbox, approval, and permission profiles control local actions
SubagentsBuilt-in and custom subagents; each has its own context and permissionsSubagent workflows are available in the CLI; subagents inherit the parent provider, permissions, and MCP servers
Coordinated teamsAgent teams are experimental, disabled by default, and use separate Claude Code sessionsThe CLI supports subagents; this article does not treat subagents as a Claude-only feature
Automationclaude -p and structured output support scripts and CI workflowscodex exec supports non-interactive scripts and CI workflows
MCPClaude Code documents MCP server configurationCodex CLI documents MCP management and configuration
Model choiceSelect an available model or alias for the current account and installationSelect an available model with /model or --model; availability depends on sign-in method and plan

In plain language: Claude Code gives you a local terminal loop with Anthropic’s permissions and session controls. Codex CLI gives you a local terminal loop with OpenAI’s permissions, sandbox, and authentication choices. Both can delegate focused work. Cloud handoff is a separate Codex operation, not the default meaning of every codex command. “Local” here describes where the client reads files and runs tools; it does not mean model inference is offline. Check the current provider documentation before writing an install or pricing claim; the pages above were checked on 2026-10-27.

Benchmarks: Compare like with like

SWE-bench Verified and SWE-bench Pro are different benchmark variants. A score from one cannot be put beside a score from the other and labelled a head-to-head winner. The same problem applies when model, harness, prompt, repository snapshot, tool permissions, retry policy, or scoring date differs.

For a useful comparison, hold the model, prompt, repository snapshot, tool permissions, retry policy, and scoring date constant. Record the repository commit, tests, wall-clock time, token usage, and human review effort so the result describes your setup rather than every CLI.

Where Claude Code Fits

Local codebase exploration and refactoring

Claude Code's official workflow starts from the project root, asks for a codebase overview, finds relevant files, traces execution, and then applies a focused change. The same guide covers refactoring and running tests after the edit. This makes it a practical fit when the task depends on the repository's existing conventions, not a promise that every refactor will be correct on the first pass. (Common workflows, checked 2026-10-27.)

cd /path/to/project
claude

For a scriptable turn, the CLI reference documents print mode and structured output:

claude -p "Review the current diff and list untested error paths" \
  --output-format json

Subagents and optional agent teams

Claude Code has built-in and custom subagents. A subagent works in its own context and can have restricted tools and permissions. Agent teams are a different feature: they coordinate multiple Claude Code sessions, are experimental, and are disabled by default. Enable them only when the work benefits from independent teammates and the extra token and coordination cost is acceptable. (Subagents; agent teams, checked 2026-10-27.)

Authentication and permissions

Anthropic documents three common routes: an Anthropic Console account, a Claude Pro or Max subscription, and supported enterprise providers such as Amazon Bedrock or Google Cloud’s Agent Platform. Claude Code requests an internet connection for authentication and model processing. Permission modes and allowed tools still matter when the client runs against your local filesystem. (Claude Code setup; CLI reference, checked 2026-10-27.)

Where Codex CLI Fits

Local repository work is the normal CLI loop

The official Codex CLI guide tells you to open a project directory, start codex, and ask it to explain the project or make a focused change. It also describes local code review, scripting, and delegation. The local execution mode is bounded by the permissions and sandbox settings you select, so "Codex always runs in the cloud" is not an accurate description.

cd /path/to/project
codex

For repeatable automation, the CLI reference documents codex exec and local review commands. Use the model and permission settings appropriate to your repository, then inspect the diff and test results yourself. (Codex CLI; CLI reference, checked 2026-10-27.)

Subagents are supported

Current Codex documentation describes subagent activity in Codex CLI and the /subagents view. A subagent runs in its own context, while inheriting the parent run's provider, permissions, and MCP servers. Subagents can increase token use, so use them for independent work rather than for every small edit. (Codex subagents, checked 2026-10-27.)

Cloud handoff is explicit

Codex CLI can submit work to Codex Cloud and apply a cloud-generated diff back to the local working tree. That is a separate command path, not a reason to describe every local CLI turn as a cloud sandbox. Cloud environments must be prepared separately, and local files, running processes, browser sign-ins, and VPN access are not transferred automatically. (CLI reference; Codex environments, checked 2026-10-27.)

Authentication and permissions

OpenAI documents ChatGPT sign-in and API-key authentication for local Codex CLI use. ChatGPT sign-in uses subscription limits and workspace controls; API-key use follows API pricing and policies. Local permission profiles can restrict filesystem and network access. Cloud Codex requires ChatGPT sign-in, so do not merge cloud access, CLI access, and API billing into one generic "Codex price". (Authentication; permissions; pricing, checked 2026-10-27.)

Access and Cost Comparison

Prices and included limits change by plan, model, region, and authentication method. Use the table to check the billing path that fits your account and workflow.

Access pathClaude CodeCodex CLIWhat to check
Provider subscriptionA Claude Pro or Max plan can authenticate Claude CodeA ChatGPT plan can provide Codex access, with plan-specific limitsCurrent plan, model availability, rate limits, and whether the feature is CLI, IDE, web, or cloud
API or provider keyAnthropic Console billing or an enterprise providerOpenAI API-key usage billed separately from ChatGPT subscription usageToken rates, retention policy, organization controls, and automation limits
Enterprise routeBedrock, Google Cloud’s Agent Platform, or another supported gatewayWorkspace controls, ChatGPT sign-in, or API organization controlsAdmin policy, data handling, residency, and available models
Cloud taskUse the Claude surface and plan that explicitly provides itCodex Cloud requires a prepared environment and ChatGPT sign-inWhat files and credentials are present in the remote environment

Do not turn a subscription price into a model-quality claim. If you need a current number, use the linked provider pricing page on the day you purchase or configure access. This comparison was checked on 2026-10-27 and does not make a permanent price promise.

A Practical Side-by-Side Workflow

A two-terminal workflow is useful when each client has a different job. Keep the repository state explicit and review both diffs.

Pattern 1: One client implements, the other reviews

# Terminal 1
claude "Implement the rate-limiting change described in issue.md. Run the existing tests."

# Terminal 2
codex exec "Review the working-tree diff. Check validation, error handling, and test coverage."

Pattern 2: Compare plans before editing

Ask each client to inspect the same commit and produce a plan without writing files. Compare touched files, assumptions, permission requests, and verification steps. Pick one plan, then make the change in a controlled worktree.

Pattern 3: Use subagents for independent checks

Ask Claude Code or Codex to delegate separate read-only investigations, such as API surface, test coverage, and security assumptions. Keep the final edit and acceptance decision in the main session. Subagents do not replace human review.

Why this workflow needs side-by-side terminals

If you run both clients, a terminal workspace keeps each session visible without confusing their credentials, working directories, or permission prompts. Termdock can help you keep terminal panes side by side and resize them while you inspect the work.

Let the Implementer Hand Off a Review in Termdock

Pattern 1 can use an agent handoff instead of manual copying. After installing the termdock CLI on macOS, ask Claude Code to use the bundled terminal skill to open an installed and authenticated Codex, send the requirement and diff location, read its read-only review, and summarize concrete concerns. A person verifies findings, changes, and test results before deciding whether to commit. Sessions do not share conversations, and reviewer and implementer should not edit the same files at once. See the full handoff walkthrough for setup and the Windows Terminal API path.

Who Should Pick Which?

Choose Claude Code if:

  • Your team already uses Anthropic authentication, policies, or provider routing.
  • You want built-in and custom subagents with explicit tool and permission boundaries.
  • You need the optional experimental Agent Teams workflow and accept its coordination overhead.
  • You prefer Claude Code's documented project exploration, refactoring, testing, and script workflows.

Choose Codex CLI if:

  • You want a local repository loop with OpenAI authentication and configurable sandbox or approval settings.
  • You need codex exec or local review in a script or CI job.
  • You want subagents in the CLI and the option to hand a task to a separate Codex Cloud environment.
  • You want to choose between ChatGPT sign-in and API-key billing for local work.

Use both if:

  • You want two independently configured review passes and can inspect the differences yourself.
  • Your team has a clear rule for which client may access which repository and credentials.
  • You can keep each terminal in the correct worktree and record the model, permissions, and verification results.

For a wider multi-agent setup, see Multi-Agent Development with Git Worktree.

What About Google's CLI Options?

Google's consumer starting point is now Antigravity CLI. Its transition announcement says Gemini CLI stopped serving free Gemini Code Assist for individuals and Google AI Pro/Ultra users on June 18, 2026. The old 1,000-request daily allowance is not a current Gemini CLI recommendation for those users.

Gemini CLI remains supported for Code Assist Standard/Enterprise and paid API access. Check which account path applies before installing. For individual use, follow the Antigravity quickstart and current plans; do not transfer Gemini CLI's old quota numbers to Antigravity. These sources were checked on 2026-10-27.

Sources Checked on 2026-10-27

DH
#claude-code#codex-cli#comparison#ai-cli#benchmarks#developer-tools

Related Posts