Guide

How a prompt works: give a clear job

Published 16 Nov 2026 · Problem, method and result · Every source is a checked official link

All guides · All case studies

Problem

A user sends a short, vague request to an LLM. The model must guess the goal, the format, and the limits. The answer is then too long, in the wrong format, or without the necessary data. The user must send the request again. Time is lost, and token cost increases.

Method

  1. Write the job in one sentence. Say what the model must do.
  2. Add limits for length, format, and tone. Say what the model must not include.
  3. Put the instructions first. Put the source text after the instructions.
  4. Mark the source text with tags or quotation marks.
  5. If the format is important, give 3 to 5 examples of good input and output.
  6. If the tone is important, give the model a role in the system prompt.
  7. For long documents, put the documents first. Put the question last.
  8. Show the prompt to a person who does not know the task. If that person is not sure, rewrite the prompt.
  9. Tell the model what to do. Do not only tell the model what to avoid.

OpenAI states that you must put instructions at the start of the prompt. You must be specific about context, outcome, length, format, and style. Examples of the desired output format help the model. A precise length such as "3 to 5 sentences" is better than a vague limit.

Anthropic states that Claude responds well to clear, explicit instructions. Anthropic compares the model to a new employee who does not know your norms. Anthropic recommends 3 to 5 examples and a role in the system prompt. XML tags can separate instructions, context, examples, and inputs. For long context, put long documents near the top of the prompt, above the query.

Result

A clear prompt decreases guesswork. The model can follow the format and the limits more reliably. The user can get a usable answer with fewer retries. This method does not need code. It applies to chat products and to API calls.

Sources

  1. Anthropic, Prompting best practices: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
  2. OpenAI, Best practices for prompt engineering with the OpenAI API: https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api

More write-ups: case studies. Related study: context rot.