Start with repository facts
A good CLI task asks Codex to inspect before editing. Tell it which command failed, where the logs are, which files are likely relevant, and which files must not be touched. This helps the agent avoid broad rewrites.
For unfamiliar repositories, ask for a short map first: package manager, build command, entry points, routing, data layer, and test layout. Then switch to implementation once the map is grounded in file paths.
- Prefer `rg`-style searches and exact file references over broad explanations.
- Name the command that proves the task is complete.
- Keep destructive operations behind explicit human approval.
Use verification as part of the task
CLI work is strongest when the same session can implement and verify. Ask Codex to run the relevant build, typecheck, lint, unit test, or preview check. If a command cannot run, the final report should say why.
Avoid vague requests such as 'make it better'. Use measurable checks: no TypeScript errors, route returns HTTP 200, a visible UI label changed, a failing test now passes, or a screenshot no longer shows overflow.
Write handoff summaries for review
A useful final summary should be short but specific. It should name changed files, explain behavior, list verification, and call out skipped checks. This makes the human review faster and reduces hidden risk.
For larger changes, ask Codex to separate functional changes from cleanup. That makes it easier to spot accidental scope expansion before merging.