Skip to content New: the Claude Skills catalog — what each skill does and how to install it →
LRN-01 · Manual · chapter 01 · rev. 10/2026

What is prompt engineering

Prompt engineering is writing and testing instructions so a language model gives the answer you need, reliably. It comes down to a clear task, enough context, a defined output and a habit of testing.

LevelBeginner
Works inChatGPT, Claude, Gemini
Reading time8 min
CheckedOct 2026

Prompt engineering is the practice of writing instructions for an AI model so that it produces what you need, and keeps producing it. OpenAI defines it as "the process of writing effective instructions for a model, such that it consistently generates content that meets your requirements." This chapter covers the parts of a good prompt, the main techniques, how ChatGPT, Claude and Gemini differ, and the mistakes that waste the most time.

Prompt engineering, defined

An LLM prompt is everything you send a large language model: the request, the background, any examples and any files. Prompt engineering is the work of shaping that input and checking the result. The three big vendors describe it in similar terms:

  • OpenAI calls it "a mix of art and science", because model output is not fully predictable and the same prompt can return different answers.
  • Google calls the same work prompt design: "the process of creating prompts, or natural language requests, that elicit accurate, high quality responses from a language model."
  • Anthropic treats it as an engineering loop. Before you start, its guide asks for three things: a clear definition of success, a way to test against it, and a first draft to improve.

The last point matters most in practice. A prompt is good when it passes your test, and you can only know that if you decided what a good answer looks like before you hit send.

The parts of a good prompt

Google's Workspace prompting guide names four areas to cover: persona, task, context and format. OpenAI's guide suggests a similar order for longer prompts: identity, instructions, examples, context. Put the two lists together, add rules and the material to work on, and you get the seven parts in the table below. A short prompt rarely needs all seven. A prompt you will reuse usually does.

Here is one prompt with every part filled in. Copy it and replace the bracketed blank with your own text.

Annotated example
You are an editor for a small B2B software blog.

Task: rewrite the product update below as a customer email of about 150 words.

Context: the readers are office managers with no technical background. They want to know what changes for them on Monday. We send this email because last month's release notes confused people.

Rules: plain words, no feature names they would not recognize, one link at the end.

Format: a subject line, then three short paragraphs.

Example of the tone we want: "Starting Monday, invoices go out on their own. You can still edit any of them before it sends."

Product update:
[paste the release notes here]
PartIn the exampleWhat it does
Role"You are an editor for a small B2B software blog"Sets tone and expertise. Anthropic notes that even a single sentence of role makes a difference.
Task"rewrite ... as a customer email of about 150 words"One verb, one deliverable, one size.
ContextWho reads it and why the email existsAnthropic's guide says that explaining why an instruction matters helps Claude aim the answer.
RulesPlain words, one linkConstraints the model would otherwise guess at.
FormatSubject line, three paragraphsThe shape of the output, so you can use it without editing.
ExampleOne sentence in the target toneShows the style instead of describing it.
InputThe pasted release notesThe material to work on, placed last and clearly labeled.

Anthropic's test for any prompt: show it to a colleague who knows nothing about the task. "If they'd be confused, Claude will be too." The rule holds for ChatGPT and Gemini as well.

The main techniques

Most prompting advice reduces to a short list of techniques. Each has its own chapter in this manual.

  • A clear method. Decide the success test, write the task, add context, set the format, then revise. The full method is in how to write AI prompts.
  • Zero-shot prompting. Instructions only, no examples. OpenAI advises trying this first with reasoning models. See zero-shot prompting.
  • Few-shot prompting. A handful of input and output examples that fix the format and tone. Anthropic recommends 3 to 5 examples. See few-shot prompting.
  • Chain of thought. Asking the model to work through intermediate steps before it answers. The idea comes from a 2022 paper by Wei et al., and the practice has changed since thinking models arrived. See chain of thought prompting.
  • Structure and delimiters. Headings, Markdown or XML tags that separate instructions from material. All three vendors recommend them.
  • Prompt chaining. Splitting a job into several calls. Anthropic's most common pattern is draft, then review against criteria, then refine.
  • System prompts. Standing instructions that apply to a whole conversation or product. See the system prompts guide.
  • Context engineering. Deciding everything that sits in the model's context window: documents, tools, memory, history. See context engineering.

How it differs between ChatGPT, Claude and Gemini

The basics carry over between models. The vendors' own guides point out a few differences worth knowing, as of October 2026.

