Codex Prompting Best Practices
Good prompts make Codex faster, safer, and more accurate.
Structure Of A Good Instruction
Include:
- The desired outcome.
- The relevant files, screenshots, URLs, or constraints.
- What should be verified.
- What should not be changed.
Seven High-Hit-Rate Tips
- State the end state, not only the first step.
- Mention constraints and non-goals.
- Ask Codex to inspect before broad edits.
- Give examples when style matters.
- Request verification commands.
- Keep unrelated refactors out of scope.
- Ask for a concise handoff.
Use Structured Input
Bullets, tables, screenshots, and file references help Codex disambiguate the task.
Bad vs Good Examples
Weak: "Fix the page."
Better: "Update the homepage cards to match the attached screenshot. Keep the existing routes and nav. Verify the local page at /index.html."
Keep Long Tasks On Track
For long work, ask for a plan, checkpoints, or a goal. Keep acceptance criteria visible.
Extra Tips For CLI Users
Use explicit working directories, mention test commands, and keep prompts reproducible for scripts.
Next Steps
Continue with Advanced Tips.