Prompting Codex
You do not need a formula. You do need to say the four things a task cannot be finished without.
The documentation's own list, and it holds up: the goal, the context, the output, and the boundaries. Use the parts that help and skip the rest.
| Part | The question it answers |
|---|---|
| Goal | What should it do? |
| Context | What information or files help? |
| Output | What format, length or level of detail? |
| Boundaries | What must stay unchanged, and what should it check with you first? |
The same task, twice
fix the shortener bugThat will produce something. Which bug, in which file, and what counts as fixed are all left to a guess, and next week you get a different guess.
After removing a link, the next code collides with an existing one and
overwrites it. Fix that in shorten.py.
Do not change store.py. Run python3 demo.py afterwards and show me the
output. If the fix needs a change to how codes are stored, stop and tell
me rather than doing it.Goal, context, output, boundary. It is longer, and length is not the point: every sentence removes a decision the agent would otherwise make on its own.
Start with the result
Describe what you want back, not the steps to get there. A prompt that names the commands to run turns an agent into a slow shell, and it breaks the moment the repository is shaped slightly differently.
- Say what done looks like. Tests passing, output matching, a file existing.
- Say what not to touch. This is the line people leave out, and the one that saves reverts.
- Say when to stop and ask. Anything ambiguous, anything destructive.
AGENTS.md. That is the difference between a prompt and a convention, and lesson 6 is where conventions live.- Take your last Codex prompt and mark which of the four parts it had.
- Rewrite it with the missing part and compare the result.
Slow is fine. Stopping is the only problem.