Claude Code vs Codex: A Detailed Terminal Agent ComparisonΒ 

Must Read
bicycledays
bicycledayshttp://trendster.net
Please note: Most, if not all, of the articles published at this website were completed by Chat GPT (chat.openai.com) and/or copied and possibly remixed from other websites or Feedzy or WPeMatico or RSS Aggregrator or WP RSS Aggregrator. No copyright infringement is intended. If there are any copyright issues, please contact: bicycledays@yahoo.com.

Coding assistants have moved past autocomplete into full brokers that may learn initiatives, run instructions, edit recordsdata, and iterate towards outcomes. Instruments like Claude Code and Codex each function on this house, however take totally different approaches. Claude Code facilities on a unified agent loop throughout environments, whereas Codex spreads capabilities throughout CLI, IDE extensions, cloud workflows, and delegated duties.

This isn’t about mannequin efficiency. It’s about workflow: management, intuitiveness, and the way simply you possibly can keep targeted whereas working inside an actual repository. On this article, we evaluate how every instrument matches into the act of getting work performed.

Getting began with Claude Code and Codex CLI

Earlier than shifting onto the actual workflows, First let’s set up each the instruments in our system. Please be sure your system has node already put in.Β 

Codex CLIΒ 

Set up the Codex CLI with npm. Open your terminal and runΒ 

npm i -g @openai/codex

Run Codex in a terminal. It may well examine your repository, edit recordsdata, and run instructions.Β 

CodexΒ 

Sign up with an OpenAI account or API key

Claude CodeΒ 

Set up the Claude Code with npm. Open your terminal and runΒ 

npm set up -g @anthropic-ai/claude-codeΒ 

Run in terminal by altering the listing to specific missionΒ 

claudeΒ 

Sign up with an Anthropic Account

Claude Code

Now all set, let’s transfer to workflows.

The primary 10 minutes really feel totally different

Claude Code appears like an assisted companion. It needs to get a deal with on the repo, recommend a plan, then proceed with the duty with mode permission and checkpoints to maintain it secure. Codex appears like a configurable runtime. It’s nonetheless conversational, however the focus is extra on configuration, insurance policies, worktrees, evaluate, and cloud delegation.Β 

In case you are opening a repo for the primary time, the hands-on distinction reveals up instantly.Β 

With Claude Code, a pure first transfer is:

Clarify the auth movement, listing the dangerous recordsdata, and inform me the place login might be failing.

Authentication flow for claude code

With Codex, the equal appears like:Β 

Clarify the auth movement, listing the dangerous recordsdata, and inform me the place login might be failingΒ 

Codex authentication flow

The identical immediate, however the expertise could be very totally different. Claude usually encourages you to plan and execute. With Codex it feels prefer it asks you to set the parameters of freedom, sandboxing and approvals earlier than leaping in.Β 

That distinction issues. In case you like being guided to productiveness, you’ll like Claude Code extra. In case you wish to design a system, Codex is extra rewarding.Β 

The Translation Layer: How the ideas map?

A lot of the confusion of Claude Code vs Codex is because of totally different terminology.Β 

Side Claude Code Codex
Repo Directions Saved in CLAUDE.md Saved in AGENTS.md
Reminiscence Auto reminiscence Specific Reminiscences system
Session State Checkpoints and /rewind for code and session state Emphasis on code opinions and structured code state
Code Administration Inline iteration with checkpoints Worktrees and review-driven workflows
Distant Work Distant Management resumes native periods (runs in your desktop) Distant connections, app-server workflows, and cloud delegation by way of net
Execution Mannequin Native-first, session continues in your machine Native + distant + cloud execution break up throughout environments
Agent Workflows Helps subagents and parallel agent workflows Specific subagent workflows with structured orchestration
Parallelism Constructed-in parallel agent execution Parallelism by way of worktrees and orchestrated brokers
General Method Unified, session-centric workflow Distributed, system-oriented workflow

That is the mannequin to remember once you learn the remainder of this text.Β 

Repo directions: CLAUDE.md vs AGENTS.md

It is a essential a part of the article as a result of it impacts how the agent feels after the primary day.Β 

Claude Code hundreds CLAUDE.md at first of every session and makes use of it as context for the mission, your Workflow, and even your organization. Anthropic’s documentation is obvious that it’s best to use CLAUDE.md to seize the foundations you don’t need to repeat, and use auto reminiscence for Claude’s studying. Β 

The Codex answer makes use of AGENTS.md, however in a extra refined manner. You could possibly have a worldwide ~/.codex/AGENTS.md, then AGENTS.md per repo, then sub AGENTS.override.md, all as a part of the config.toml construction. Β 

