Codex

Use Codex CLI for a Bounded README Change

Summary

Cihan's view: Give Codex one file, one requested change, and explicit stop conditions. Inspect the diff and run the repository's existing checks before accepting anything.

Choose another work task →

For: builders and operators who need a small, reviewable change in a local repository.

Artifact: a reviewed README diff that changes one section and leaves unrelated files untouched.

Evidence label: Documentation-based guide. The commands and workflow are based on the current Codex CLI documentation. One real Codex run of the brief in step 2 is recorded in the section “What happened when I ran it”. The sentence, task and repository are fictional, and one run is not a benchmark.

Advanced builder lesson: this requires a terminal, a local Git repository, and permission to run commands. If you do not use Git or a coding agent, use the no-code alternative below.

What Codex CLI is

OpenAI describes Codex CLI as a local coding agent that can read, change, and run code in the selected directory. The Codex documentation also describes repository work, tests, commands, and change review as part of its use. Access, model options, and workspace policies can vary.

Sources: Codex CLI, ChatGPT Work and Codex.

Fictional repository task

Assume this repository contains README.md with a section called Local setup. You want to add one sentence explaining where the example data lives. You do not want a code change, a dependency update, or a new file.

Expected change:

README.md only
Add one sentence under "Local setup":
"Example input files live in the examples/ directory."
Do not change any other wording.

Three steps

  1. Open a terminal in a disposable clone or a branch where you can review changes. Confirm the starting state before the agent works:
git status --short
git branch --show-current
test -f README.md && printf 'README exists\n'

If the working tree already contains unrelated changes, stop and save them or use a clean copy.

  1. Start Codex in that repository with codex. Give it this bounded brief:
Edit README.md only.

Task: under the existing heading "Local setup", add exactly this sentence:
"Example input files live in the examples/ directory."

Constraints:
- Do not edit any other file.
- Do not add dependencies.
- Do not run destructive commands.
- Do not rewrite nearby wording.
- Before finishing, show the proposed diff and stop for my review.

Acceptance checks:
- git diff -- README.md shows one added sentence.
- git diff --name-only shows only README.md.
- The sentence appears once.
  1. Review the result outside the agent. Run:
git diff -- README.md
git diff --name-only
rg -n -F "Example input files live in the examples/ directory." README.md

Then run the repository’s documented checks, if any. Do not treat a clean diff as proof that the sentence is factually correct. Check the path and wording yourself before committing.

What happened when I ran it

On 30 October 2026 I ran the exact brief from step 2 once, in a scratch Git repository with a clean working tree and a README that has a “Local setup” heading. I used Codex CLI 0.164.0 non-interactively (codex exec -s workspace-write). Codex exited normally.

I ran the three review commands from step 3 myself afterwards:

  • git diff --name-only listed README.md and nothing else.

  • git diff -- README.md showed one added sentence, with no other wording touched.

  • The sentence appeared once.

Codex put the sentence directly under the “Local setup” heading, before the existing line of setup text. The brief allowed that, because it only said “under the existing heading”. If placement matters to you, say where.

Codex also printed the proposed diff and then stopped, as the brief asked. It had already written the change to the working tree, so the review step is a check of a finished edit, not an approval before the edit.

This was one run on my own Codex installation, which loads my personal configuration (its reply addressed me by name). A clean installation, another model setting or another repository may behave differently, so keep the checks in step 3.

What to accept

Accept the change only when git diff --name-only returns README.md, the sentence occurs once, the surrounding section remains intact, and the repository checks pass. If the repository has no checks, record that fact rather than claiming a test result.

Common failure fixes

Codex edits several files. Stop. Reset only the agent’s changes if you understand what they are, or discard the disposable clone. Restart with a clean working tree and a stricter file allowlist.

The heading does not exist. Do not let the agent create a new section by assumption. Ask for a report of the closest matching headings, then decide where the sentence belongs.

The agent runs an unexpected command. Stop the session and inspect the command and its effect. Use a disposable copy for unfamiliar repositories and never provide production credentials just to edit documentation.

No-code alternative

Open the README in your normal editor, make the one-sentence change, and use the same three checks. The useful lesson is the boundary and review process, not the agent brand.

Limits and access

Codex CLI is a local technical tool, not a substitute for repository permissions or review. The exact commands, model choices, and policies shown in the interface can vary by installation and workspace. Keep secrets out of prompts and review every file change before a commit or deployment.

For a related technical guide, read Use Claude Code to Remove Exact Duplicate Rows from a Sample CSV.

About Cihan

Creator and operator focused on practical AI for business professionals. Background and editorial approach →