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.
What differs for data work?
| | | Claude Code | Codex |
|---|---|---|
| Project rules | CLAUDE.md (reads AGENTS.md if there is no CLAUDE.md) | AGENTS.md |
| Default before acting | Asks for each new edit or command | Edits and runs routine commands in the workspace |
| Settings | settings.json | ~/.codex/config.toml |
| Scripted runs | claude -p | codex exec |
| Database access | MCP server, scoped local, project or user | MCP server |
How do you run a fair test?
- 1Pick a taskone you know the answer to: "add a region column to the sales view"
- 2Same rulesone AGENTS.md; Claude Code reads it when there is no CLAUDE.md
- 3Same check"done when monthly totals are unchanged and tests pass"
- 4Comparecorrect result, corrections you made, time, tokens
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.