
TL;DR
Prompt engineering is the practice of writing instructions so that a model returns what you need. The three vendors agree on the core: be clear, give context, show examples, structure the prompt and test the result. They differ on how firmly to recommend examples and where to put context.
- Purpose: Prompt engineering means writing instructions so that a model consistently produces output that meets your requirements, as OpenAI defines it.
- Steps: Anthropic, OpenAI and Google all advise clear instructions, context, examples, a consistent structure and repeated testing.
- Size: Anthropic recommends three to five examples, while Google says to always include few-shot examples.
- Dispute: OpenAI places context near the end of a prompt, and Anthropic places long documents at the top.
- Limit: OpenAI and Anthropic say that advice depends on the model, so you must test it on yours.
What prompt engineering is
OpenAI gives a definition. Prompt engineering “is the process of writing effective instructions for a model, such that it consistently generates content that meets your requirements”.
OpenAI is frank about the limits. Prompting “is a mix of art and science”. Google says the same in other words: “Prompt engineering is iterative.”
Anthropic sets a precondition. Its guide assumes that you have three things: “A clear definition of the success criteria for your use case”, “Some ways to empirically test against those criteria” and “A first draft prompt you want to improve”.
Anthropic also warns that “Not every success criterion or failing eval is best solved by prompt engineering”. It adds that you can sometimes improve latency and cost “more easily by choosing a different model”.
Be clear and direct
Anthropic and Google both open with clarity. Anthropic: “Claude responds well to clear, explicit instructions.” It offers an image: “Think of Claude as a brilliant but new employee who lacks context on your norms and workflows.”
Anthropic also gives a test. “Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they’d be confused, Claude will be too.”
Google's guidance for its Gemini 3 models is similar. “State your goal clearly and concisely. Avoid unnecessary or overly persuasive language.”
OpenAI separates instructions from input. Its instructions parameter “gives the model high-level instructions on how it should behave while generating a response, including tone, goals, and examples of correct responses”.
Say why, and say what to do
Anthropic asks for the reason behind a rule. “Providing context or motivation behind your instructions, such as explaining to Claude why such behavior is important, can give Claude more information about your goals and help it deliver more targeted responses.”
Its example replaces “NEVER use ellipses” with: “Your response will be read aloud by a text-to-speech engine, so never use ellipses since the text-to-speech engine will not know how to pronounce them.”
For formatting, Anthropic advises: “Tell Claude what to do instead of what not to do”. Its example is “Your response should be composed of smoothly flowing prose paragraphs.”
Google adds the same idea for missing facts. You should include in a prompt “instructions and information” the model needs, “instead of assuming that the model has all of the required information”. Our explainer on RAG covers how to supply such information at scale: What Is RAG? Retrieval-Augmented Generation Explained
Show examples
Anthropic calls examples “one of the most reliable ways to steer Claude's output format, tone, and structure”. It asks for examples that are relevant, diverse and structured, and it recommends three to five of them.
Google is firmer. “We recommend to always include few-shot examples in your prompts.” It asks for “specific and varied examples”, and it warns that “you may need to experiment with the number of examples”.
Google also stresses form: “it is essential to ensure a consistent format across all examples”.
OpenAI gives the same direction: “When providing examples, try to show a diverse range of possible inputs with the desired outputs.”
Structure the prompt
Anthropic: “XML tags help Claude parse complex prompts unambiguously, especially when your prompt mixes instructions, context, examples, and variable inputs.”
OpenAI recommends Markdown and XML together. Its guide says “XML tags can help delineate where one piece of content (like a supporting document used for reference) begins and ends”. Its suggested developer message has four parts: Identity, Instructions, Examples and Context.
Google asks for one format per prompt. For Gemini 3 it advises that you “choose one format and use it consistently within a single prompt”.
Where to put long inputs
Here the vendors differ. Anthropic writes: “Place your long documents and inputs near the top of your prompt, above your query, instructions, and examples.” It adds that queries at the end can improve response quality “by up to 30 percent in tests”. That is Anthropic's own figure.
Google agrees with Anthropic. For long contexts it says to “supply all the context first” and to “Place your specific instructions or questions at the very end of the prompt.”
OpenAI says something else about context. Its guide says context is “usually best positioned near the end of your prompt, as you may include different context for different generation requests”. The two positions are not about the same input. Anthropic speaks about long documents, and OpenAI gives a reason tied to changing context. The guides do not address each other, so test both for your task.
Long inputs also cost tokens. Our explainer on tokens covers the window: Tokens and Context Windows: What the Numbers Mean
Prompting reasoning models
Reasoning models change the advice. OpenAI writes that “reasoning models will provide better results on tasks with only high-level guidance”, while GPT models “benefit from very precise instructions”.
OpenAI's analogy: “A reasoning model is like a senior co-worker.” You give a goal and trust them with the details. “A GPT model is like a junior coworker.”
Google says the same about its thinking models. It is “generally not necessary to have the model outline, plan, or detail reasoning steps in the returned response itself”. For heavy reasoning, a request like “Think very hard before answering” can help, “though at the cost of extra thinking tokens”.
Anthropic's guide for Claude Opus 4.6 warns against too much pressure. It says to “Remove over-prompting” and notes that “Tools that undertriggered in previous models are likely to trigger appropriately now”. Our explainer on reasoning models shows what the extra thinking costs: What Are Reasoning Models? How They Differ From Standard LLMs
Break big tasks down
Google advises that you “Chain prompts”: make each step a prompt, so the output of one becomes the input of the next. Anthropic agrees that explicit prompt chaining “is still useful when you need to inspect intermediate outputs or enforce a specific pipeline structure”.
Test, pin and version
OpenAI recommends pinning production applications to specific model snapshots. It also recommends “Building tests and evaluation suites that measure prompt behavior”. The reason: “Even different snapshots of models within the same family could produce different results.”
Google says to iterate. Different phrasing matters: “Using different words or phrasing in your prompts often yields different responses from the model even though they all mean the same thing.”
Anthropic limits its own advice. “Where a technique names a specific model, treat it as measured on that model and re-check it against your own evals before applying it to another.”
Prompts also do not remove errors. Our explainer on hallucinations covers what vendors say about that: Why Do LLMs Hallucinate? What the Research Says
What this article does not cover
We did not test any prompt. Every recommendation is quoted from a vendor guide as of November 6, 2026, and these guides change with each model.
We read the Anthropic, OpenAI and Google guides, not other sources. Anthropic and OpenAI publish separate guides for each model, and we did not read those.
Sources
- Anthropic, Prompt engineering overview (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview
- Anthropic, Prompting best practices (Claude Platform Docs): https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- OpenAI, Prompt engineering (API documentation): https://platform.openai.com/docs/guides/prompt-engineering
- Google, Prompt design strategies (Gemini API documentation): https://ai.google.dev/gemini-api/docs/prompting-strategies







