Understand · Step 2 of 14

Prompting

A prompt is a brief you hand to a very capable, very literal collaborator who knows nothing about your situation. Most bad results are bad briefs — here is how to write good ones.

The shape of a good prompt

A reliable prompt has four parts. You do not always need all four, but when a result disappoints, a missing part is usually why.

  • Goal — what you are trying to achieve and what success looks like. A one-line role ("you are reviewing this as a security engineer") can help focus it, but it is no substitute for the goal.
  • Context — the facts it cannot guess: your data, constraints, audience, environment, and why you want this.
  • Instructions — the concrete task and its boundaries.
  • Output format — exactly how you want the answer shaped (JSON, a table, a diff, 3 bullet points).

Describe the outcome, not every step

Older models needed to be walked through a task. Current ones plan well on their own, and a rigid step-by-step script usually makes the result worse — the model follows your steps even where its own plan would have been better. Say what done looks like, what the limits are, and how to check the result. Keep numbered steps for the cases where the order truly matters.

Instead of:
  "Step 1: read the file. Step 2: list the functions.
   Step 3: for each function, check for..."

Write:
  "Find the cause of the failing login test and fix it.
   Don't change the public API. You're done when
   `npm test` passes."

Show, don't just tell

Examples are the strongest signal in a prompt — stronger than paragraphs of description. The model will match their length, tone, and structure closely, so if you give only one, expect near-copies of it. When variety matters, show two or three that differ.

Rewrite support emails to be warm and concise.

Example
Input:  "Your ticket #4412 is closed."
Output: "Good news — we've resolved ticket #4412.
         Reply here any time if anything still feels off."

Now rewrite this one:
Input: "Refund processed, 5-7 days."
Be specific about the format. "Summarize this" invites a guess. "Summarize this as three short bullets a busy manager could read in ten seconds" does not.

Constraints beat corrections — with the reason attached

It is cheaper to state a boundary up front than to fix a violation afterward. Say what the model may assume and what to do when it is unsure — and say why. A rule with a reason gets applied sensibly to cases you didn't think of; a bare rule gets applied literally.

Constraints:
- Use only the figures in the data below. This goes to
  the finance team, so an invented number is worse than
  a missing one.
- If a value is missing, write "unknown".
- Keep it short enough to read on a phone.

Say it once, at normal volume

ALL-CAPS warnings, "CRITICAL", and the same rule repeated three times were tricks for models that didn't listen. Current models listen closely, so shouting backfires: the model over-applies the loud rule and gets cautious about everything near it. Hedges backfire the other way — "try to include a summary if possible" is read as permission to skip it. State each requirement once, plainly, as a requirement.

Iterate like a debugger

Treat the first answer as a draft, not a verdict. When it is off, change one thing and re-run, so you learn what actually moved the result:

  • Wrong focus? Add or sharpen the goal.
  • Made something up? Add context or a "don't guess" constraint.
  • Right idea, wrong shape? Pin the output format with an example.
  • Too long or too short? Give it a hard length budget.

Thinking is a setting now, not a phrase

"Think step by step" used to be the best trick in prompting. Current models reason before answering on their own, and you control how much with a setting — usually called effort or a thinking mode — rather than with words in the prompt. Turn it up for math, planning, and tricky debugging; turn it down for simple lookups and rewrites, where it only adds time and cost. See the AI Picker for how effort fits with model choice.

Briefing an agent is different

When the model will work on its own for many steps — in a coding agent, say — give it the whole brief up front: the goal, the constraints, where things live, and how it can verify its own work. An agent that can run the tests corrects itself; one that has to guess what "done" means will stop early or wander. Standing instructions you would otherwise repeat every time belong in the project's instruction file (CLAUDE.md, AGENTS.md), not in each prompt. Coding Agents covers this in full.

Prompts are not security. "Never reveal X" is a guideline, not a guarantee. Keep secrets out of the prompt and enforce real rules in code. The same goes the other way: text the model reads from a web page, an email, or a file may contain instructions written by someone else. Treat anything the model fetched as data, not as orders.

Next: what the brief sits on

A prompt is the part you type. The model also works from everything else in front of it — documents, history, tool results. Choosing that material well matters as much as the wording, and it is the next step: Context.