The whole hunk
from line 11, old and new numbered
/
lines
from line 11
1111 - claude-fable-5
1212 - claude-mythos-5
1313 - claude-mythos-preview
14 - claude-opus-5-5
1415 - claude-opus-5
1516 - claude-opus-4-8
1617 - claude-opus-4-7
from line 51
5051 -H "anthropic-beta: compact-2026-09-04" \
5152 -H "content-type: application/json" \
5253 -d '{
53 "model": "claude-opus-5",
54 "model": "claude-opus-5-5",
5455 "max_tokens": 4096,
5556 "messages": [
5657 {"role": "user", "content": "I am building a recipe app. Help me name the main entities in the data model."},
from line 69
6869
6970 <File filename="request.yaml">
7071 ```yaml
71 model: claude-opus-5
72 model: claude-opus-5-5
7273 # max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
7374 max_tokens: 4096
7475 messages:
from line 103
102103 ]
103104
104105 response = client.beta.messages.create(
105 model="claude-opus-5",
106 model="claude-opus-5-5",
106107 # max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
107108 max_tokens=4096,
108109 betas=["compact-2026-09-04"],
from line 130
129130 ];
130131
131132 const response = await client.beta.messages.create({
132 model: "claude-opus-5",
133 model: "claude-opus-5-5",
133134 // max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
134135 max_tokens: 4096,
135136 betas: ["compact-2026-09-04"],
from line 164
163164
164165 var response = await client.Beta.Messages.Create(new MessageCreateParams
165166 {
166 Model = Model.ClaudeOpus5,
167 Model = Model.ClaudeOpus5_5,
167168 // max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
168169 MaxTokens = 4096,
169170 Betas = [AnthropicBeta.Compact2026_09_04],
from line 188
187188 }
188189
189190 response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
190 Model: anthropic.ModelClaudeOpus5,
191 Model: anthropic.ModelClaudeOpus5_5,
191192 // max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
192193 MaxTokens: 4096,
193194 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaCompact2026_09_04},
from line 212
211212 var client = AnthropicOkHttpClient.fromEnv();
212213
213214 var params = MessageCreateParams.builder()
214 .model(Model.CLAUDE_OPUS_5)
215 .model(Model.CLAUDE_OPUS_5_5)
215216 // max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
216217 .maxTokens(4096)
217218 .addBeta(AnthropicBeta.COMPACT_2026_09_04)
from line 248
247248 ];
248249
249250 $response = $client->beta->messages->create(
250 model: Model::CLAUDE_OPUS_5,
251 model: Model::CLAUDE_OPUS_5_5,
251252 // max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
252253 maxTokens: 4096,
253254 betas: [AnthropicBeta::COMPACT_2026_09_04],
from line 275
274275 ]
275276
276277 response = client.beta.messages.create(
277 model: Anthropic::Model::CLAUDE_OPUS_5,
278 model: Anthropic::Model::CLAUDE_OPUS_5_5,
278279 # max_tokens caps the whole call, including any thinking, so allow several thousand tokens.
279280 max_tokens: 4096,
280281 betas: [Anthropic::AnthropicBeta::COMPACT_2026_09_04],
from line 291
290291 "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
291292 "type": "message",
292293 "role": "assistant",
293 "model": "claude-opus-5",
294 "model": "claude-opus-5-5",
294295 "content": [
295296 {
296297 "type": "compaction",
from line 320
319320
320321```json
321322{
322 "model": "claude-opus-5",
323 "model": "claude-opus-5-5",
323324 "max_tokens": 2048,
324325 "messages": [
325326 {
from line 393
392393 for turn, question in enumerate(QUESTIONS, start=1):
393394 history.append({"role": "user", "content": question})
394395 response = client.beta.messages.create(
395 model="claude-opus-5",
396 model="claude-opus-5-5",
396397 max_tokens=8192,
397398 system=SYSTEM,
398399 betas=["compact-2026-09-04"],
from line 405
404405 conversation_tokens = response.usage.input_tokens + response.usage.output_tokens
405406 if conversation_tokens > COMPACT_AT_TOKENS and turn < len(QUESTIONS):
406407 summary = client.beta.messages.create(
407 model="claude-opus-5",
408 model="claude-opus-5-5",
408409 max_tokens=4096,
409410 system=SYSTEM,
410411 betas=["compact-2026-09-04"],
from line 440
439440 const turn = index + 1;
440441 history.push({ role: "user", content: question });
441442 const response = await client.beta.messages.create({
442 model: "claude-opus-5",
443 model: "claude-opus-5-5",
443444 max_tokens: 8192,
444445 system: systemPrompt,
445446 betas: ["compact-2026-09-04"],
from line 452
451452 const conversationTokens = response.usage.input_tokens + response.usage.output_tokens;
452453 if (conversationTokens > compactAtTokens && turn < questions.length) {
453454 const summary = await client.beta.messages.create({
454 model: "claude-opus-5",
455 model: "claude-opus-5-5",
455456 max_tokens: 4096,
456457 system: systemPrompt,
457458 betas: ["compact-2026-09-04"],
from line 497
496497 history.Add(new() { Role = Role.User, Content = question });
497498 var response = await client.Beta.Messages.Create(new MessageCreateParams
498499 {
499 Model = Model.ClaudeOpus5,
500 Model = Model.ClaudeOpus5_5,
500501 MaxTokens = 8192,
501502 System = SystemPrompt,
502503 Betas = [AnthropicBeta.Compact2026_09_04],
from line 515
514515 {
515516 var summary = await client.Beta.Messages.Create(new MessageCreateParams
516517 {
517 Model = Model.ClaudeOpus5,
518 Model = Model.ClaudeOpus5_5,
518519 MaxTokens = 4096,
519520 System = SystemPrompt,
520521 Betas = [AnthropicBeta.Compact2026_09_04],
from line 562
561562 turn := i + 1
562563 history = append(history, anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock(question)))
563564 response, err := client.Beta.Messages.New(ctx, anthropic.BetaMessageNewParams{
564 Model: anthropic.ModelClaudeOpus5,
565 Model: anthropic.ModelClaudeOpus5_5,
565566 MaxTokens: 8192,
566567 System: system,
567568 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaCompact2026_09_04},
from line 577
576577 conversationTokens := response.Usage.InputTokens + response.Usage.OutputTokens
577578 if conversationTokens > compactAtTokens && turn < len(questions) {
578579 summary, err := client.Beta.Messages.New(ctx, anthropic.BetaMessageNewParams{
579 Model: anthropic.ModelClaudeOpus5,
580 Model: anthropic.ModelClaudeOpus5_5,
580581 MaxTokens: 4096,
581582 System: system,
582583 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaCompact2026_09_04},
from line 629
628629 .content(questions.get(turn - 1))
629630 .build());
630631 var params = MessageCreateParams.builder()
631 .model(Model.CLAUDE_OPUS_5)
632 .model(Model.CLAUDE_OPUS_5_5)
632633 .maxTokens(8192)
633634 .system(SYSTEM)
634635 .addBeta(AnthropicBeta.COMPACT_2026_09_04)
from line 642
641642 long conversationTokens = response.usage().inputTokens() + response.usage().outputTokens();
642643 if (conversationTokens > COMPACT_AT_TOKENS && turn < questions.size()) {
643644 var summaryParams = MessageCreateParams.builder()
644 .model(Model.CLAUDE_OPUS_5)
645 .model(Model.CLAUDE_OPUS_5_5)
645646 .maxTokens(4096)
646647 .system(SYSTEM)
647648 .addBeta(AnthropicBeta.COMPACT_2026_09_04)
from line 689
688689 $turn = $index + 1;
689690 $history[] = BetaMessageParam::with(role: Role::USER, content: $question);
690691 $response = $client->beta->messages->create(
691 model: Model::CLAUDE_OPUS_5,
692 model: Model::CLAUDE_OPUS_5_5,
692693 maxTokens: 8192,
693694 system: SYSTEM,
694695 betas: [AnthropicBeta::COMPACT_2026_09_04],
from line 701
700701 $conversationTokens = $response->usage->inputTokens + $response->usage->outputTokens;
701702 if ($conversationTokens > COMPACT_AT_TOKENS && $turn < count($questions)) {
702703 $summary = $client->beta->messages->create(
703 model: Model::CLAUDE_OPUS_5,
704 model: Model::CLAUDE_OPUS_5_5,
704705 maxTokens: 4096,
705706 system: SYSTEM,
706707 betas: [AnthropicBeta::COMPACT_2026_09_04],
from line 738
737738 questions.each.with_index(1) do |question, turn|
738739 history << { role: "user", content: question }
739740 response = client.beta.messages.create(
740 model: Anthropic::Model::CLAUDE_OPUS_5,
741 model: Anthropic::Model::CLAUDE_OPUS_5_5,
741742 max_tokens: 8192,
742743 system_: SYSTEM,
743744 betas: [Anthropic::AnthropicBeta::COMPACT_2026_09_04],
from line 750
749750 conversation_tokens = response.usage.input_tokens + response.usage.output_tokens
750751 if conversation_tokens > COMPACT_AT_TOKENS && turn < questions.length
751752 summary = client.beta.messages.create(
752 model: Anthropic::Model::CLAUDE_OPUS_5,
753 model: Anthropic::Model::CLAUDE_OPUS_5_5,
753754 max_tokens: 4096,
754755 system_: SYSTEM,
755756 betas: [Anthropic::AnthropicBeta::COMPACT_2026_09_04],