Codex CLI works directly in your terminal and can inspect files, edit code and run local tools. Start from a clean Git state and use the permission profile appropriate to the repository.
1. Start in the intended repository
cd into the repository, inspect git status, then run codex. Confirm the displayed working directory before giving a task.
2. Ask for inspection first
For an unfamiliar project, ask Codex to explain structure, relevant commands and likely files. Do not start with “rewrite this app.”
3. Set the permission boundary
Use /permissions or the configured profile to decide when Codex can edit, execute commands or access other resources. Keep the first run conservative.
4. Make one bounded change
Describe the expected behavior, files that may change and acceptance checks. Let Codex edit only after the plan makes sense.
5. Review and run checks
Use /review or inspect the diff, run relevant tests/lint/typecheck, and compare behavior with the acceptance criteria before committing.
Inspect this repository first. Tell me the files and checks relevant to [task]. Propose a minimal plan. Do not edit until the plan is clear; after editing, run the existing checks and summarize the diff and remaining risks.
Starting Codex from the wrong directory; granting broad permissions before understanding the repo; mixing unrelated fixes; accepting edits without tests or review.
Finish check
The change is limited to the intended behavior, repository checks are run, and every important diff is understandable before commit.