Model familyWhat the vendor guide says
OpenAI (ChatGPT, API)Reasoning models work best with high-level guidance, as you would give a senior colleague. GPT models need more precise, explicit instructions. For reasoning models, skip "think step by step" and try zero-shot before adding examples.
Anthropic (Claude)Be clear and direct, and ask explicitly for "above and beyond" work if you want it. XML tags such as <instructions> and <context> reduce misreading. With long documents, put the documents first and the question last: Anthropic reports that queries at the end improved response quality by up to 30 percent in its tests.
Google (Gemini)Google says prompts without few-shot examples are likely to be less effective. For Gemini 3 models, keep prompts direct and well structured with clear delimiters, and leave temperature, top_p and top_k at their defaults. With long context, put the question at the end.

The practical takeaway: write one clear prompt, then adjust for the model. If the output is too literal, give a reasoning model more room. If the output drifts, add examples or tighter rules.

Common mistakes

  • No success test. Without a definition of a good answer, you cannot tell whether a change helped. Anthropic lists this as the first prerequisite.
  • Assuming the model knows your situation. Anthropic's blog lists assuming the model can read your mind as a common mistake. State the audience, the purpose and the length.
  • Only saying what not to do. Anthropic suggests describing the output you want instead. Asking for smoothly flowing prose paragraphs works better than "do not use Markdown".
  • Stacking every technique at once. Over-engineering is on the same list. In Anthropic's words, the best prompt is "the one that achieves your goals reliably with minimum necessary structure."
  • Old tricks on new models. Telling a reasoning model to "think step by step" is unnecessary according to OpenAI. Changing sampling settings on Gemini 3 goes against Google's advice.
  • Question before the document. With long inputs, both Anthropic and Google advise placing the question after the material.
  • Testing once. Output varies between runs. Anthropic's blog suggests checking whether the format holds across several attempts before you call a prompt finished.

To see these fixes on real prompts, run one through the ChatGPT prompt optimizer, or take a ready prompt from the writing prompts category and change one part at a time.

Where to practice

Every prompt in the best AI prompts collection shows the parts above in a finished form: a role, a task, rules and an output format. Pick one close to your work, change the context to your own, and compare the answers before and after. The Claude prompts hub is useful for practising long-document prompts with the material placed first.

FAQ

Is prompt engineering still relevant in 2026?

Yes. OpenAI, Anthropic and Google all maintain current prompting guides for their newest models, and Anthropic describes its best-practices page as "the living reference". What has shifted is scope. Anthropic's engineering team now writes about context engineering, which treats the prompt as one part of everything the model sees.

What is the difference between prompt engineering and fine-tuning?

Prompt engineering changes the input. Fine-tuning changes the model by training it on more data. OpenAI notes that few-shot examples can steer a model toward a new task without fine-tuning. Anthropic adds that not every problem is a prompting problem: latency and cost, for example, are often easier to fix by choosing a different model.

What does a prompt engineer do?

The work follows Anthropic's loop: define what success looks like, build tests, write a first prompt, then revise it until it passes. Day to day, prompt engineering entails the parts and techniques on this page: wording the task, choosing examples, setting the output format, structuring long inputs and testing the prompt on many cases.

Where can I learn prompt engineering for free?

Anthropic publishes an interactive prompt engineering tutorial on GitHub, written for Claude 3 models. Google and Kaggle published a prompt engineering whitepaper by Lee Boonstra. DAIR.AI maintains an open Prompt Engineering Guide. This manual condenses those sources into short chapters with prompts you can run.

Do I need to know how to code?

No. Everything in this chapter works in the ChatGPT, Claude and Gemini chat apps. Code becomes useful when you want to test a prompt on many inputs at once, which is how the vendor guides recommend evaluating prompts for products.

Sources

  1. Prompt engineering — OpenAI, accessed October 2026
  2. Reasoning best practices — OpenAI, accessed October 2026
  3. Prompt engineering overview — Anthropic, accessed October 2026
  4. Prompting best practices — Anthropic, accessed October 2026
  5. Best practices for prompt engineering — Claude blog, Anthropic, accessed October 2026
  6. Prompt design strategies — Google AI for Developers, accessed October 2026
  7. Long context — Google AI for Developers, accessed October 2026
  8. Writing effective AI prompts — Google Workspace, accessed October 2026
  9. Google/Kaggle whitepaper: Prompt Engineering — Lee Boonstra, accessed October 2026
  10. Prompt Engineering Guide — DAIR.AI, accessed October 2026
  11. Effective context engineering for AI agents — Anthropic, accessed October 2026
  12. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models — Wei et al., arXiv, accessed October 2026
Weekly

New prompts in your inbox

One email a week: the best new prompts and one short guide. Unsubscribe any time.