Skip to content
Mastering Claude

Home / Writing a request that works

Writing a request that works6 minApplication

Showing the target rather than forbidding

Three to five input to output examples anchor a format or a tone better than a long list of rules, and a positive instruction gives a clear target where a purely negative instruction leaves Claude guessing what to replace it with.

An instruction that only says what not to do never says what to do instead. Claude then has to pick a form among everything that remains possible once the prohibition is removed, and that choice fails more often than a target named directly.

What a prohibition alone does not give

Take a common instruction, do not use markdown in the response. It rules out bullet lists and headings, but it says nothing about the style that should replace them, a one-sentence response, a short paragraph, several paragraphs that flow into one another. Anthropic's documentation on best practices for writing a request recommends telling Claude what to do rather than what not to do, with this exact example:

Interdiction seule :
Ne pas utiliser de mise en forme dans la réponse.

Instruction positive :
Votre réponse doit être composée de paragraphes en prose
qui s'enchainent naturellement.

The second version names the expected form directly. Claude no longer has to infer a rule from what is refused.

Showing three to five input to output examples

A positive instruction gains further precision when paired with concrete examples. The documentation recommends including three to five input to output examples for tasks where format or tone matter, and it also suggests asking Claude to assess the relevance and diversity of these examples before locking them in, or to generate more from the first set. An input to output example shows two things at once, the message received and the expected response facing it:

Entree : Le colis est arrive casse, je veux un remboursement.
Sortie : Nous sommes desoles pour ce colis abime. Un
remboursement est lance des aujourd'hui, vous recevrez la
confirmation par courriel sous 48 heures.

With two or three pairs of this kind, showing different messages handled in the same register, Claude no longer needs an abstract rule about the tone to hold: it reads it directly from the examples.

The same reflex for an edge case

The principle also applies when a response must stay within a precise frame, politely declining an off-topic question for instance. A long list of forbidden subjects will never cover every case, whereas an example that shows the off-topic input and the output that declines it fixes the limit more reliably. The lesson on separating data from instructions shows how to isolate these examples from the rest of the instruction, so that Claude does not mistake them for data to be processed.

Figure 1

A list of prohibitions against two examples that show the target

List of prohibitions

Do not use markdown, do not be too long, do not start with a polite formula: negative rules that never say what the response should look like.

Two input to output examples

A customer message received and the expected response facing it, then a second, different pair: Claude sees the intended format and tone directly, without having to infer an absent rule.

The contrast concerns what Claude receives to form an idea of the expected output, a list of refusals on one side, concrete examples on the other.
Calibrate it yourself

A communications officer adds to her request three input example and output example pairs that show the expected tone for replying to an unhappy customer. She then submits a new customer message, different from the three examples, and Claude replies in the same register as the examples supplied.

Write, in one sentence, what this situation establishes, and in one sentence what it does not establish.

What to remember
  • An instruction that only says what not to do leaves Claude guessing the expected form, whereas a positive instruction names it directly.
  • The documentation recommends including three to five input to output examples to anchor a precise format or tone.
  • Each example shows both the input received and the expected output, in the same format asked of Claude in production.
  • Asking Claude to assess the relevance and diversity of its own examples before locking them in avoids an overly repetitive set.
  • An example that shows the off-topic input and the output that declines it fixes a limit more reliably than a long list of prohibitions.
Do this now

Take an instruction you use that starts with do not or avoid. Rewrite it by describing the expected behaviour, then add an input to output example that shows that result. Send both versions to Claude on the same request and compare the two responses obtained.

Check the source

Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.