Claude Code vs Codex for data work: how to choose

Claude Code and Codex do the same kind of work with different files and defaults: CLAUDE.md or AGENTS.md, ask-first or a sandbox. What that means for SQL, pipelines and notebooks, and a fair test to run on your own data repo.

Short answer: for data work the two are closer than the debates suggest. Claude Code (Anthropic) reads CLAUDE.md and asks before it edits files or runs commands. Codex (OpenAI) reads AGENTS.md and works inside a sandbox where it may edit the project and run routine commands without asking. Both have skills, hooks and MCP servers, and both run in the terminal, the editor and the cloud. Choose by running the same data task on both and comparing the result, the review effort and the cost.

A data repository makes the difference in defaults matter: a command that runs without asking might be a test, or a query against a database. Knowing how each agent holds back tells you what to set up before either touches your pipeline.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

What differs for data work?

|Claude CodeCodex
Project rulesCLAUDE.md (reads AGENTS.md if there is no CLAUDE.md)AGENTS.md
Default before actingAsks for each new edit or commandEdits and runs routine commands in the workspace
Settingssettings.json~/.codex/config.toml
Scripted runsclaude -pcodex exec
Database accessMCP server, scoped local, project or userMCP server
The differences that matter in a data repo

How do you run a fair test?

  1. 1
    Pick a taskone you know the answer to: "add a region column to the sales view"
  2. 2
    Same rulesone AGENTS.md; Claude Code reads it when there is no CLAUDE.md
  3. 3
    Same check"done when monthly totals are unchanged and tests pass"
  4. 4
    Comparecorrect result, corrections you made, time, tokens
A fair comparison on your own repo

What should you set up on either?

  • A read-only database login for any MCP server.
  • The test command allowed to run without asking.
  • A totals check in the "done when" of every pipeline task.

Where can you check this?

Where do you start?

Start each one on a safe task: your first data task in Claude Code and your first Codex task on a data repository. Both read the same rules from a CLAUDE.md for a data repository if you name it AGENTS.md.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.