OpenAI's best practices guide for Codex suggests four things in each prompt: the goal, the context (files, docs, examples or errors), the constraints and when the task counts as done. When a task is complex, ambiguous or hard to describe, the guide recommends asking for a plan before any code. In Codex, Plan mode, toggled with “/plan” or Shift+Tab, lets the agent gather context, ask clarifying questions and build a plan before implementing.
When you are not sure what you want yet, ask the AI to interview you before it edits anything. Both guides suggest this, and OpenAI's adds that it should challenge your assumptions. Anthropic's shows a request to add rate limiting to a public API that ends with “Interview me until you could write the spec, then write it to SPEC.md.” The guide then recommends a fresh session to build from that file, with a clean context.