Right here’s the way it may work.Β 

Right here’s a helpful CLAUDE.md for a Node repo:Β 

CLAUDE.md

A helpful AGENTS.md for a similar repo may appear like this:Β 

agents.md

The hands-on lesson is easy. Don’t wait till the agent disappoints you 5 instances. Write the instruction file early. Each instruments get significantly better as soon as your requirements dwell within the repo as an alternative of in your head.Β 

Reminiscence: What will get remembered and the way helpful it truly is?

The context window for Claude Code is wiped firstly of every session, however you possibly can load your CLAUDE.md and auto reminiscence. In response to Anthropic, auto reminiscence is notes that Claude writes based mostly in your corrections and preferences, corresponding to construct instructions, debugging hints and issues it has seen whereas enhancing in that tree. Β 

Codex Reminiscences are related however they’re barely extra specific. Reminiscences are disabled by default, are saved regionally (in ~/.codex), and are for fastened preferences, widespread routines, project-specific conventions, and customary gotchas. The OpenAI docs additionally advise to not retailer recollections of guidelines as the one place for guidelines that should at all times be adopted. These nonetheless must go in AGENTS.md or in paperwork within the repo. Β 

This leads to an excellent workflow.Β 

In case you are utilizing Claude Code, you possibly can have the agent study the tempo of the repo, then use CLAUDE.md for issues it’s good to preserve steady.Β 

In case you are utilizing Codex, don’t put the contract in Reminiscences. Put the contract in AGENTS.md. Put your platform guidelines in config.toml. Let recollections fill within the gaps.Β 

This makes Codex really feel extra mechanical. Claude is extra like a sensible teammate.Β 

Permissions and planning: That is the place the persona break up turns into apparent

Claude Code has very descriptive names for permission modes. The out there modes are at the moment default, acceptEdits, plan, auto, dontAsk, and bypassPermissions. plan is especially fascinating because it permits Claude to plan and suggest modifications with out touching your supply, and auto is a analysis preview that makes use of an additional classifier to filter actions. Β 

Codex describes this by way of sandbox and approval coverage. OpenAI’s documentation calls sandbox mode the technical sandbox and approval coverage the rule for when to ask permission. Native Codex by default makes use of no networking and sandboxing below the OS, which is often configured by way of ~/.codex/config.toml and, optionally, project-specific .codex/config.toml. Β 

Right here is the hands-on model.Β 

If you would like Claude Code to examine a repo and produce a proposal earlier than touching something:Β 

claude --permission-mode planΒ 
Claude code plan mode one

If you would like Claude Code to maneuver sooner on secure file edits:Β 

claude --permission-mode acceptEditsΒ 
Claude code edits mode enabled

If you would like Codex configured for a tighter read-only move first, the OpenAI docs present patterns like this:Β 

Open the .codex/config.toml fileΒ and add the next traces:

[profiles.readonly_quiet]Β 
approval_policy = "by no means"Β 
sandbox_mode = "read-only"
config.toml

Then you should use that type of profile for a first-pass audit and solely loosen up it if you end up prepared.Β 

This distinction issues lots in actual groups. Claude exposes the security mannequin as an interplay sample. Codex exposes it as a system configuration sample.Β 

Let’s say your checkout check is failing and also you need the agent to research, repair, confirm, and clarify the change.Β 

An excellent Claude Code workflow seems like this:Β 

Discover why the checkout is failing. Begin in plan mode, determine the smallest secure repair, implement it, run the related exams, and summarize the change in plain English.Β 

Real bug loop fix

An excellent Codex workflow seems like this:Β 

Examine the checkout failure, preserve scope minimal, clarify root trigger first, then patch solely the recordsdata required, run the smallest related check set, and present me the diff I ought to evaluate.Β 

Running the diff command to see the changes
Running the diff command to see the changes

Discover the distinction. With Claude Code, you naturally lean into movement. With Codex, you naturally lean into specific scope and evaluate language.Β 

Each instruments can do the loop, however they encourage barely totally different kinds of prompting.Β 

Undo, restoration, and reviewing modifications

Claude Code’s undo/rewind is a robust function. Anthropic claims that each user-prompted change makes a checkpoint, the checkpoints are persistent, and /rewind can restore code, dialog, or each. So you possibly can β€œexperiment” extra with out worrying about errors. Β 

A β€œactual” use case seems like this:Β 

/rewindΒ 

You then select whether or not to simply rewind the code, simply the chat, each, or begin summarising from a selected level and proceed.Β 

And Codex addresses security in one other manner. The evaluate pane shows the modifications within the repo, means that you can add inline feedback and to stage, preserve or revert traces. The app additionally makes use of worktrees so many issues can occur when you work in your checkout.Β 

