Your first Codex task on a data repository

Install Codex, open the project, sign in, run /init, then ask. A safe first task for a data repo is adding tests, not changing logic. The four steps, the prompt, and how to check what it did with /review.

Short answer: install Codex, open a terminal in your data repository, type codex and sign in with ChatGPT. Run /init so it writes an AGENTS.md about the project. Then give it a task that adds safety without changing results, such as: "Add tests that check order_id is unique and amount is never negative in the orders model. Done when the tests run and pass." Read the changes with /review before you keep them.

A first task should be easy to check and hard to get badly wrong. Adding tests fits: if Codex writes a bad test, it fails or finds nothing; it does not change a single number in a report.

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 are the four steps?

  1. 1
    Installone line from OpenAI's Codex docs
  2. 2
    Open and sign incd to the repo, type codex, sign in with ChatGPT
  3. 3
    /initCodex writes AGENTS.md: how to build and test, the folders
  4. 4
    Ask, then /reviewone task with a clear "done when", then read the diff
From install to a first change

Why do tests make a good first task?

First taskRiskEasy to check?
Add data tests to a modelLow: no logic changesYes: run them
Document the models in a READMELowYes: read it
Rename a column everywhereMedium: many filesNeeds a full test run
Rewrite a transformationHigh: numbers can changeNeeds reconciliation

How do you check the result?

  • /review shows the changes and points out issues, without editing files.
  • Run the tests yourself and see them pass, then break one value on purpose and see a test fail.
  • Commit only what you read.

Where can you check this?

Where do you start?

Make the habits stick with Codex habits for SQL changes, and when the task should run on a schedule, see codex exec in a data pipeline.

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.