Claude Code and Codex: Terminal Agent Showdown for Developers
Le brief IA que les pros lisent chaque soir
Les 7 actus IA du jour, décryptées en 5 min. Gratuit.
Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.
Choisis ton rythme
Gratuit · Pas de spam · Désabonnement en 1 clic
Coding assistance tools have significantly evolved, surpassing mere autocompletion to become true agents capable of reading projects, executing commands, modifying files, and iterating towards results. Claude Code and Codex are two such tools operating in this space, each adopting a distinct approach. Claude Code focuses on a unified agent cycle across environments, while Codex distributes its capabilities among the command-line interface (CLI), integrated development environment (IDE) extensions, cloud workflows, and delegated tasks.
Getting Started with Claude Code and Codex CLI
Before diving into real workflows, it's crucial to know how to install these tools on your system. Ensure that Node is already installed on your machine. To install the Codex CLI, open your terminal and run the following command:
npm i -g @[openai](/dossier/openai)/codex
Once installed, Codex can inspect your repository, modify files, and execute commands. For this, you need to log in with an OpenAI account or an API key. To install Claude Code, use the following command:
npm install -g @[anthropic](/dossier/anthropic)-ai/claude-code
After installation, run Claude Code in the terminal by changing the directory to the specific project. You will need to log in with an Anthropic account.
The First 10 Minutes Are Different
From the very first minutes of use, Claude Code presents itself as an assisted partner. It seeks to understand the repository, suggest a plan, and then proceed with permissions and checkpoints to ensure safety. Codex, on the other hand, resembles a configurable execution environment. While it remains conversational, the emphasis is on configuration, policies, workflows, review, and cloud delegation.
When you open a repository for the first time, the practical difference between the two tools becomes immediately apparent. With Claude Code, a natural first move is to explain the authentication flow, list at-risk files, and indicate where the connection might fail. Codex offers a similar experience, but the focus is on defining parameters for freedom, sandboxing, and approvals before diving in.
This difference is significant. If you prefer to be guided towards productivity, Claude Code will likely be more appealing. Conversely, if you enjoy designing a system, Codex might be more rewarding.
The Translation Layer: How Concepts Translate
A large part of the confusion between Claude Code and Codex stems from the different terminology used by each tool. For instance, repository instructions are stored in CLAUDE.md for Claude Code and in AGENTS.md for Codex. Claude Code uses checkpoints and the /rewind command to manage the state of the code and session, while Codex emphasizes code reviews and the structured state of the code.
Repository Instructions: CLAUDE.md vs AGENTS.md
This section is crucial as it affects how the agent feels after the first day of use. Claude Code loads CLAUDE.md at the beginning of each session and uses it as context for the project, your workflow, or even your company. Anthropic's documentation specifies that you should use CLAUDE.md to capture rules you do not want to repeat and utilize automatic memory for Claude's learning.
Codex uses AGENTS.md, but in a more sophisticated manner. You can have a global ~/.codex/AGENTS.md, then a AGENTS.md per repository, and AGENTS.override.md in subcategories, all part of the config.toml structure.
Here’s how this might work. A useful CLAUDE.md for a Node repository might include project-specific rules, while an AGENTS.md for the same repository could contain more detailed and configuration-specific instructions.
The practical lesson is simple: do not wait for the agent to disappoint you multiple times. Write the instruction file early. Both tools improve significantly once your standards are integrated into the repository instead of remaining in your head.
Memory: What Is Retained and How Useful Is It?
The context window for Claude Code is cleared at the beginning of each session, but you can load your CLAUDE.md and automatic memory. According to Anthropic, automatic memory consists of notes that Claude writes based on your corrections and preferences, such as build commands, debugging hints, and items it has noticed while modifying in that tree.
Codex's memories are similar but slightly more explicit. Memories are disabled by default, stored locally (in ~/.codex), and are intended for fixed preferences, common routines, project-specific conventions, and frequent issues. OpenAI's documentation also advises against storing rule memories as the sole place for rules that must always be followed. These should always be included in AGENTS.md or in repository documents.
This leads to an excellent workflow. If you use Claude Code, you can have the agent learn the rhythm of the repository, then use CLAUDE.md for things you need to keep stable. If you use Codex, do not put the contract in memories. Put the contract in AGENTS.md. Put your platform rules in config.toml. Let memories fill in the gaps.
This makes Codex more mechanical. Claude is more like a smart teammate.
Permissions and Planning: This Is Where the Personality Difference Becomes Evident
Claude Code has very descriptive names for permission modes. The available modes are currently default, acceptEdits, plan, auto, dontAsk, and bypassPermissions. The plan mode is particularly interesting as it allows Claude to plan and propose changes without touching your source, and auto is a preview search that uses an additional classifier to filter actions.
Codex describes this in terms of sandbox and approval policy. OpenAI's documentation refers to the sandbox mode as the technical sandbox and the approval policy as the rule for when to ask for permission. Local Codex uses no network by default and a sandbox under the OS, which is typically configured via ~/.codex/config.toml and, potentially, a project-specific .codex/config.toml.
Here’s the practical version. If you want Claude Code to inspect a repository and produce a proposal before touching anything:
claude --permission-mode plan
If you want Claude Code to move faster on safe file modifications:
claude --permission-mode acceptEdits
If you want Codex to be set up for a first read-only pass, OpenAI's documentation shows templates like this:
Open the .codex/config.toml file and add the following lines:
[profiles.readonly_quiet]
approval_policy = "never"
sandbox_mode = "read-only"
Then, you can use this type of profile for an initial audit and only relax it when you are ready.
This difference matters a lot in real teams. Claude exposes the security model as an interaction model. Codex exposes it as a system configuration model.
Real Bug Correction Loop: Where the Tools Start to Diverge
Suppose your validation test fails and you want the agent to investigate, fix, verify, and explain the change. A good workflow with Claude Code looks like this:
- Find out why the validation fails. Start in plan mode, identify the smallest safe fix, implement it, run the relevant tests, and summarize the change in clear language.
A good workflow with Codex looks like this:
- Investigate the validation failure, keep the scope minimal, first explain the root cause, then only fix the necessary files, run the smallest set of relevant tests, and show me the diff I should review.
Notice the difference. With Claude Code, you naturally engage in the flow. With Codex, you naturally engage in explicit scope language and review.
Brief IA — L'actualité IA en français
L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.