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 46
4546
4647```json
4748{
48 "model": "claude-opus-5",
49 "model": "claude-opus-5-5",
4950 "max_tokens": 4096,
5051 "messages": [
5152 {
from line 92
9192 for turn, question in enumerate(QUESTIONS, start=1):
9293 history.append({"role": "user", "content": question})
9394 response = client.beta.messages.create(
94 model="claude-opus-5",
95 model="claude-opus-5-5",
9596 max_tokens=8192,
9697 system=SYSTEM,
9798 betas=["compact-2026-09-04"],
from line 108
107108 split = -2 * KEEP_TURNS
108109 older, recent = history[:split], history[split:]
109110 summary = client.beta.messages.create(
110 model="claude-opus-5",
111 model="claude-opus-5-5",
111112 max_tokens=4096,
112113 system=SYSTEM,
113114 betas=["compact-2026-09-04"],
from line 144
143144 const turn = index + 1;
144145 history.push({ role: "user", content: question });
145146 const response = await client.beta.messages.create({
146 model: "claude-opus-5",
147 model: "claude-opus-5-5",
147148 max_tokens: 8192,
148149 system: systemPrompt,
149150 betas: ["compact-2026-09-04"],
from line 159
158159 const older = history.slice(0, -2 * keepTurns);
159160 const recent = history.slice(-2 * keepTurns);
160161 const summary = await client.beta.messages.create({
161 model: "claude-opus-5",
162 model: "claude-opus-5-5",
162163 max_tokens: 4096,
163164 system: systemPrompt,
164165 betas: ["compact-2026-09-04"],
from line 205
204205 history.Add(new() { Role = Role.User, Content = question });
205206 var response = await client.Beta.Messages.Create(new MessageCreateParams
206207 {
207 Model = Model.ClaudeOpus5,
208 Model = Model.ClaudeOpus5_5,
208209 MaxTokens = 8192,
209210 System = SystemPrompt,
210211 Betas = [AnthropicBeta.Compact2026_09_04],
from line 226
225226 var recent = history[^(2 * KeepTurns)..];
226227 var summary = await client.Beta.Messages.Create(new MessageCreateParams
227228 {
228 Model = Model.ClaudeOpus5,
229 Model = Model.ClaudeOpus5_5,
229230 MaxTokens = 4096,
230231 System = SystemPrompt,
231232 Betas = [AnthropicBeta.Compact2026_09_04],
from line 275
274275 turn := i + 1
275276 history = append(history, anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock(question)))
276277 response, err := client.Beta.Messages.New(ctx, anthropic.BetaMessageNewParams{
277 Model: anthropic.ModelClaudeOpus5,
278 Model: anthropic.ModelClaudeOpus5_5,
278279 MaxTokens: 8192,
279280 System: system,
280281 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaCompact2026_09_04},
from line 293
292293 split := len(history) - 2*keepTurns
293294 older, recent := history[:split], history[split:]
294295 summary, err := client.Beta.Messages.New(ctx, anthropic.BetaMessageNewParams{
295 Model: anthropic.ModelClaudeOpus5,
296 Model: anthropic.ModelClaudeOpus5_5,
296297 MaxTokens: 4096,
297298 System: system,
298299 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaCompact2026_09_04},
from line 346
345346 .content(questions.get(turn - 1))
346347 .build());
347348 var params = MessageCreateParams.builder()
348 .model(Model.CLAUDE_OPUS_5)
349 .model(Model.CLAUDE_OPUS_5_5)
349350 .maxTokens(8192)
350351 .system(SYSTEM)
351352 .addBeta(AnthropicBeta.COMPACT_2026_09_04)
from line 361
360361 // A turn is one user message and one assistant reply, so the kept turns start with a user message.
361362 var older = history.subList(0, history.size() - 2 * KEEP_TURNS);
362363 var summaryParams = MessageCreateParams.builder()
363 .model(Model.CLAUDE_OPUS_5)
364 .model(Model.CLAUDE_OPUS_5_5)
364365 .maxTokens(4096)
365366 .system(SYSTEM)
366367 .addBeta(AnthropicBeta.COMPACT_2026_09_04)
from line 409
408409 $turn = $index + 1;
409410 $history[] = BetaMessageParam::with(role: Role::USER, content: $question);
410411 $response = $client->beta->messages->create(
411 model: Model::CLAUDE_OPUS_5,
412 model: Model::CLAUDE_OPUS_5_5,
412413 maxTokens: 8192,
413414 system: SYSTEM,
414415 betas: [AnthropicBeta::COMPACT_2026_09_04],
from line 424
423424 $older = array_slice($history, 0, -2 * KEEP_TURNS);
424425 $recent = array_slice($history, -2 * KEEP_TURNS);
425426 $summary = $client->beta->messages->create(
426 model: Model::CLAUDE_OPUS_5,
427 model: Model::CLAUDE_OPUS_5_5,
427428 maxTokens: 4096,
428429 system: SYSTEM,
429430 betas: [AnthropicBeta::COMPACT_2026_09_04],
from line 462
461462 questions.each.with_index(1) do |question, turn|
462463 history << { role: "user", content: question }
463464 response = client.beta.messages.create(
464 model: Anthropic::Model::CLAUDE_OPUS_5,
465 model: Anthropic::Model::CLAUDE_OPUS_5_5,
465466 max_tokens: 8192,
466467 system_: SYSTEM,
467468 betas: [Anthropic::AnthropicBeta::COMPACT_2026_09_04],
from line 476
475476 # A turn is one user message and one assistant reply, so the kept turns start with a user message.
476477 older, recent = history[...-2 * KEEP_TURNS], history.last(2 * KEEP_TURNS)
477478 summary = client.beta.messages.create(
478 model: Anthropic::Model::CLAUDE_OPUS_5,
479 model: Anthropic::Model::CLAUDE_OPUS_5_5,
479480 max_tokens: 4096,
480481 system_: SYSTEM,
481482 betas: [Anthropic::AnthropicBeta::COMPACT_2026_09_04],