Create the full URL from the GitHub repository changedabout-claude/use-case-guides/legal-summarization
Nearest release: v2.1.294, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+36added
Lines−20removed
From line
89
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits3to this page, all time
The whole hunk
from line 89, old and new numbered
/
from line 89
8989
9090### Select the right Claude model
9191
92Model accuracy is extremely important when summarizing legal documents. Claude Opus 5 is an excellent choice for use cases such as this where high accuracy is required. If the size and quantity of your documents is large such that costs start to become a concern, you can also try using a smaller model such as Claude Haiku 4.5.
92Model accuracy is extremely important when summarizing legal documents. Claude Opus 5 is an excellent choice for use cases such as this where high accuracy is required. If the size and quantity of your documents is large such that costs start to become a concern, you can also try using a smaller model such as Claude Haiku 5.5.
9393
9494To help estimate these costs, the following is a comparison of the cost to summarize 1,000 sublease agreements using Opus and Haiku models:
9595
from line 101
101101
102102* **Estimated tokens**
103103
104 * Input tokens: 86M (assuming 1 token per 3.5 characters)
105 * Output tokens per summary: 350
106 * Total output tokens: 350,000
104 * Input tokens: 108M, about 108,000 per agreement (about 1 token per 2.8 characters, the rate all three models showed on this guide's sample agreement)
105 * Output tokens per summary, including any thinking tokens, which are billed as output: about 4,800 on Claude Opus 5, 2,000 on Claude Opus 4.8, and 3,100 on Claude Haiku 5.5
106 * Total output tokens: 4.8M on Claude Opus 5, 2.0M on Claude Opus 4.8, and 3.1M on Claude Haiku 5.5
107107
108108* **Claude Opus 5 estimated cost**
109109
110 * Input token cost: 86 MTok \* $5.00/MTok = $430.00 USD
111 * Output token cost: 0.35 MTok \* $25.00/MTok = $8.75 USD
112 * Total cost: $430.00 + $8.75 = $438.75 USD
110 * Input token cost: 108 MTok \* $5.00/MTok = $540.00 USD
111 * Output token cost: 4.8 MTok \* $25.00/MTok = $120.00 USD
112 * Total cost: $540.00 + $120.00 = $660.00 USD
113113
114114* **Claude Opus 4.8 estimated cost**
115115
116 * Input token cost: 86 MTok \* $5.00/MTok = $430.00 USD
117 * Output token cost: 0.35 MTok \* $25.00/MTok = $8.75 USD
118 * Total cost: $430.00 + $8.75 = $438.75 USD
116 * Input token cost: 108 MTok \* $5.00/MTok = $540.00 USD
117 * Output token cost: 2.0 MTok \* $25.00/MTok = $50.00 USD
118 * Total cost: $540.00 + $50.00 = $590.00 USD
119119
120* **Claude Haiku 4.5 estimated cost**
120* **Claude Haiku 5.5 estimated cost**, at its prices for prompts over 100,000 tokens
121121
122 * Input token cost: 86 MTok \* $1.00/MTok = $86.00 USD
123 * Output token cost: 0.35 MTok \* $5.00/MTok = $1.75 USD
124 * Total cost: $86.00 + $1.75 = $87.75 USD
122 * Input token cost: 108 MTok \* $0.50/MTok = $54.00 USD
123 * Output token cost: 3.1 MTok \* $2.50/MTok = $7.75 USD
124 * Total cost: $54.00 + $7.75 = $61.75 USD
125125
126126<Tip>
127 Actual costs may differ from these estimates. These estimates are based on the example highlighted in the
127 Actual costs may differ from these estimates. The token counts come from running the example in the
128128
129129 [Build a strong prompt](https://platform.claude.com/docs/en/about-claude/use-case-guides/legal-summarization#build-a-strong-prompt)
130130
131 section.
131 section on this guide's sample agreement, about 105,000 input tokens, and output length varies with the document and from run to run. Each agreement here is one prompt of about 108,000 tokens, over the 100,000-token threshold of Claude Haiku 5.5's
132
133 [long-prompt prices](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing)
134
135 . A document whose prompt stays at or under 100,000 tokens pays $0.10/MTok input and $0.50/MTok output instead. To see which prices apply, count your documents with
136
137 [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting)
138
139 and
140
141 `model`
142
143 set to
144
145 `claude-haiku-5-5`
146
147 .
132148</Tip>
133149
134150### Transform documents into a format that Claude can process
from line 204
188204
189205
190206def summarize_document(
191 text, details_to_extract, model="claude-opus-5-5", max_tokens=1000
207 text, details_to_extract, model="claude-opus-5-5", max_tokens=16000
192208):
193209 # Format the details to extract to be placed within the prompt's context
194210 details_to_extract_str = "\n".join(details_to_extract)
from line 311
295311
296312
297313def summarize_long_document(
298 text, details_to_extract, model="claude-opus-5-5", max_tokens=1000
314 text, details_to_extract, model="claude-opus-5-5", max_tokens=16000
299315):
300316 # Format the details to extract to be placed within the prompt's context
301317 details_to_extract_str = "\n".join(details_to_extract)
No line in this hunk matches that.