I Tried Codex vs Claude Code Side by Side Without Coding (Forget the Hype)
So, I wanted to see if Claude Code beats Codex. But honestly? It’s hard to tell, and maybe that’s the wrong question.
I Tried Codex vs Claude Code Side by Side Without Coding (Forget the Hype)

So, I wanted to see if Claude Code beats Codex. But honestly? It’s hard to tell, and maybe that’s the wrong question.
But,
Before we get into the details, let’s agree that this comparison is not about the models.
- Claude Code runs on Anthropic’s Claude family — Opus 4.7, Sonnet 4.6, Haiku 4.5.
- Codex CLI runs on OpenAI’s GPT family — GPT-5.5, GPT-5.4, GPT-5.4 mini, GPT-5.3-Codex.
What won’t change as quickly is how these tools are built.
The architecture, command structure, and permission model. How they handle sessions, sandboxing, multi-agent work, and extensibility.
That’s the stuff that determines your day-to-day experience as a developer.
I know there’s a lot of hype about this feature or that benchmark, but how do these two tools compare in terms of core features?
An objective, side-by-side look at how each tool is structured, where there may not be a clear winner, and I don’t think that matters here.
I spent time going through the official documentation for both tools, testing commands, and comparing how each handles the same workflows.
In this post, I’m breaking it all down so you can see where each tool stands today.
How They’re Built
Codex CLI is built in Rust, while Claude Code is built in TypeScript and runs on Node.js 18+.
In practice, this means Codex’s binary is self-contained and lightweight, while Claude Code requires a Node.js runtime.
Both install via npm, but each now recommends its own native installer.
Claude Code:
curl -fsSL https://claude.ai/install.sh | bash # Native binary (recommended)
brew install --cask claude-code # Homebrew (macOS)
npm install -g @anthropic-ai/claude-code # NPM (deprecated)
Codex:
npm i -g @openai/codex # NPM (all platforms)
brew install --cask codex # Homebrew (macOS)
Both tools live in your terminal, read your codebase, edit files, run commands, and manage git workflows.
Neither is an IDE plugin pretending to be an agent; they’re CLI-first agents right from inception.
That said, both also have IDE extensions. Claude Code supports VS Code and JetBrains. Codex supports VS Code, Cursor, and Windsurf.
For OS support, Claude Code runs on macOS, Linux, and WSL. Codex runs natively on macOS, Linux, and Windows with PowerShell support — giving it an edge for Windows developers who don’t want to set up WSL.
Starting a Session
Both tools follow a similar pattern: type the tool name, optionally pass a prompt, and you’re in.
Claude Code:
claude # interactive session
claude "explain this project" # session with prompt
claude -p "query" # non-interactive (pipe mode)
cat file | claude -p "query" # process piped content
Codex:
codex # interactive TUI session
codex "query" # session with prompt
codex exec "query" # non-interactive execution
codex exec -o output.md "q" # exec with file output
The key difference is in non-interactive mode.
- Claude Code uses
-pfor pipe mode - Codex uses
codex execas a full subcommand with its own flags —--jsonoutput,--ephemeralmode,--max-turnslimits, and session resumption.
Codex’s
execcommand is more feature-rich for CI/CD automation. Claude Code's pipe mode is simpler but also supports budget caps (--max-budget-usd) and turn limits (--max-turns).
Session Management
Long coding sessions are where both tools start to diverge.
Claude Code treats sessions as named, resumable conversations:
/compact— compress context history while keeping a summary/clear— wipe conversation history/fork— branch off a conversation/rename— give sessions meaningful namesclaude -ccontinues the most recent sessionclaude -r "name"resumes by name
Codex handles sessions with a slightly different structure:
codex resume --last— pick up the most recent sessioncodex resume <id>— resume by IDcodex fork— create a new thread from an existing session/side— temporary side conversation that doesn't alter your main thread
That
/sidecommand in Codex is worth noting. It lets you ask a quick question without polluting your main context. This is useful when you need a fast answer mid-session.
Both support context management, which is critical for long sessions.
Claude Code’s /compact compresses conversation history into a dense summary while preserving context. Codex handles this more implicitly through its session architecture.
Project Context Files
Every AI coding tool needs a way to understand your project’s conventions.
Both tools solve this with a markdown file in the project root.
- Claude Code uses
CLAUDE.md. It's read at the start of every session and acts as a persistent project brief — coding standards, build commands, testing conventions, architectural decisions. You can also create.claude/rules/*.mdfor modular rule files. - Codex uses
AGENTS.mdIts the same concept, and format. It supports a hierarchy: rootAGENTS.md, directory-specific files, and user-level overrides. There's a practical limit (project_doc_max_bytes, defaulting to 32 KB) to prevent context bloat.
In summary, both are functionally identical, and the naming difference is just cosmetic.
Model Switching and Cost Control
Both tools let you switch models mid-session, which is critical for balancing quality and cost.
Claude Code offers three tiers:
- Opus 4.7 — the most capable, default on Max and Team Premium plans
- Sonnet 4.6 — the daily workhorse, default on Pro and Enterprise
- Haiku 4.5 — fast and cheap, ideal for exploration and subagents
Switch with /model opus, /model sonnet, or /model haiku.
There's also a
/fastmode in research preview for Opus that delivers faster output at a higher cost. Max plans include up to 1M token context, which is a real advantage for large codebases.
Codex currently offers:
- GPT-5.5 — newest flagship model, rolling out across Codex surfaces
- GPT-5.4 — strong default, fallback if 5.5 isn’t available yet
- GPT-5.4 mini — lighter tasks and subagent work
- GPT-5.3-Codex — the coding-specialized model
- GPT-5.3-Codex-Spark — near-instant output (1,000+ tokens/sec), research preview for Pro users only
Codex also supports configuration profiles (--profile fast, --profile thorough) that bundle model, sandbox, and approval settings into named presets.
Codex supports open-source models via Ollama and LM Studio using the
--ossflag.
Sandboxing and Permissions
These tools now have fundamentally different architectural approaches to sandboxing and permissions.
Codex uses OS-native sandboxing. On macOS, it uses Seatbelt (Apple’s
sandbox-exec). On Linux, it uses Bubblewrap with namespace isolation and Landlock as a fallback. On Windows, it uses Restricted Tokens via the native Windows sandbox.
The sandbox is enforced at the operating system level — it’s not something the AI can talk its way out of.
Codex offers three sandbox modes:
read-only— the default, most restrictiveworkspace-write— can edit within the project directorydanger-full-access— no restrictions
You can also extend write access to specific directories with --add-dir rather than opening everything up.
codex --sandbox read-only # default
codex --sandbox workspace-write # edit project files
codex --add-dir ../shared # grant access to extra dirs
Claude Code takes a rule-based approach. Permissions are configured as allow/deny/ask lists in settings files:
{
"permissions": {
"allow": ["Read", "Edit", "Bash(git:*)"],
"deny": ["Bash(rm -rf:*)"],
"ask": ["WebFetch", "Bash(docker:*)"]
}
}
This is more flexible; you can write fine-grained glob patterns for which bash commands are pre-approved — but it’s enforced at the application level, not the OS level.
Claude Code also has permission mode cycling. During a session, press
Shift+Tabto switch between default, acceptEdits, auto, and plan modes.
Here’s my take on each approach :
- Codex’s OS-level sandboxing is arguably more secure by default since it doesn’t depend on the application intercepting every operation.
- Claude Code’s rule-based system is more expressive and lets you craft per-project permission policies that match your exact workflow.
Hooks and Lifecycle Automation
Both tools support hooks; shell commands that fire at specific points in the agent’s lifecycle.
But Claude Code’s system is more mature here.
Claude Code supports around 25 lifecycle events, including:
PreToolUse/PostToolUse— before and after tool executionPermissionRequest— when Claude asks for permissionSessionStart/SessionEnd— session lifecycleStop/SubagentStop— when Claude or a subagent finishesPreCompact— before context compactionUserPromptSubmit— when you submit a promptSubagentStart— when a subagent spawnsNotification— when notifications are sent
It also supports three types of hook handlers: command hooks (shell scripts), HTTP hooks (send events to a web server), and prompt hooks (pass the event to Claude for a single-turn evaluation).
Agent hooks add a fourth type where a Claude model evaluates with tool access.
This layered system: deterministic shell, remote HTTP, LLM judgment — lets teams combine simple formatting checks alongside nuanced security evaluations.
Codex supports hooks through
~/.codex/hooks.jsonwithPreToolUseandPostToolUseevents. The structure is similar — scripts receive JSON on stdin and respond via exit codes and stdout — but the event surface is narrower.
For most developers, the basics are covered in both tools. For teams building enterprise-grade governance and audit trails, Claude Code’s hook surface is deeper.
Configuration
The configuration differs between the two tools.
- Claude Code uses JSON (
settings.json) with a hierarchy: enterprise → managed → user → project. Settings merge with project keys winning on conflict. The config covers permissions, hooks, MCP servers, environment variables, and more. - Codex uses TOML (
config.toml) with a similar hierarchy: system → user → project. It supports configuration profiles — named presets like[profile.fast]or[profile.thorough]that bundle model, sandbox, and approval settings together.
[profile.fast]
model = "gpt-5.4-mini"
approval_policy = "never"
[profile.thorough]
model = "gpt-5.4"
model_reasoning_effort = "high"
approval_policy = "on-request"
Codex also has admin enforcement via requirements.toml, which lets ops teams constrain what developers can change.
Codex’s profile system is an ideal choice for teams that want standardized configurations for different workflows.
Multi-Agent and Parallel Work
Claude Code calls them subagents and each subagent gets its own context window, system prompt, tool permissions, and model selection.
You define them as markdown files with YAML frontmatter in .claude/agents/:
---
name: code-reviewer
description: Expert code review specialist.
tools: Read, Grep, Glob, Bash
model: sonnet
permissionMode: plan
---
You are a senior code reviewer ensuring high standards
of code quality and security
Claude can delegate to subagents based on task descriptions, or you can invoke them explicitly, up to 10 subagents can run in parallel.
Claude Code has a dedicated Agent View (
claude agents) for monitoring parallel sessions. You can background tasks withCtrl+B, attach to running sessions, stop them, or check logs.
Codex also supports subagents, defined via TOML configuration:
[agents.reviewer]
name = "reviewer"
description = "PR reviewer focused on correctness and security."
model = "gpt-5.4"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
Codex caps concurrent subagents at 6 threads by default (max_threads = 6 in config).
You can assign different models per subagent — use GPT-5.4 mini for exploration work and GPT-5.4 for the heavy reasoning.
Claude Code’s multi-agent system is deeply local — agents run in your terminal, in your git worktrees, with a dashboard you can monitor. Codex offers both local subagents and a cloud execution tier.
Cloud Execution
This is a feature unique to Codex.
codex cloud exec lets you submit tasks to run in OpenAI-managed isolated containers.
You define the environment, submit the task, and pull the resulting diffs down locally.
codex cloud exec --env ENV "refactor the auth module"
codex cloud list --json
codex apply <TASK_ID>
For teams that want fire-and-forget overnight development loops — submit a batch of tasks before leaving, review the diffs in the morning — this is a distinct advantage.
MCP Integration
Both tools support Model Context Protocol (MCP) servers for extending their capabilities with external tools — databases, APIs, GitHub, Sentry, Jira, and so on.
Claude Code:
claude mcp add <name> <command> # add stdio MCP server
claude mcp list # list servers
claude mcp remove <name> # remove server
Codex:
codex mcp add <name> # add MCP server
codex mcp list # list servers
codex mcp remove <name> # remove server
codex mcp auth <name> # authenticate server
Both configure MCP servers in their respective config files and can also run as MCP servers themselves, meaning another agent can consume them as a tool.
Codex adds a dedicated
authsubcommand for MCP authentication, which is a small convenience.
Code Review
Both tools have built-in code review capabilities, but the approach differs.
- Claude Code recently shipped
claude ultrareview— a multi-agent code review system that spawns multiple specialized reviewers in parallel for deep analysis. It also supports/reviewas an in-session command. - Codex has
codex reviewas a first-class subcommand with CI-friendly options:
codex review --base main --json
Codex also introduced Auto-review, where a separate agent automatically reviews changes before they’re committed — configurable to run on specific triggers.
Claude Code’s ultrareview is more powerful for deep, multi-perspective analysis. Codex’s review is more CI-native and easier to wire into existing pipelines.
Extensibility
Both tools are evolving from simple chat agents into programmable platforms.
- Custom commands: Both support custom slash commands as markdown files. Claude Code stores them in
.claude/commands/, Codex in.codex/commands/. Both support YAML frontmatter for configuration. - Skills: Claude Code has a mature skills system — markdown-based guides that Claude reads and applies contextually. Codex also supports skills via
/skills, but the system is less documented. - Plugins: Claude Code has a plugin ecosystem (
claude plugin install <name>) for packaging and sharing extensions. Codex supports plugins through its config system with marketplace installation. - Image support: Codex has built-in image generation via
gpt-image-2and accepts image inputs (codex -i screenshot.png "query"). Claude Code supports image input through@mentions but doesn't have native image generation in the CLI. - Web search: Codex ships with built-in web search enabled by default in cached mode, with an option for live search via
--search. Claude Code can use web search through MCP or tool configuration.
Final Thoughts
This isn’t about declaring a winner, but each tool has areas where it currently leads.
Claude Code leads in:
- Hook ecosystem depth — ~25 lifecycle events, four handler types (command, HTTP, prompt, agent)
- Context window — up to 1M tokens on Max plans, a genuine advantage for large codebases
- Multi-agent orchestration locally — Agent View, background sessions you can attach to, up to 10 parallel subagents
- Subagent customization — per-agent model selection, tool restrictions, and permission modes
- Plugin ecosystem —
claude plugin installwith marketplace support
Codex leads in:
- OS-native sandboxing — Seatbelt, Bubblewrap, Landlock, Windows Restricted Tokens at the kernel level
- Cloud execution — fire-and-forget tasks on OpenAI-managed containers, results pulled down as diffs
- Windows native support — runs directly in PowerShell without WSL
- Open-source model support — connect to local models via Ollama, LM Studio
- Image generation — built-in
gpt-image-2for generating assets in the CLI - CI/CD ergonomics —
codex execwith JSON output, ephemeral mode, auto-review pipelines - Web search — built-in, cached by default, live mode available
If you’re choosing between them, the honest answer is: try both on a real project, then you will find out which best suits your workflow and objectives.
메타데이터
- post_id
- 45374e8d37f9
- slug
- i-tried-codex-vs-claude-code-side-by-side-without-coding-forget-the-hype-45374e8d37f9
- url
- https://medium.com/ai-software-engineer/i-tried-codex-vs-claude-code-side-by-side-without-coding-forget-the-hype-45374e8d37f9
- canonical_url
- https://medium.com/ai-software-engineer/i-tried-codex-vs-claude-code-side-by-side-without-coding-forget-the-hype-45374e8d37f9
- author_url
- https://medium.com/@joe.njenga
- status
- ok
- fetched_at
- 2026-06-09 15:37:30