A good summarization prompt makes three decisions explicit before Claude ever sees a document: whether the summary should quote the source or rewrite it, whether the output format is fixed or flexible, and how long the result should be. Leave any of those to chance and you get summaries that are individually fine but inconsistent across a thousand documents — which is exactly what business users notice.
Extractive vs. abstractive: decide which one you actually want
An extractive summary pulls key sentences and figures out of the document, staying close to the original wording. An abstractive summary rewrites the content in fresh language at a higher altitude. Legal and compliance reviewers usually want extractive ("show me exactly what the contract says"); executives usually want abstractive ("tell me what it means").
Say which one you want, and say why. Anthropic's prompting guidance is to explain the reason behind an instruction — for example, "quote the exact clause text, because reviewers must verify each point against the original" — so Claude can generalize correctly to cases you didn't anticipate.
For extractive work where traceability matters, consider the citations feature instead of prompting for quotes: enable "citations": {"enabled": true} on the document block and Claude returns cited passages in a structured cited_text field. Per Anthropic's docs, cited text does not count toward your output tokens, which makes it more efficient than asking for long verbatim quotes in prose.
Fixed vs. guided formats
A fixed format nails down every section: "Return exactly three sections titled Overview, Key Risks, and Recommended Actions." Use it when summaries feed a downstream system, a template, or a side-by-side comparison. A guided format sets guardrails but lets structure follow the content: "Organize by theme; use headings only if the document covers more than one topic." Use it for heterogeneous inputs — a one-page memo and a 90-page report should not be forced into identical scaffolding.
Either way, structure the prompt itself. The official guidance recommends wrapping instructions, context, and input in consistent, descriptive XML tags, and providing 3–5 relevant, diverse examples inside <example> tags when the format matters. One worked example of a finished summary buys more consistency than a paragraph of format rules.
Put the document first, the ask last
For long inputs (roughly 20k tokens and up), Anthropic's long-context guidance is unambiguous: place the document at the top of the prompt and your instructions and question at the end. Putting the query after the content can improve response quality by up to 30% in Anthropic's testing. Wrap multiple documents in <document> tags with <document_content> and <source> subtags so Claude can attribute what came from where. The same ordering logic applies to PDFs — the docs recommend placing them before your text.
from anthropic import AnthropicVertex
client = AnthropicVertex(project_id="my-project", region="global")
prompt = f"""<document>{report_text}</document>
Summarize for a non-technical executive. Exactly 3 bullets,
each under 25 words. Abstractive: do not quote verbatim."""
msg = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
print(msg.content[0].text)
Length calibration
Calibrate length in the prompt, in units humans use: "three bullets, each under 25 words," "one paragraph of at most 120 words," "a half-page brief." Do not rely on max_tokens to shape length — it is a hard cutoff, not a target, and a summary truncated mid-sentence is worse than a long one. Set max_tokens comfortably above your expected output and enforce length editorially in the prompt.
One more calibration lever: match length to document density, not page count. A dense contract may need a longer summary than a padded slide deck. If your inputs vary widely, give a rule ("scale to one bullet per major section, minimum three, maximum eight") rather than a single fixed number.
Where to go next
For very large inputs, see long-document handling and where you put context changes the answer. To lock output shape completely, read output format control, and for quote-level traceability, citations and sourcing.