Claude Tips mascot
Claude Tips & Tricks
Prompt Engineering intermediate

Place Long Documents Above Your Instructions

Put reference documents at the top of your prompt and your question at the bottom. This can improve response quality by up to 30%.

When working with large documents or multiple sources, the order of your prompt matters. Anthropic’s testing shows that placing your query at the end of the prompt, after the reference material, can improve response quality by up to 30%, especially with complex, multi-document inputs.

Structure your prompts like this:

<documents>
<document id="1">
{Full text of document 1}
</document>

<document id="2">
{Full text of document 2}
</document>
</documents>

<instructions>
Based on the documents above, summarize the key differences
in their approach to error handling.
</instructions>

Why: Claude processes tokens sequentially. When the reference material comes first, Claude has already “seen” all the relevant context by the time it reaches your question. Ask the question first with documents below, and performance drops because Claude has to hold the question in memory while processing everything else.

Avoid this anti-pattern:

Question: What are the key findings?

Here is the paper: {10,000 words of text}

This is the opposite of what you want.

Paste into Claude Code
I'm going to give you a long document. Read it first, then I'll ask questions. Structure your analysis with the document content first, then my specific queries at the end.