Skip to content
Mastering Claude

Home / Writing a request that works

Writing a request that works8 minApplication

Composing a complex request without inventing

A complex request is composed piece by piece, who Claude should be, the context, the data to process, what is being asked, an example, the expected format, then a final line that allows Claude to say I do not know rather than invent an answer.

A complex request mixes several types of content, Claude's expected role, the task's context, the data to process, the instruction, an example, the wanted format. Thrown into a single paragraph with no order, these elements force Claude to guess which is which, and one of them, the permission to say it does not know, is almost always the first to disappear.

Putting each piece in its place

Assembling a complex request piece by piece, in a fixed order, removes this sorting work. One practical way to proceed is to arrange, in this order, who Claude should be, the context of the task, the data to process clearly delimited, what is being asked worded as a positive instruction, an input to output example, then the exact format of the response:

Role : vous etes assistant de gestion administrative.
Contexte : ce resume sert a une decision de comite demain.
Donnee : <dossier> ... </dossier>
Instruction : listez les points bloquants du dossier.
Exemple : dossier A -> trois points bloquants numerotes.
Format : liste numerotee, cinq lignes maximum.

Each piece stays isolated from the others. Changing the example or the format later touches nothing else in the request, which makes the next version easier to correct than if everything sat in a single block of text.

Adding a fallback output before it is missed

The last piece matters as much as the others, a safeguard, a line that explicitly allows Claude to answer I do not know rather than invent information absent from the data supplied. Anthropic's documentation on reducing hallucinations puts it this way: giving Claude explicit permission to admit uncertainty is a simple technique that can sharply reduce false information. Without this line written into the request, Claude picks the most likely answer given the rest of the text, even when that answer is wrong.

The lesson on input to output examples finds its natural place here, right before the expected format, to show Claude what a correct response looks like before giving it the output that covers the case where information is missing.

Figure 1

The pieces of a complex request, in order

01
Role
A sentence stating who Claude should be for this task.
02
Context
The why of the request and the final reader of the response.
03
Data
The document or figures to process, clearly delimited from the rest of the request.
04
Instruction
What is being asked, worded as a positive instruction rather than a prohibition.
05
Example
An input to output pair that shows the expected result.
06
Format
The exact form of the response, length, structure, absence of preamble.
07
Safeguard
A line that explicitly allows Claude to answer I do not know rather than invent information absent from the data supplied.
The diagram arranges the pieces of a complex request in the order described in the body, the last piece being the fallback output that allows Claude to answer I do not know.
Calibrate it yourself

A student records officer composes a request to Claude that gathers the expected role, the institution's rules, the list of files to process and the wanted response format, with a final line that allows Claude to answer I do not know if a file lacks information. Claude processes eighteen files and answers I do not know on two of them, each missing its date of birth.

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

What to remember
  • A complex request mixes several types of content, role, context, data, instruction, example, format, with no order to separate them leaves Claude to do the sorting.
  • Arranging each piece of a complex request in its place makes it easier to correct afterwards, a single piece changes without touching the others.
  • Explicitly allowing Claude to answer I do not know when information is missing reduces invented responses, according to Anthropic's documentation on reducing hallucinations.
  • A safeguard line that is never written into the request protects no one, Claude then picks the most likely answer, even when it is wrong.
Do this now

Take a complex request you send regularly. Arrange its content in this order, who Claude should be, the context, the data to process, what is being asked, an example if possible, the expected output format, then add a final line that allows Claude to answer I do not know if information is missing. Send this reorganised version today and compare its response to the one obtained with the old version.

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.