Skip to main content

Why Does Claude Miss the Point on Long Documents? 3 Official Long-Context Prompting Techniques

Ever pasted a long contract or report into Claude and gotten an answer that missed the point? Here's what the official guidance says about document placement, structuring multiple files, and quote-grounding.

🌐 This article was machine-translated and may contain inaccuracies. Read the Korean original if in doubt.

Have you ever pasted a long contract, meeting transcript, or report into Claude, asked a question, and gotten back an answer that missed the important part? The official documentation recommends changing how you structure the prompt itself — the input text you send to Claude — to reduce this problem. Three techniques matter most: where you place the document, how you separate multiple documents, and what you ask Claude to do before it answers.

🟢 Model references match the current lineup · model notice · Fable subscription
🟢 Model references match the current lineup · Claude Opus 5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.

Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (

🟢 Model references match the current lineup · Claude Opus 5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
0/M input, $50/M output tokens). The one-time
🟢 Model references match the current lineup · Claude Opus 5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
00 credit applied only to the Fable 5 transition and is not offered for 5.1. Some coding and debugging requests may be answered by an Opus model due to a security classifier (both models). See the Fable 5.1 guide and the Fable 5 availability guide for details.

Bad structure ① Question ② Full document Risk of lower accuracy Good structure ① Full document ② Question Improved accuracy

Why does placing the document first improve accuracy?

The official documentation recommends placing the document text before your question or instructions in the prompt — the full input text you send to Claude. For example, instead of writing "Review this contract and summarize the penalty clause" followed by the full contract text, it's better to paste the full contract text first and put the question — "Review the contract above and summarize the penalty clause" — at the very end. This ordering matters more as documents get longer, such as multi-page reports or several meeting transcripts combined. This relates to long context — the large amount of input text Claude can read and reference in a single request. Some current Claude models support context windows of up to 1 million tokens — token being the small unit of text Claude processes text in — meaning a document the length of a book can fit in a single request. But being able to fit a document isn't the same as answering accurately about it, which is why basic habits like ordering still matter.

How should I separate multiple documents in one prompt?

When you have two or more documents, the recommendation is to wrap each one in XML tags — markup that uses angle brackets (< >) to mark where a piece of content starts, ends, and what kind of content it is. If you paste a contract and an internal review memo side by side with no separation, Claude can lose track of which sentence came from which document. Labeling each document with an index number and a source tag makes it much easier for Claude to keep straight which content came from where when it answers.

1. Paste documents (at the top) 2. Ask for relevant quotes first 3. Quote-grounded answer

How do I stop the answer from drifting away from the document?

Instead of asking for the answer directly, ask Claude to first quote the relevant sentences from the document verbatim. For example: "Before answering, first pull out the exact sentences in the document that relate to this question, then base your answer on those quotes." The official documentation explains that this helps Claude cut through irrelevant content — noise — in long, complex documents and focus on the parts that actually matter. As a side benefit, it also makes it easier for a human reviewer to check whether a quote actually appears in the source document, which makes verifying the answer much simpler.

A working prompt template

Here's an example that applies all three techniques together: document first, multiple documents separated with XML tags, and a request for quotes before the answer. To use it, replace the placeholder text with your actual document content and question.

<documents>
  <document index="1">
    <source>contract_2026.pdf</source>
    <document_content>
      (paste the full text of the first document here)
    </document_content>
  </document>
  <document index="2">
    <source>internal_review_notes.docx</source>
    <document_content>
      (paste the full text of the second document here)
    </document_content>
  </document>
</documents>

Compare the contract and the review notes above and check whether
there's any conflict related to Section 3 (the penalty clause).
Before answering, quote the relevant sentences from each document verbatim,
then base your answer on those quotes.

Note that using this structure doesn't guarantee Claude won't say something not actually in the document — you should still always check. Adding the quote-first step makes this checking much easier, but comparing the quotes against the source text remains a habit worth keeping.

Bad structure vs. good structure, side by side

AspectCommon bad structureRecommended structure
Document placementQuestion first, document pasted afterFull document first, question at the very end
Multiple documentsDocuments pasted side by side with no separationEach document wrapped in XML tags with index and source
Answer verificationAsk directly for a summary or answerAsk for relevant quotes first, then the answer

Frequently asked questions

Q. Do I really need to put the document before the question?
Yes, placing the document text before your question or instructions is the recommended order. The official documentation notes that this ordering can affect answer accuracy, especially as documents get longer.

Q. Do I need XML tags even for a single document?
Not necessarily for one document, but once you have two or more, wrapping each in tags is recommended so Claude doesn't confuse which content came from which document.

Q. What if the answer still doesn't match the document?
Ask Claude to quote the relevant sentences from the document verbatim before answering. This helps Claude filter out irrelevant content, and it lets you check the quotes against the source text to verify the answer.

Q. Does this only apply to the developer API, or can I use it in Claude.ai chat too?
The official documentation is written with a development context in mind, but the underlying habits — document first, question last, and requesting quotes before an answer — apply just as well when pasting long documents into a Claude.ai conversation.

If you regularly work with long documents, trying even one of these three techniques — document-first ordering, XML structuring, or quote-first requests — can noticeably improve answer quality. For tasks that compare or cross-reference multiple documents, combining XML structuring with quote requests is especially worth it.

Was this helpful?

Keep reading