Home / Writing a request that works
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.
A free-form response against a response in the imposed format
Bien sûr, voici les trois prochaines actions de l'association que je vous propose : premièrement, deuxièmement, troisièmement...
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.
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 this establishes: On this request, the instruction that forbids any sentence before the result and imposes the first character was enough to produce a response that starts directly with the expected opening brace.
What this does not establish: This does not establish that the same instruction will always produce a valid JSON response over the whole of its content, the validity of the block beyond the first character still needing separate checking.
The three most common miscalibrations
- Too broad This instruction now guarantees that any Claude response will start with the requested format, whatever the length or complexity of the request.
- Too narrow This result proves nothing, since the request only concerned ten expenses, too small a number to draw a conclusion.
- Off target This result shows that the ten expenses had been correctly recorded in the accounts before the request.
- 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.
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.
Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.
- Prompting best practices consultée le 2026-09-02
- Using the Messages API consultée le 2026-09-02