Working with Codex

Codex: from a task to a reviewed change

Codex

Give Codex a real task, keep project rules in AGENTS.md, and turn a proven routine into a skill. Finish with evidence you can review.

Applies to
Codex
Last verified
Reviewed by
Timothy Fehr

Open the repository you want to change. Give Codex the outcome, relevant files, constraints, and a way to prove it worked. With the necessary tools and permissions, it can inspect files, implement changes, run checks, and review the diff. Available tools depend on your setup.

Try a complete task

Fix the search field losing keyboard focus after each keystroke. Start by locating the component and reproducing the issue. Keep the current design and avoid new dependencies. Implement the fix, run the relevant checks, and test typing a full phrase with the keyboard. Report what changed, what passed, and anything you could not verify. Prepare a reviewable diff.

For a larger change, ask for a plan first. Resolve decisions that affect the result, then ask Codex to implement the agreed plan. For a small fix, a clear completion condition may be enough.

Keep project rules in AGENTS.md

Codex reads AGENTS.md for project guidance. Put stable facts there: the build command, important folders, conventions, and required checks. Keep the current task in your prompt. Ask Codex which instructions apply if it seems to follow an unexpected rule; more specific instructions can override broader ones.

For this site's kind of project, a useful rule would be:

Register route changes and their redirects. Run the content checks and site build after changing templates. Review generated English and German pages.

Turn a routine into a skill

A skill packages a repeatable workflow in a SKILL.md file, with optional scripts and references. Start after a routine works: for example, checking translated pages for missing labels and broken links. Describe when the skill should run, its inputs, its output, and how to verify that output.

In Codex CLI or the IDE extension, use $ to mention a skill, or /skills to browse. Repository skills can live under .agents/skills. A skill supplies instructions; it does not grant access to tools or accounts.

What goes wrong

“Improve the site” leaves the success criteria open. A task that asks only for code may finish without checking the user experience. An outdated AGENTS.md can point at commands that no longer work. Update the specific instruction or completion condition when you find the cause.

How to check

Read the diff and try the original failing action yourself. Check which commands actually ran and which checks were blocked. For the search example, type, delete, and navigate results using only the keyboard. Passing a build does not establish that focus now stays in the field.

Sources

  1. OpenAI: Codex best practices Tier 1 2026-09-06
  2. OpenAI: Custom instructions with AGENTS.md Tier 1 2026-09-06
  3. OpenAI: Build skills Tier 1 2026-09-06