Skip to content
Mastering Claude

Home / Writing a request that works

Writing a request that works7 minFondation

Formatting the output and speaking on Claude's behalf

Specifying the exact format expected, down to explicitly forbidding any opening sentence, removes unnecessary preambles and malformed output, whereas the historical technique of writing the very first character of Claude's response yourself is no longer available on current models.

A request that specifies nothing about the expected form leaves Claude to choose. The most common choice starts with an opening sentence, of course, here is, before reaching the result. Anthropic's documentation recommends saying directly what the response should contain rather than what it should not contain: instead of forbidding free-form output, specify that the response must consist solely of prose paragraphs, or solely of a table, or solely of a JSON block.

Speaking on Claude's behalf, then and now

An older practice, called prefilling, involved writing the start of Claude's message yourself, through programming, to force the first character of the response, an opening brace for JSON for instance. Checked on 2 September 2026 in Anthropic's documentation: this practice no longer works on Claude 4.6 models and later, the request fails with an error message on these models. Only models earlier than that generation still accept it. This technique belonged to API programming anyway, it had no visible equivalent for someone writing directly in Claude's conversation window.

What replaces the old move

The result being sought, a response that starts directly with the useful content, remains reachable another way: an instruction line that explicitly forbids any sentence before the result and that names the first element expected. For a table, specify respond with the table only, no sentence before it. For a data block reused afterwards in another programme, the documentation also recommends, in addition to this instruction, a feature called structured outputs, which forces the response to follow a precise data template; it is aimed at people who use Claude through programming rather than through conversation.

An example of a complete instruction

Liste les trois prochaines actions de l'association.
Réponds uniquement par une liste numérotée, un élément par ligne, sans phrase d'introduction ni de conclusion.

This same format requirement combines with the separation seen in separating data from instructions: the format instruction goes in the same block as the rest of the instructions, never mixed with the text to be processed.

Figure 1

A free-form response against a response in the imposed format

No format instruction
Bien sûr, voici les trois prochaines actions de l'association que je vous propose : premièrement, deuxièmement, troisièmement...
With a format instruction
1. Relancer le fournisseur de matériel.
2. Envoyer le compte rendu de la dernière réunion.
3. Fixer la date de l'assemblée générale.
The same request for a list of actions, once asked with no format instruction then once completed with an instruction that forbids any sentence before the result.
Calibrate it yourself

An association treasurer first asks Claude for the list of the last ten expenses in JSON format. He then adds, in a second request, a line that forbids any sentence before the result and requires the response to start directly with an opening brace. He sends this amended request and gets back a response that starts with an opening brace, followed by the ten expenses.

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

What to remember
  • Specifying the exact format wanted, down to forbidding an opening sentence, spares Claude from guessing a default layout.
  • Writing the start of Claude's response yourself through programming, the practice called prefilling, is no longer supported on current Claude models, only older models still accept it.
  • The recommended alternative for locking in a format, including for JSON reused afterwards, is an explicit format instruction, complemented on the programming side by the structured outputs feature.
  • A response that starts directly with the requested result can be checked at a glance, from the very first line, with no extra tool.
Do this now

Take a recent request where Claude answered with an opening sentence, such as of course or here is. Send it again, adding a line that explicitly forbids that sentence and specifies the exact format wanted, a table, a numbered list or a block of text for instance. Check that the new response starts directly with the result.

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.