So the sensible break up is that this:Β 

Claude says, β€œAttempt the dangerous factor. You possibly can rewind.” 

Codex says, β€œLet the work occur in isolation. Then examine it fastidiously.” 

Each are good. They simply change how daring you are feeling whereas iterating.Β 

Abilities, hooks, and reusable workflows

That is the part the place superior customers begin constructing actual leverage.Β 

Claude Code expertise use SKILL.md, and Anthropic claims Claude can routinely invoke expertise as wanted, or you possibly can explicitly use slash instructions (e.g. /review-pr or /deploy-staging). Claude additionally has hooks for working shell instructions earlier than or after Claude Code actions, corresponding to formatting, linting or customized validation. Β 

OpenAI’s docs for Codex deal with progressive disclosure. Codex hundreds talent metadata and solely hundreds the total SKILL.md when it makes use of the talent. Codex additionally makes use of a built-in $skill-creator, and has hooks as an experimental extensibility framework (function flag is in place).Β 

Here’s a concrete hands-on sample you should use in both instrument.Β 

Create a reusable code-review talent that claims:Β 

---Β 

title: backend-reviewΒ 

description: Evaluation backend modifications for auth bugs, migration danger, logging gaps, and check protection regressions.Β 

---

When invoked:Β 

  1. Examine modified recordsdata firstΒ 
  2. Prioritize auth, knowledge integrity, and silent failure modesΒ 
  3. Recommend the smallest fixesΒ 
  4. Finish with a brief danger abstractΒ 
SKILLS.md

In Claude Code, that turns into one thing you possibly can naturally name from the dialog. In Codex, that turns into a cleaner reusable unit in a extra explicitly managed system.Β 

Which one must you select?

Based mostly of the comparability and the options the 2 provide, right here’s a comparability desk to summarise all of it:

Side Claude Code Codex
Onboarding Smoother, extra guided expertise Extra setup, geared towards customization
Workflow Model β€œPreserve shifting” movement with robust steering Modular, programmable workflow
Core Power Looks like an energetic pair programmer Looks like a platform you possibly can form
Management Stage Extra implicit, agent-led Extra specific, user-controlled
Key Options Checkpointing, plan mode, guided periods Configs, sandboxing, worktrees, distant and cloud delegation
Greatest For Fast prototyping, repo exploration, guided refactors Structured, scalable engineering workflows
Interplay Model Suppose with the agent Handle and orchestrate the agent
Excellent Person Builders who need momentum and ease Builders who need flexibility and system-level management
General Really feel A robust pair programmer A customizable coding platform

Conclusion

Claude Code wins on simplicity and β€œmovement.” The /rewind function is a top-tier security internet. The auto-memory system makes it really feel sensible over time. Select Claude Code if you need aPair Programmer that simply works. It’s wonderful for speedy prototyping and refactoring.Β 

Codex wins on precision and configurability. The worktree mannequin is ideal for complicated automation. The policy-based permissions swimsuit enterprise safety wants. Select Codex if you wish to construct a customized platform. It’s a strong alternative for systematized growth.Β 

These instruments are usually not simply opponents. They symbolize totally different futures for AI coding. One is a guided agent. The opposite is a programmable runtime. They’re catered to totally different customers and each help in bettering your workflows.

Steadily Requested Questions

Q1. What’s the essential distinction between CLAUDE.md and AGENTS.md?

A. They serve the identical function for repository directions. Claude Code makes use of CLAUDE.md, whereas Codex makes use of AGENTS.md, however Claude can import AGENTS.md recordsdata for compatibility.Β 

Q2. Can I exploit these brokers for big, current codebases?

A. Sure, each are repo-aware. They will index 1000’s of recordsdata to offer context and carry out multi-file edits throughout the entire mission.Β 

Q3. Do these brokers require an web connection?

A. Sure, each want to speak with LLM suppliers like Anthropic or OpenAI. Codex helps some native shell escapes, however the reasoning occurs within the cloud.Β 

Harsh Mishra

Harsh Mishra is an AI/ML Engineer who spends extra time speaking to Massive Language Fashions than precise people. Captivated with GenAI, NLP, and making machines smarter (so that they don’t exchange him simply but). When not optimizing fashions, he’s in all probability optimizing his espresso consumption. πŸš€β˜•

Login to proceed studying and revel in expert-curated content material.

Latest Articles

China blocks Meta’s $2B Manus deal after months-long probe

China’s high financial planner, the Nationwide Improvement and Reform Fee (NDRC), stated on Monday it has blocked Meta’s $2...

More Articles Like This