Manuscript Offprint
arXiv:2610.31710Compact-Bench: Measuring What Context Compaction Costs Long-Horizon Coding Agents
Abstract
Context compaction lets long-horizon coding agents continue beyond their context windows, but can erase the state needed to finish a task. Prior evaluations measure efficiency, retained information, or end-to-end success, leaving the effect of a specific history replacement difficult to isolate. Compact-Bench pairs full-history and summary-only continuations from a shared repository state, and evaluates recurring details and successive production compactions. It covers 35 SWE-bench repairs, 146 agentic sessions, and 106 production chains. Across 14 summarizer backbones, stable damage ranges from 5 – 64% of 22 full-history successes: Claude Opus 4.8 preserves the most repairs, while DeepSeek-Flash damages the most. With Kimi-K3 as summarizer, the Kimi Code prompt preserves the most task continuations (19/22), whereas Claude Code retains the most recurring details (15.0%). LLM summaries retain at most 16.0% of recurring details, compared with 79.1% for mechanical extraction; production summaries retain 15.7% at the first boundary. Failures recur across methods: one repair is damaged by 13/14 backbones, and another by all 5 prompts. These results show that reliable compaction requires preserving the progress needed to complete a task, and that retaining relevant information alone does not ensure successful continuation. Code and data are available online.
1 Introduction
Long-horizon coding agents accumulate instructions, tool observations, test results, and partial decisions. Compaction allows them to work beyond the context window, but the resulting summary must carry enough state to resume unfinished work. Long-context benchmarks test retrieval, reasoning, and generation from extended inputs (Bai et al., 2024; Zhang et al., 2024; Hsieh et al., 2024; Shaham et al., 2023; An et al., 2024; Lee et al., 2025; Bai et al., 2025; Kuratov et al., 2024; Liu et al., 2024b), and information access can depend on input position (Liu et al., 2024a). Agent histories add a further requirement: preserving which actions have been taken, which hypotheses have been rejected, and what remains to be done.
End-to-end benchmarks evaluate repository repair, code generation, and interactive tool use (Jimenez et al., 2024; Yang et al., 2024; Wang et al., 2025; Xia et al., 2025; Jain et al., 2025; Liu et al., 2024c; Yao et al., 2025; Zhou et al., 2024; Xie et al., 2024). A final score, however, does not isolate the effect of replacing a history midway through a task. Recent compaction evaluations examine constraint loss, archived-fact retrieval, future-trajectory support, and execution instability; methods also learn or schedule summarization and remove observations (Wang et al., 2026; Subramani, 2026; Chen et al., 2026; Min et al., 2026; Li et al., 2026a; Wu et al., 2025b; Sun et al., 2026; Li et al., 2026b; Cim et al., 2026; Lindenbauer et al., 2025). Compact-Bench targets the history replacement itself: it compares full-history and summary-only continuation at a shared boundary, then examines detail retention in real agent sessions.
The benchmark asks: For the same task and pre-compaction state, how does continuation change when an agent receives only a summary instead of its full history? Task Preservation compares full-history and summary-only continuations from the same repository snapshot, using the same agent, step budget, and executable tests. Recurring-Detail Retention measures preservation of structured details that recur in later requests across 146 sessions (143 real and 3 simulator-synthesized). Production-Chain Retention follows these details across successive compactions in 106 real sessions. Together, the three evaluations connect controlled task outcomes with information retention in deployed workflows.
Across 14 summarizer backbones, stable Task Preservation damage ranges from 5 – 64% of the
22 validated full-history successes, with Claude Opus 4.8 preserving the most repairs. Of 126 instance-backbone pairs damaged in the first round, 120 meet the three-run confirmation criterion. Task preservation and detail retention also distinguish different configurations: Kimi Code gives the most passing continuations (19/22), whereas Claude Code retains the most recurring details (15.0%). Paired traces reveal a shared failure pattern: summaries can retain the target file and relevant strings while losing the progress needed to finish a repair. Overall, our contributions are:
• We introduce Compact-Bench, a benchmark for evaluating whether context compaction preserves a coding agent’s ability to resume work. It combines controlled task continuations with recurring-detail and production-chain measurements.
• We compare 14 summarizer backbones and 5 production prompts. Stable task damage ranges from 5 – 64% among 22 full-history successes, with Claude Opus 4.8 preserving the most repairs. With Kimi-K3 as summarizer, Kimi Code preserves the most task continuations (19/22), while Claude Code retains the most recurring details (15.0%).
• We show that retained repair evidence does not guarantee successful continuation. Paired traces reveal failures even when summaries preserve target files and relevant code strings. Together with the different task-preservation and detail-retention leaders, this finding motivates evaluating compaction through both retained information and agent behavior.
Methods for agent histories and persistent memory. ReSum summarizes search trajectories; Context-Folding condenses completed subtasks; CompactionRL trains execution and summarization jointly; SelfCompact lets the agent choose when to compact; and parallel compaction summarizes separate blocks (Wu et al., 2025b; Sun et al., 2026; Li et al., 2026b,a; Cim et al., 2026). Persistent-memory methods maintain or retrieve information outside the active history, including MemoryBank, A-Mem, MemGPT, and retrieval-augmented generation (Zhong et al., 2024; Xu et al., 2025; Packer et al., 2023; Lewis et al., 2020). LongMemEval, LoCoMo, and Beyond Prompts evaluate memory over extended or interleaved dialogue (Wu et al., 2025a; Maharana et al., 2024; Castillo-Bolado et al., 2024). Our recurring-detail and production-chain tracks assess structured information that reappears after compaction in coding-agent workflows.
Prompt compression and summary evaluation. Prompt compression reduces input length through token selection (Selective Context, LLMLingua), question-aware selection (LongLLMLingua), distilled selection (LLMLingua-2), soft representations (Gist tokens, ICAE), and offline compression with adaptation (LLoCO) (Li et al., 2023; Jiang et al., 2023, 2024; Pan et al., 2024; Mu et al., 2023; Ge et al., 2024; Tan et al., 2024). RECOMP compresses retrieved passages; a survey organizes the broader method families (Xu et al., 2024; Li et al., 2025). Summary evaluation measures factual consistency and answerability, including Kryscinski et al., FEQA, and QuestEval; G-Eval uses LLM judgments for broader generation quality (Kryscinski et al., 2020; Durmus et al., 2020; Scialom et al., 2021; Liu et al., 2023). Compact-Bench extends the evaluation target to resuming agent work, combining executable outcomes with deterministic matching of recurring details.
3 Compact-Bench
3.1 Evaluation Dimensions
Let H denote the serialized agent history immediately before a compaction boundary. The compaction method under test, denoted by C, includes the summarizer and prompt together with the fixed serialization and truncation procedure described in Appendix G; applying it to H produces summary . A compaction boundary is the point at which this replacement occurs. In Task Preservation, PRE continues with the full history

Figure 1: Paired Task Preservation replay. (a) Phase A fixes history H and repository snapshot D. (b) PRE receives H directly; only POST receives the summary . Each run restores D and uses matched agent, tool, environment, and step-budget conditions. (c) Repository FAIL_TO_PASS tests classify the paired outcomes; rows denote PRE and columns denote POST.
H, whereas POST continues with only S. Both conditions start from the same repository working-tree snapshot, denoted by D in Figure 1.
Task Preservation tests whether continuation from S completes repairs that also succeed from H. For each repair, Phase A caches a history after at most 10 steps and shares it across tested methods and seeds. PRE and POST then continue from the same snapshot D, using the same agent, tools, environment, and eight-step limit; the repository's FAIL_TO_PASS tests judge both outcomes. An instance-method pair is preserved when both continuations pass, damaged when PRE passes and POST fails, a rescue when PRE fails and POST passes, and unsolved when both fail. The paired labels preserve the direction of each change: damage identifies a lost full-history success, while rescue identifies a success reached from the summary after full-history failure. Reporting these separately prevents improvements on some repairs from cancelling losses on others in an aggregate success rate. First-round damage and rescue cases receive two additional seeds. A backbone case counts as stable damage when POST fails in at least two of its three runs; the prompt comparison uses one run per case. Appendix B reports the repeatability results.
Recurring-Detail Retention measures literal preservation of structured values that occur both before an artificial boundary in a never-compacted session and in the next 3 to 8 request payloads. Future payloads include retransmitted history, so recurrence denotes continued presence in the interaction. Production-Chain Retention scores details found in the next at most 5 request payloads after each real compaction boundary, without requiring a match in the pre-boundary history. It also records whether a summary describes a completed file write as pending work. The two retention tracks use different boundaries for complementary purposes. Artificial boundaries allow the same recorded history to be summarized by multiple methods and scored against a common reference set. Production boundaries expose the summaries emitted during ongoing work, including successive replacements within one session. Task Preservation adds the execution outcome, so the benchmark reports both what remains in a summary and what the continuation accomplishes from it.
3.2 Data and Construction
Task Preservation sample. The task set contains 35 localized SWE-bench repairs from 7 repositories: pytest (18), sympy (6), xarray (3), pylint (3), requests (2), sphinx (2), and flask (1). Selection favors fixes confined to one test file, few FAIL_TO_PASS tests, and a median gold patch below 1 KB. This concentrates evaluation on whether a continuation can turn the accumulated state into a specific repair. Each instance has a repository-specific environment recipe: Python 3.9 supports older repositories, while dependency constraints include numpy<2 for xarray, era-matched sphinxcontrib-* packages for sphinx, and py for pylint. Inclusion requires the base repository to fail the FAIL_TO_PASS tests and the gold patch to pass them. Appendix E provides instance-level tests and environment details.
Recurring-Detail Retention sample. This track uses 146 sessions from coding-agent harness trajectory: 73 Kimi Code, 50 Claude Code, 14 open-
| Evaluation | Size | Composition |
| Task Preservation | 35 instances | Localized SWE-bench repairs from 7 repositories: pytest (18), sympy (6), xarray (3), pylint (3), requests (2), sphinx (2), and flask (1). |
| Recurring-Detail Retention | 146 sessions | 143 real and 3 simulator-synthesized sessions; clients: Kimi Code (73), Claude Code (50), opencode (14), and other clients (9); 9,330 recurring details. |
| Production-Chain Retention | 106 sessions | 224 production compaction boundaries; median 2 and maximum 4 boundaries per session. |
Table 1: Datasets for the three Compact-Bench evaluations.
code, and 9 other clients, including 3 simulator-synthesized sessions. A candidate must have no detected compaction marker, at least 8 requests, a maximum recorded request-token count of at least 60,000, and a completeness score of at least 0.8. Completeness is the fraction of eligible adjacent request pairs that pass the history-prefix and cache-continuity checks in Appendix L. If a session has requests, where is the request count, the artificial boundary is placed at zero-based request index (rounding down); at least 3 requests must follow it, and at most 8 are included in the future window. Client quotas and ordering are in the supplementary configuration record. We exclude sessions with fewer than three matching details across the pre-boundary history and future payloads. The final set has 9,330 recurring details: paths, commit SHAs, pull-request identifiers, error types, URLs, key-value pairs, and IP addresses.
Production-Chain Retention sample. This track uses 106 sessions from the same corpus, each with at least two confirmed production compactions. They contain 224 boundaries: 106 first, 106 second, 10 third, and 2 fourth boundaries. At least one future detail can be evaluated at 140 boundaries (106, 27, 6, and 1 at the respective boundary positions); only these enter detail-retention scores.
Reference prompts. The prompt comparison uses 5 production compaction prompts from coding-agent harnesses: Claude Code, Codex, Gemini CLI, opencode, and Kimi Code. They serve as reference methods in Task Preservation and Recurring-Detail Retention. Production-Chain Retention evaluates the summaries generated by the live systems in the recorded sessions.
3.3 Scoring
Task Preservation. The damage rate is the fraction of PRE-pass cases that fail after compaction; the preservation rate is one minus this rate. Conditioning on full-history success identifies repairs that the continuation can complete before history replacement. The backbone comparison uses 22 validated PRE-pass cases among 24 evaluated cases; two are excluded because PRE failed in three rerun. We report preserved, damaged, rescued, and unsolved outcomes separately, using single-run results for the prompt comparison. For backbone cases selected for verification, stable damage requires POST failure in at least two of three runs.
Recurring-Detail Retention score. For any text (a history or request payload), let be the deterministic extractor that returns distinct (type, value) pairs for paths, commit SHAs, pull-request or issue identifiers, error types, URLs, key-value pairs, and IP addresses. For session , let be the pre-boundary history, the concatenation of the next three to eight request payloads (including retransmitted history), and the tested summary. The reference set contains details extracted from both texts. A pair matches if its literal value occurs as a case-sensitive substring in . The per-session score is
where denotes the number of elements in a set. Matching does not require a token boundary or the same type label in the summary. We report the unweighted mean of these session scores for each method; empty reference sets are excluded, and construction requires at least three reference details per session. Appendix L gives the extraction, normalization, and window rules.
Production-Chain Retention score. For session i and its kth compaction boundary, let be the next at most five request payloads, the production summary, and the extracted future details. Here i indexes sessions and k is the boundary's position within a session. Unlike the recurring-detail reference set, does not require an intersection with pre-boundary history. As above, a detail pair matches when its value occurs as a case-sensitive substring in . The score for a boundary is
We average these scores separately for first, second, and later boundaries, using only boundaries with at least one extracted future detail. We also report the mean last-to-first ratio within sessions where both boundaries have scores and the first-boundary score is nonzero: 22 sessions meet the two-boundary criterion and 20 remain after excluding zero first-boundary scores. For state-time disorder, the detector flags a boundary if a basename matched by the successful-write patterns in pre-boundary history as created or modified appears in the production summary within 150 characters of a pending-work phrase. We report this flag rate by boundary position over all boundaries, including those without extractable future details. Appendix L specifies the matching patterns and window.
3.4 Evaluation Validation
We check three properties before scoring: solvability (the gold patch passes in the supplied environment), discriminability (the base repository fails the FAIL_TO_PASS tests), and protocol validity (the agent and test judge use the same interpreter, and agent tests run against the live working tree).
Controlled replay. The agent and judge use the same per-instance interpreter, with PATH and PYTHONPATH pointing to the evaluation environment and live working tree. Phase A, PRE, and POST execute in the same directory, and the cached working-tree snapshot is restored before each continuation. This preserves the meaning of paths appearing in the history or summary and places both outcomes under the same conditions. Appendix D reports validation experiments for these controls.
Deterministic endpoints. Task outcomes use repository tests, and retention scores use deterministic extraction and string matching. Reference values are identified from recorded histories and future requests before comparing summaries. These endpoints provide instance-level evidence: a changed test verdict identifies task damage, while a missing literal value identifies detail loss. Auxiliary human validation of decision and progress labels is documented separately in Appendix D; these labels do not enter the reported retention scores.
| Summarizer | Round 1 | Stable | 95% CI |
|---|---|---|---|
| Claude Opus 4.8 | 5% (1) | 5% (1) | 1 – 22 |
| Kimi-K3 | 18% (4) | 18% (4) | 7 – 39 |
| GPT-5.6-Luna | 18% (4) | 18% (4) | 7 – 39 |
| GPT-5.6-Sol | 27% (6) | 27% (6) | 13 – 48 |
| Claude Fable 5 | 41% (9) | 36% (8) | 20 – 57 |
| Claude Fable 5.1 | 36% (8) | 36% (8) | 20 – 57 |
| GPT-6-Astra | 50% (11) | 41% (9) | 23 – 61 |
| Qwen3.8-Max | 50% (11) | 45% (10) | 27 – 65 |
| GPT-5.6-Terra | 45% (10) | 45% (10) | 27 – 65 |
| Claude Opus 5.5 | 45% (10) | 45% (10) | 27 – 65 |
| GLM-5.3 | 55% (12) | 50% (11) | 31 – 69 |
| DeepSeek-V4-Pro | 55% (12) | 55% (12) | 35 – 73 |
| Hy4-Preview | 64% (14) | 59% (13) | 39 – 77 |
| DeepSeek-Flash | 64% (14) | 64% (14) | 43 – 80 |
Table 2: Task Preservation damage under the Claude Code prompt and Kimi-K3 continuation agent. Entries give the rounded percentage and count among 22 validated PRE-pass cases. Stable damage requires POST failure in at least two of three runs; intervals are Wilson 95% confidence intervals for that rate.
4 Results
4.1 Evaluation Setup
The fourteen-backbone Task Preservation comparison fixes the Claude Code prompt and Kimi-K3 continuation agent; every method receives the same cached Phase-A history and repository snapshot. The prompt comparison fixes Kimi-K3 as summarizer and varies the five production prompts. Recurring-Detail Retention evaluates seven backbones with all five prompts, while Production-Chain Retention scores recorded summaries at live compaction boundaries. Damage rates use the 22 validated PRE-pass repairs. In the backbone study, first-round damage or rescue receives two additional runs (K=3); both PRE and POST are rerun for Kimi-K3, while other backbones reuse PRE. Prompt comparisons use one run per case. Appendix G specifies budgets, decoding settings, endpoints, and so on.
4.2 Task Preservation Results
Backbone comparison. Table 2 reports stable damage under the fixed Claude Code prompt. Claude Opus 4.8 preserves 21 of the 22 validated repairs, followed by Kimi-K3 and GPT-5.6-Luna with 18 each. DeepSeek-Flash preserves 8, yielding a 59-percentage-point spread in damage rates across the fourteen summarizers (5 – 64%). Be-
| flask-5014 | P | P | P | P | F | P | F | P | F | P | P | F | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| requests-5414 | P | P | P | P | P | P | P | P | P | P | P | P | P |
| xarray-3677 | P | P | P | F | F | P | P | P | P | P | P | F | F |
| xarray-4629 | P | P | P | P | P | P | P | P | P | P | P | P | P |
| xarray-6721 | P | P | F | P | P | P | F | P | P | P | P | P | P |
| pylint-6903 | P | P | P | P | P | P | P | P | P | P | P | P | P |
| pytest-10081 | P | F | F | F | F | F | F | F | F | F | F | F | F |
| pytest-5631 | P | P | P | P | P | P | F | P | P | P | P | F | F |
| pytest-5809 | P | P | P | P | P | F | P | F | P | P | P | P | P |
| pytest-6202 | P | P | P | P | P | F | F | F | F | F | F | F | F |
| pytest-7205 | P | P | P | P | F | P | P | P | F | F | F | F | F |
| pytest-7432 | P | P | P | P | P | F | F | P | F | F | P | F | F |
| pytest-7490 | P | F | P | P | F | F | F | F | F | F | F | F | F |
| pytest-7521 | P | P | P | P | F | F | F | F | F | F | F | F | F |
| pytest-7571 | P | F | P | P | F | F | F | F | P | F | F | F | F |
| pytest-7982 | P | P | P | P | F | F | F | F | P | F | F | F | F |
| pytest-8399 | P | P | P | P | F | F | F | F | F | F | F | F | F |
| sphinx-9230 | F | F | F | F | P | P | P | F | F | F | F | F | P |
| sphinx-9591 | P | P | P | F | P | P | F | P | F | P | F | P | P |
| sympy-12481 | P | P | F | F | P | F | P | F | F | P | F | F | F |
| sympy-13480 | P | P | P | P | P | P | P | P | P | P | P | P | P |
| sympy-13551 | P | P | P | F | P | P | P | P | P | F | P | P | F |
Opus 4.8
K3
Luna
Sol
F5
F5.1
Astra
Qwen
Terra
O5.5
GLM
V4Pro
Hy4
Flash
Figure 2: POST outcomes on the 22 validated PRE-pass cells ( ) for the fourteen summarizer backbones. P: POST passes; F: POST fails. Full model names are listed in Table 2. Damage sets overlap only partially.
cause the history, repository state, and continuation agent are shared, this comparison measures the effect of the summarizer choice within a common repair setup. The table reports Wilson intervals alongside each rate.
Figure 2 reveals how the differences arise. The damage sets overlap partially: every backbone stably damages a repair that another preserves. Shared hard cases coexist with complementary successes. On pytest-10081, Claude Opus 4.8 preserves the repair while the other thirteen backbones damage it; on sphinx-9230, nine backbones, including Claude Opus 4.8, damage the repair and five preserve it. Instance-level outcomes therefore identify both widely shared failure cases and successful alternatives for the same task.
Agreement across repairs. The fourteen backbones agree on four of the 22 validated repairs and differ on the remaining 18 (Appendix A). Every validated pytest repair and two of the three xarray repairs are damaged by at least one backbone, while the validated requests and pylint cases remain preserved throughout. Claude Opus 4.8 preserves 17 of the 18 repairs with disagreement. Its advantage is thus distributed across the disagreement set, with sphinx-9230 identifying a concrete case for which other summarizers supply a successful continuation state. The paired grid is useful precisely because these alternatives start from the same history and snapshot. A difficult repair need not fail under every summary: pytest-10081 has one preserving backbone, and sphinx-9230 has five. The benchmark thus localizes the configuration choices associated with success, while the aggregate rates quantify how frequently each choice preserves the tested repairs.
| Prompt | POST pass ↑ | Detail retention ↑ |
|---|---|---|
| Kimi Code | 19/22 = 86% | 8.2% |
| Claude Code | 18/22 = 82% | 15.0% |
| Gemini CLI | 17/22 = 77% | 7.2% |
| Codex | 16/22 = 73% | 9.5% |
| opencode | 16/22 = 73% | 9.5% |
Table 3: Task Preservation POST-pass counts among 22 validated PRE-pass instances and Recurring-Detail Retention mean scores over the separate 146-session set, both using Kimi-K3 as summarizer.
Effect of repeated runs. Repeated runs confirm 120 of the 126 first-round damaged instance-backbone pairs. GPT-6-Astra changes from 11 first-round damaged repairs to 9 confirmed cases; Claude Fable 5, Qwen3.8-Max, GLM-5.3, and Hy4-Preview each change by one. Claude Opus 4.8 and DeepSeek-Flash remain the lowest-and highest-damage backbones. The broad spread between summarizers therefore persists under the confirmation rule, and most observed damage recurs across independent samples. Appendix B reports all observed outcomes for the selected cases.
Prompt comparison. With Kimi-K3 as summarizer, Kimi Code produces the most POST passes (19/22), followed by Claude Code (18/22), Gemini CLI (17/22), Codex (16/22), and opencode (16/22) (Table 3). On the separate 146-session retention set, Claude Code retains the largest share of recurring details (15.0%). The two evaluations distinguish a prompt that best supports completing the sampled repairs from one that best preserves recurring details in the session corpus. This difference makes the evaluation target consequential when selecting a compaction prompt.
The prompt grid separates shared failures from prompt-specific losses (Appendix F). Sphinx-9230 fails under all five prompts, and pytest-7571 fails under four. In contrast, xarray-3677, pylint-6903,
| Backbone | Detail-retention score ↑ |
|---|---|
| DeepSeek-Flash | 16.0% |
| Kimi-K3 | 15.0% |
| GPT-5.6-Sol | 14.8% |
| GPT-5.6-Luna | 13.3% |
| DeepSeek-V4-Pro | 11.9% |
| GLM-5.3 | 9.5% |
| GPT-5.6-Terra | 8.2% |
| anchor_index (mechanical) | 79.1% |
Table 4: Recurring-Detail Retention score by summarizer backbone (Claude Code prompt). Per-backbone valid n is 144–146 of 146 sessions. API or parse errors are excluded, while empty or whitespace summaries score 0 and remain included.
and pytest-7521 fail under opencode alone; pytest-7490 fails under Claude Code alone. Kimi Code and Claude Code also have different failure profiles: Kimi Code preserves the three pytest repairs damaged by Claude Code, while Claude Code preserves requests-5414 and sympy-13551, which Kimi Code damages. Sphinx-9230 is their shared failure. These profiles explain how the two leading prompts differ beyond their one-repair aggregate gap. The controlled prompt comparison also holds the summarizer fixed, demonstrating that the compaction instruction alone is a consequential configuration choice in this setup. Its case-level outcomes complement the backbone experiment, which holds the instruction fixed. Together, the two comparisons separate model choice from prompt choice while retaining the same continuation and executable criterion.
4.3 Detail Retention Results
Recurring-Detail Retention. On 146 sessions, DeepSeek-Flash attains the highest LLM retention score (16.0%), followed by Kimi-K3 (15.0%) under the Claude Code prompt (Table 4). Across the seven-backbone, five-prompt matrix, scores range from 5.0% to 16.0%. DeepSeek-Flash leads under Claude Code, Gemini CLI, and Kimi Code, while GPT-5.6-Terra leads under Codex and opencode. The matrix therefore reveals an interaction between summarizer and prompt: the same backbone need not lead under every compaction instruction. Appendix C supplies the complete matrix and matched client-subset comparisons.
What the retention gap measures. The mechanical anchor_index reference retains 79.1% of recurring details, a 63.1-percentage-point gap over the best LLM summary. These values are directly recoverable from recorded history under a bounded extraction procedure: the reference reads at most 400,000 serialized characters and keeps at most 40 values per type. The comparison quantifies how much recurring structured information survives extraction versus generated summarization. Task Preservation supplies the complementary execution test, assessing whether the resulting continuation state supports completing a repair. The retention reference gives each recurring value an explicit membership test, making omissions inspectable at the level of paths, identifiers, error types, or other extracted strings. Scores are averaged per session, so a session with many labels does not dominate the corpus mean. This consistently compares histories with different amounts of structured information.
The joint results distinguish detail retention from task preservation. DeepSeek-Flash has the highest retention score under Claude Code but damages 14 of 22 repairs, compared with 4 for Kimi-K3. With Kimi-K3 fixed, Claude Code retains of recurring details versus for Kimi Code, while Kimi Code preserves one more repair. These are configuration-level comparisons across separate datasets. They show why evaluating both properties is useful: a configuration that preserves more recurring strings can still supply a less effective state for task continuation.
The prompts also impose different output structures. Claude Code requests nine sections and produces summaries of about 10,000 characters on the retention set, compared with 1,600 – 5,200 for the other prompts. Kimi Code requests a first-person handoff focused on continuing the task. Thus, the observed prompt profiles combine differences in instructions, organization, and output length. Compact-Bench evaluates these production configurations as a whole, exposing how their information-retention and task-preservation outcomes differ.
Production-Chain Retention. Across 106 live sessions, mean retention is at the first boundary and at the second ; third- and fourth-boundary means are and (Figure 3). Each mean summarizes the evaluable subset at that position. The production measurements extend the benchmark from an artificial boundary to the summaries that agents actually receive during continued work. They document recurring-detail coverage across repeated history replacements, with per-session ratios and

Figure 3: Mean retention per compaction index across 106 production compaction chains. Sample sizes shrink quickly with .
| Damaged cell | Target file in S | Fix evidence in S |
|---|---|---|
| pytest-10081 | yes (1/1) | 8/12 |
| pytest-7490 | yes (1/1) | 10/12 |
| pytest-7571 | yes (1/1) | 5/5 |
| sphinx-9230 | yes (1/1) | 4 listed strings |
Table 5: Retained repair evidence in the four stably damaged cells under Kimi-K3 summaries. The target file appears in all four; fractions give retained gold-patch tokens for the pytest cases. The sphinx row lists four strings from the worked example and has no exhaustive token denominator.
instruction-conditioned breakdowns in Appendix C. The first-boundary result covers all 106 sessions and places the controlled retention measurements alongside a deployed-use reference. Subsequent boundaries retain their own future-request windows, capturing the details present in the interaction after each replacement. This boundary-specific view preserves the context in which each production summary is used, rather than merging successive summaries into a single session-level artifact.
4.4 Diagnosing Task Damage
Table 5 examines four stable Kimi-K3 failures. Every summary retains its target file; the pytest summaries also contain 8/12, 10/12, and 5/5 audited gold-patch tokens. Pytest-7571 is particularly informative: all five audited tokens survive, yet the continuation fails. Sphinx-9230 similarly retains strings from the fix but omits the reasoning that split(None, 1) must become rsplit. The cases expose a distinction between preserving repair ingredients and preserving the progress that connects them to a completed edit.
From evidence to action. The sphinx-9230 trace makes that distinction visible in subsequent actions. PRE reads the target region, builds and checks a minimal reproduction, locates the call, and applies a short Python edit. POST reaches the relevant file, then searches broadly and reads test and reproduction code without making the repair. The trace contains 8 PRE tool actions and 13 POST actions within the shared eight-step budget, since a step can contain multiple tool actions (Appendix I). Counts of explicit read_file calls show at most one repeat read per condition in each damaged case (Appendix J). The observed divergence is in the transition from relevant evidence to an effective edit, even with the target file still accessible.
This diagnosis illustrates the role of paired continuation in the benchmark. Retention scores locate missing details; paired traces reveal how a preserved or altered working state unfolds into subsequent actions. On the inspected repairs, the decisive outcome is executable task completion, and paths or code tokens provide evidence for interpreting that outcome. Combining these views makes it possible to distinguish a missing identifier from a continuation that still has the identifier but does not complete the repair.
Evaluation cost. The complete 35-repair study required about 8,000 model calls, with compression accounting for under 5% of tokens. The main computational cost lies in generating and judging continuations, which provide the executable evidence for task preservation.
Appendix G provides scoring rules, configurations, environment recipes, and instance-level outcome tables, supporting inspection of how each aggregate follows from its underlying cases.
5 Conclusion
Compact-Bench measures what survives context compaction through paired task continuation, recurring-detail matching, and real production chains. Its shared-boundary comparison separates summarizers by their ability to preserve executable repair progress: Claude Opus 4.8 has the lowest stable damage, with a range across fourteen backbones. Prompt choice also matters, with Kimi Code preserving the most repairs and Claude Code retaining the most recurring details under Kimi-K3. The paired failures establish the benchmark's central distinction: retaining paths and code strings can coexist with losing the progress needed to finish a task. Evaluating both information and subsequent action makes that loss visible.
Limitations
Results are conditional on the tested repository repairs, continuation agent, and budget. Detail-retention scores capture literal recurrence, while later production-boundary estimates use small, changing session subsets. Private session payloads and cached repair states are unavailable; Appendix G details the released scoring rules, configurations, and outcome tables.
Ethical Considerations
The Recurring-Detail Retention and Production-Chain Retention evaluations use real agentic sessions collected from online agent traffic on the authors' institutional platform under its existing data-use agreements; sessions were analyzed in place and were not solicited from users for this study. The data was processed to extract structural items (paths, identifiers, error types) for labeling. The paper reports aggregate retention statistics; private session payloads and session-level label values are not distributed. Paths, URLs, and IP addresses can identify users or infrastructure; the distributed artifacts therefore exclude these private session-level values. Task Preservation reuses public SWE-bench instances under their original licenses. All reported experiments were run through metered API gateways under the authors' institutional accounts. The benchmark is intended to help identify and reduce compaction-induced failures in deployed coding agents.
References
Chenxin An, Shansan Gong, Ming Zhong, Xingjian Zhao, Mukai Li, Jun Zhang, Lingpeng Kong, and Xipeng Qiu. 2024. L-eval: Instituting standardized evaluation for long context language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 14388–14411. Association for Computational Linguistics.
Anthropic. 2026a. Claude Fable 5 and Claude Mythos 5.
Anthropic. 2026b. Introducing Claude Fable 5.1 and Claude Mythos 5.1.
Anthropic. 2026c. Introducing Claude Opus 4.8.
Anthropic. 2026d. Introducing Claude Opus 5.5.
Yushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu, Jiankai Tang, Zhidian Huang, Zhengxiao Du, Xiao Liu, Aohan Zeng, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li. 2024. LongBench: A bilingual, multitask benchmark for long context understanding. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3119–3137, Bangkok, Thailand. Association for Computational Linguistics.
Yushi Bai, Shangqing Tu, Jiajie Zhang, Hao Peng, Xiaozhi Wang, Xin Lv, Shulin Cao, Jiazheng Xu, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li. 2025. LongBench v2: Towards deeper understanding and reasoning on realistic long-context multitasks. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3639–3664, Vienna, Austria. Association for Computational Linguistics.
David Castillo-Bolado, Joseph Davidson, Finlay Gray, and Marek Rosa. 2024. Beyond prompts: Dynamic conversational benchmarking of large language models. In Advances in Neural Information Processing Systems, Datasets and Benchmarks Track.
Zhuofu Chen, Rui Pan, Yinwei Dai, and Ravi Ne-travali. 2026. Slipstream: Trajectory-grounded compaction validation for long-horizon agents. Preprint, arXiv:2605.08580.
Musa Cim, Burak Topcu, Chita Das, and Mahmut Taylan Kandemir. 2026. Parallel context compaction for long-horizon LLM agent serving. Preprint, arXiv:2605.23296.
DeepSeek. 2026a. DeepSeek-V4-Pro GA Release.
DeepSeek. 2026b. DeepSeek-V4.1-Flash: Smarter, Faster, More Efficient.
DeepSeek-AI. 2026a. DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence. Preprint, arXiv:2606.19348.
DeepSeek-AI. 2026b. DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression. Preprint, arXiv:2609.19969.
Esin Durmus, He He, and Mona Diab. 2020. FEQA: A question answering evaluation framework for faithfulness assessment in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 5055–5070, Online. Association for Computational Linguistics.
Tao Ge, Jing Hu, Lei Wang, Xun Wang, Si-Qing Chen, and Furu Wei. 2024. In-context autoencoder for context compression in a large language model. In International Conference on Learning Representations, pages 2591–2607.
Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia, Yang Zhang, and Boris Ginsburg. 2024. RULER: What's the real context size of your long-context language models? In Proceedings of COLM.
Naman Jain, King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen, and Ion Stoica. 2025. Live-CodeBench: Holistic and contamination free evaluation of large language models for code. In International Conference on Learning Representations, pages 58791–58831.
Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. 2023. LLMLingua: Compressing prompts for accelerated inference of large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 13358–13376, Singapore. Association for Computational Linguistics.
Huiqiang Jiang, Qianhui Wu, Xufang Luo, Dongsheng Li, Chin-Yew Lin, Yuqing Yang, and Lili Qiu. 2024. LongLLMLingua: Accelerating and enhancing LLMs in long context scenarios via prompt compression. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1658–1677. Association for Computational Linguistics.
Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. 2024. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations, pages 54107–54157.
Kimi Team. 2026. Kimi K3: Open Frontier Intelligence. Preprint, arXiv:2607.24653.
Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. 2020. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9332–9346, Online. Association for Computational Linguistics.
Yuri Kuratov, Aydar Bulatov, Petr Anokhin, Ivan Rodkin, Dmitry Sorokin, Artyom Sorokin, and Mikhail Burtsev. 2024. BABILong: Testing the limits of LLMs with long context reasoning-in-a-haystack. In Advances in Neural Information Processing Systems, volume 37, pages 106519–106554. Curran Associates, Inc.
Jinhyuk Lee, Anthony Chen, Zhuyun Dai, Dheeru Dua, Devendra Singh Sachan, Michael Boratko, Yi Luan, Séb Arnold, Vincent Perot, Siddharth Dalmia, Hexiang Hu, Xudong Lin, Panupong Pasupat, Aida Amini, Jeremy R. Cole, Sebastian Riedel, Iftekhar Naim, Ming-Wei Chang, and Kelvin Guu. 2025. LOFT: Scalable and more realistic long-context evaluation. In Findings of the Association for Computational Linguistics: NAACL 2025, pages 6713–6738. Association for Computational Linguistics.
Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. 2020.
Retrieval-augmented generation for knowledge-intensive NLP tasks. In Advances in Neural Information Processing Systems, volume 33, pages 9459–9474. Curran Associates, Inc.
Tianjian Li, Jingyu Zhang, William Jurayj, Xi Wang, Chuanyang Jin, Mehrdad Farajtabar, Eric Nalisnick, and Daniel Khashabi. 2026a. Self-compacting language model agents. Preprint, arXiv:2606.23525.
Yucheng Li, Bo Dong, Frank Guerin, and Chenghua Lin. 2023. Compressing context to enhance inference efficiency of large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 6342–6353, Singapore. Association for Computational Linguistics.
Yujiang Li, Zhenyu Hou, Yi Jing, Jie Tang, and Yuxiao Dong. 2026b. CompactionRL: Reinforcement learning with context compaction for long-horizon agents. Preprint, arXiv:2607.05378.
Zongqian Li, Yinhong Liu, Yixuan Su, and Nigel Collier. 2025. Prompt compression for large language models: A survey. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 7182–7195, Albuquerque, New Mexico. Association for Computational Linguistics.
Tobias Lindenbauer, Igor Slinko, Ludwig Felder, Egor Bogomolov, and Yaroslav Zharov. 2025. The complexity trap: Simple observation masking is as efficient as LLM summarization for agent context management. Preprint, arXiv:2508.21433.
Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang. 2024a. Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12:157–173.
Xiang Liu, Peijie Dong, Xuming Hu, and Xiaowen Chu. 2024b. LongGenBench: Long-context generation benchmark. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 865–883. Association for Computational Linguistics.
Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuan Yang, Shudan Zhang, Xiang Deng, Aohan Zeng, Zhengxiao Du, Chenhui Zhang, Sheng Shen, Tianjun Zhang, Yu Su, Huan Sun, and 3 others. 2024c. AgentBench: Evaluating LLMs as agents. In Proceedings of the International Conference on Learning Representations.
Yang Liu, Dan Iter, Yichong Xu, Shuohang Wang, Ruochen Xu, and Chenguang Zhu. 2023. G-eval: NLG evaluation using GPT-4 with better human alignment. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 2511–2522, Singapore. Association for Computational Linguistics.
Adyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang. 2024. Evaluating very long-term conversational memory of LLM agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13851–13870, Bangkok, Thailand. Association for Computational Linguistics.
Guanghui Min, Liang Wu, Mayank Darbari, Chen Chen, and Liangjie Hong. 2026. Toward reliable context compression for long-horizon agents: An empirical study of execution instability. Preprint, arXiv:2608.06503.
Jesse Mu, Xiang Lisa Li, and Noah Goodman. 2023. Learning to compress prompts with gist tokens. In Advances in Neural Information Processing Systems, volume 36, pages 19327–19352. Curran Associates, Inc.
OpenAI. 2026a. GPT-5.6: Frontier intelligence that scales with your ambition.
OpenAI. 2026b. GPT-6 Astra: A new generation of intelligence.
Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. 2023. MemGPT: Towards LLMs as operating systems. Preprint, arXiv:2310.08560.
Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, Qingwei Lin, Victor Rühle, Yuqing Yang, Chin-Yew Lin, H. Vicky Zhao, Lili Qiu, and Dongmei Zhang. 2024. LLMLingua-2: Data distillation for efficient and faithful task-agnostic prompt compression. In Findings of the Association for Computational Linguistics: ACL 2024, pages 963–981, Bangkok, Thailand. Association for Computational Linguistics.
Qwen Team. 2026. Qwen3.8-Max: A New Bar for Coding and Cowork.
Thomas Scialom, Paul-Alexis Dray, Sylvain Lamprier, Benjamin Piwowarski, Jacopo Staiano, Alex Wang, and Patrick Gallinari. 2021. QuestEval: Summarization asks for fact-based evaluation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6594–6604, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
Uri Shaham, Maor Ivgi, Avia Efrat, Jonathan Berant, and Omer Levy. 2023. ZeroSCROLLS: A zero-shot benchmark for long text understanding. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 7977–7989, Singapore. Association for Computational Linguistics.
Rahul Subramani. 2026. LANTERN: Layered archival and temporal episodic retrieval network for long-context LLM conversations. Preprint, arXiv:2606.05182.
Weiwei Sun, Miao Lu, Zhan Ling, Kang Liu, Xuesong Yao, Yiming Yang, and Jiecao Chen. 2026. Scaling long-horizon agent via context folding. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 116894–116910. PMLR.
Sijun Tan, Xiuyu Li, Shishir G. Patil, Ziyang Wu, Tianjun Zhang, Kurt Keutzer, Joseph E. Gonzalez, and Raluca Ada Popa. 2024. LLoCO: Learning long contexts offline. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 17605–17621. Association for Computational Linguistics.
Tencent. 2026. Tencent Releases and Open-Sources Tencent Hy4 preview.
Xingyao Wang, Boxuan Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, Hoang H. Tran, Fuqiang Li, Ren Ma, Mingzhang Zheng, Bill Qian, Yanjun Shao, Niklas Muennighoff, Yizhe Zhang, Binyuan Hui, and 5 others. 2025. OpenHands: An open platform for AI software developers as generalist agents. In International Conference on Learning Representations, pages 65882–65919.
Zhiqi Wang, Yichi Zhang, Dongwon Lee, and Yuchen Yang. 2026. Lost in compaction: Evaluating side-constraint loss under context compaction. Preprint, arXiv:2608.11242.
Di Wu, Hongwei Wang, Wenhao Yu, Yuwei Zhang, Kai-Wei Chang, and Dong Yu. 2025a. LongMemEval: Benchmarking chat assistants on long-term interactive memory. In International Conference on Learning Representations, pages 86809–86836.
Xixi Wu, Kuan Li, Yida Zhao, Liwen Zhang, Litu Ou, Huifeng Yin, Zhongwang Zhang, Xinmiao Yu, Dingchu Zhang, Yong Jiang, Pengjun Xie, Fei Huang, Minhao Cheng, Shuai Wang, Hong Cheng, and Jingren Zhou. 2025b. ReSum: Unlocking long-horizon search intelligence via context summarization. Preprint, arXiv:2509.13313.
Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. 2025. Demystifying LLM-based software engineering agents. Proceedings of the ACM on Software Engineering, 2(FSE):801–824.
Tianbao Xie, Danyang Zhang, Jixuan Chen, Xiaochuan Li, Siheng Zhao, Ruisheng Cao, Toh Jing Hua, Zhoujun Cheng, Dongchan Shin, Fangyu Lei, Yitao Liu, Yiheng Xu, Shuyan Zhou, Silvio Savarese, Caiming Xiong, Victor Zhong, and Tao Yu. 2024. OSWorld: Benchmarking multimodal agents for open-ended tasks in real computer environments. In Advances in Neural Information Processing Systems, Datasets and Benchmarks Track.
Fangyuan Xu, Weijia Shi, and Eunsol Choi. 2024. RE-COMP: Improving retrieval-augmented LMs with context compression and selective augmentation. In International Conference on Learning Representations, pages 43478–43502.
Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. 2025. A-mem: Agentic memory for LLM agents. In Advances in Neural Information Processing Systems, volume 38, pages 17577–17604. Curran Associates, Inc.
John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. 2024. SWE-agent: Agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems, volume 37, pages 50528–50652. Curran Associates, Inc.
Shunyu Yao, Noah Shinn, Pedram Razavi, and Karthik Narasimhan. 2025. -bench: A benchmark for tool-agent-user interaction in real-world domains. In International Conference on Learning Representations, pages 9965–10017.
Z.ai. 2026. GLM-5.3: Frontier Coding with Emergent Cyber Capabilities.
Xinrong Zhang, Yingfa Chen, Shengding Hu, Zihang Xu, Junhao Chen, Moo Hao, Xu Han, Zhen Thai, Shuo Wang, Zhiyuan Liu, and Maosong Sun. 2024. ∞Bench: Extending long context evaluation beyond 100K tokens. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15262–15277, Bangkok, Thailand. Association for Computational Linguistics.
Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. 2024. MemoryBank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 19724–19731. Association for the Advancement of Artificial Intelligence (AAAI).
Shuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abishek Sridhar, Xianyi Cheng, Tianyue Ou, Yonatan Bisk, Daniel Fried, Uri Alon, and Graham Neubig. 2024. WebArena: A realistic web environment for building autonomous agents. In Proceedings of the International Conference on Learning Representations.
A First-Round Task Preservation Outcomes
Table 6 lists first-round outcomes for all fourteen backbones. X marks pytest-10051 and pytest-7236, excluded because PRE fails in three independent environments. Dashes mark cells outside the cross-backbone PRE-pass comparison. The caption defines the outcome codes and model abbreviations.
B Three-Run Task Preservation Verification
Table 7 gives the observed runs for all 126 first-round damaged instance–backbone pairs: 120 receive the stable-damage label SD and six the variability label V. The caption specifies which conditions are resampled.
C Detail Retention Breakdowns
Backbone, prompt, and client. Table 8 reports all seven-backbone, five-prompt scores; Tables 9 and 10 break down Kimi-K3 and GPT-5.6-Luna results by client source. Under Kimi-K3 with Claude Code, Kimi Code sessions average 21.4%, Claude Code 9.4%, and opencode 6.6%. The client groups have different task mixes and detail densities; comparisons within each group hold that sampled subset fixed. Claude Code ranks first within most groups, consistent with its pooled score. The labels fake-kimi and fake-cc identify two and one simulator-generated sessions, respectively; kilocode and hertz are smaller client groups, and other groups the remaining sources. The zero scores for fake-cc and hertz each correspond to one session with no retained measured detail. Valid sample counts range from 144 to 146 after API or parse failures are excluded.
Production boundaries. Of 224 production boundaries, 140 contain evaluable future details. Among these, the 84 with an explicit summary instruction average 19.0% retention, and the 56 without one average 11.4%. This groups recorded boundaries by instruction presence; the underlying sessions and compaction conditions also vary. Twenty-two sessions have scores at both their first and last boundaries; excluding two zero first-boundary scores leaves 20 sessions with a mean last-to-first ratio of 4.07. The ratio describes this conditional subset. The completed-write detector flags zero boundaries under the matching rules in Appendix L.
D Evaluation Validation Results
Interpreter and directory controls. Table 11 compares three harness settings: the system interpreter (v1), the instance interpreter with separate execution directories (v2), and the instance interpreter with a shared directory and snapshot restoration (v3). The benchmark uses v3. Interpreter alignment makes older repositories important to both agent and judge; for example, sympy-13480 changes from unsolved to preserved. Directory alignment preserves the meaning of paths copied into summaries. In the separate-directory pilot, copied Phase-A paths redirected POST commands
| Instance | K3 | Luna | Sol | Astra | Terra | Opus | F5 | F5.1 | O5.5 | Qwen | GLM | V4Pro | Hy4 | Flash |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| flask-5014 | P | P | P | D | D | P | D | P | P | P | P | D | D | D |
| req-5414 | P | P | P | P | P | P | P | P | P | P | P | P | P | P |
| req-6028 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| xa-3677 | P | P | D | P | P | P | D | P | P | P | P | P | D | D |
| xa-4629 | P | P | P | P | P | P | P | P | P | P | P | P | P | P |
| xa-6721 | P | D | P | P | P | P | P | P | P | D | P | P | P | P |
| pl-4970 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pl-6903 | P | P | P | P | P | P | P | P | P | P | P | P | P | P |
| pl-7080 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pt-10051 | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| pt-10081 | D | D | D | D | D | P | D | D | D | D | D | D | D | D |
| pt-10356 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pt-5631 | P | P | P | P | P | P | P | P | P | D | P | P | D | D |
| pt-5787 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pt-5809 | P | P | P | D | D | P | P | P | P | P | P | P | P | P |
| pt-5840 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pt-6197 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pt-6202 | P | P | P | D | D | P | P | D | D | D | D | D | D | D |
| pt-7205 | P | P | P | P | P | P | D | P | D | P | D | D | D | D |
| pt-7236 | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| pt-7324 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| pt-7432 | P | P | P | D | P | P | P | P | D | D | D | P | D | D |
| pt-7490 | D | P | P | D | D | P | D | D | D | D | D | D | D | D |
| pt-7521 | P | P | P | D | D | P | D | D | D | D | D | D | D | D |
| pt-7571 | D | P | P | D | P | P | D | D | D | D | D | D | D | D |
| pt-7982 | P | P | P | D | P | P | D | D | D | D | D | D | D | D |
| pt-8399 | P | P | P | D | D | P | D | D | D | D | D | D | D | D |
| sp-9230 | D | D | D | P | D | D | P | P | D | P | D | D | D | P |
| sp-9591 | P | P | D | D | D | P | P | P | P | P | D | D | P | P |
| sy-12419 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| sy-12481 | P | D | D | P | D | P | P | D | P | D | P | D | D | D |
| sy-12489 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| sy-13091 | U | - | - | - | - | - | - | - | - | - | - | - | - | - |
| sy-13480 | P | P | P | P | P | P | P | P | P | P | P | P | P | P |
| sy-13551 | P | P | D | P | P | P | P | P | P | P | D | P | P | D |
Table 6: First-round outcome of every Task Preservation cell under the fourteen backbone summarizers (column headers use short forms: K3 = Kimi-K3, Luna = GPT-5.6-Luna, Sol = GPT-5.6-Sol, Terra = GPT-5.6-Terra, Opus = Claude Opus 4.8, F5 = Claude Fable 5, F5.1 = Claude Fable 5.1, O5.5 = Claude Opus 5.5, Hy4 = Hy4-Preview, Astra = GPT-6-Astra, Qwen = Qwen3.8-Max, GLM = GLM-5.3, V4Pro = DeepSeek-V4-Pro, Flash = DeepSeek-Flash). P: preserved (both conditions pass); D: damage (PRE passes, POST fails); R: rescue (PRE fails, POST passes); U: unsolved (both fail); X: excluded PRE-failing instance; -: not evaluated (the cell is outside the cross-backbone PRE-pass comparison).
outside the judged tree in 22 of 34 cases. Sharing and restoring the directory resolves this mismatch: xarray-6721 and pytest-7521 change from damage to preserved, while sphinx-9230 remains damaged. These comparisons validate the environment and state controls used in the paired evaluation.
Auxiliary label validation. Decision and progress labels were examined separately from the deterministic retention metric. From 1,747 raw candidates, many originating in system prompts and skill documents, a stratified sample of 60 items (20 decisions and 40 progress items) was independently reviewed by a human and Kimi-K3. They agreed on 59 items (98.3%). One disagreement concerned a literal duplicate and was adjudicated in favor of the LLM annotation. The resulting auxiliary gold set contains 31 items from eight sessions. This review validates the auxiliary
| Model | Instance | r1 | r2 | r3 | Result |
|---|---|---|---|---|---|
| K3 | pt-10081 | D | P | D | SD |
| K3 | pt-7490 | D | P | D | SD |
| K3 | pt-7571 | D | P | D | SD |
| K3 | sp-9230 | D | U | D | SD |
| Luna | xa-6721 | D | D | D | SD |
| Luna | pt-10081 | D | D | D | SD |
| Luna | sp-9230 | D | P | D | SD |
| Luna | sy-12481 | D | D | D | SD |
| Sol | xa-3677 | D | P | D | SD |
| Sol | pt-10081 | D | D | D | SD |
| Sol | sp-9230 | D | D | D | SD |
| Sol | sp-9591 | D | P | D | SD |
| Sol | sy-12481 | D | D | D | SD |
| Sol | sy-13551 | D | D | P | SD |
| Astra | flask-5014 | D | D | D | SD |
| Astra | pt-10081 | D | D | D | SD |
| Astra | pt-5809 | D | P | P | V |
| Astra | pt-6202 | D | D | D | SD |
| Astra | pt-7432 | D | D | D | SD |
| Astra | pt-7490 | D | D | D | SD |
| Astra | pt-7521 | D | D | D | SD |
| Astra | pt-7571 | D | D | D | SD |
| Astra | pt-7982 | D | D | D | SD |
| Astra | pt-8399 | D | D | D | SD |
| Astra | sp-9591 | D | P | P | V |
| Terra | flask-5014 | D | P | D | SD |
| Terra | pt-10081 | D | D | D | SD |
| Terra | pt-5809 | D | P | D | SD |
| Terra | pt-6202 | D | D | D | SD |
| Terra | pt-7490 | D | D | D | SD |
| Terra | pt-7521 | D | D | D | SD |
| Terra | pt-8399 | D | D | D | SD |
| Terra | sp-9230 | D | P | D | SD |
| Terra | sp-9591 | D | D | D | SD |
| Terra | sy-12481 | D | P | D | SD |
| Opus | sp-9230 | D | D | D | SD |
| F5 | flask-5014 | D | D | D | SD |
| F5 | xa-3677 | D | P | P | V |
| F5 | pt-10081 | D | D | D | SD |
| F5 | pt-7205 | D | D | D | SD |
| F5 | pt-7490 | D | D | D | SD |
| F5 | pt-7521 | D | D | D | SD |
| Model | Instance | r1 | r2 | r3 | Result |
|---|---|---|---|---|---|
| F5 | pt-7571 | D | D | D | SD |
| F5 | pt-7982 | D | D | D | SD |
| F5 | pt-8399 | D | D | D | SD |
| F5.1 | pt-10081 | D | D | D | SD |
| F5.1 | pt-6202 | D | D | P | SD |
| F5.1 | pt-7490 | D | D | D | SD |
| F5.1 | pt-7521 | D | D | D | SD |
| F5.1 | pt-7571 | D | D | D | SD |
| F5.1 | pt-7982 | D | D | D | SD |
| F5.1 | pt-8399 | D | D | D | SD |
| F5.1 | sy-12481 | D | D | D | SD |
| O5.5 | pt-10081 | D | D | D | SD |
| O5.5 | pt-6202 | D | D | P | SD |
| O5.5 | pt-7205 | D | D | D | SD |
| O5.5 | pt-7432 | D | D | D | SD |
| O5.5 | pt-7490 | D | D | D | SD |
| O5.5 | pt-7521 | D | D | D | SD |
| O5.5 | pt-7571 | D | D | D | SD |
| O5.5 | pt-7982 | D | D | D | SD |
| O5.5 | pt-8399 | D | D | D | SD |
| O5.5 | sp-9230 | D | P | D | SD |
| Qwen | xa-6721 | D | P | P | V |
| Qwen | pt-10081 | D | D | D | SD |
| Qwen | pt-5631 | D | D | D | SD |
| Qwen | pt-6202 | D | D | D | SD |
| Qwen | pt-7432 | D | P | D | SD |
| Qwen | pt-7490 | D | D | D | SD |
| Qwen | pt-7521 | D | D | D | SD |
| Qwen | pt-7571 | D | D | D | SD |
| Qwen | pt-7982 | D | D | D | SD |
| Qwen | pt-8399 | D | D | D | SD |
| Qwen | sy-12481 | D | D | P | SD |
| GLM | pt-10081 | D | D | D | SD |
| GLM | pt-6202 | D | D | D | SD |
| GLM | pt-7205 | D | D | P | SD |
| GLM | pt-7432 | D | D | D | SD |
| GLM | pt-7490 | D | D | D | SD |
| GLM | pt-7521 | D | D | D | SD |
| GLM | pt-7571 | D | D | D | SD |
| GLM | pt-7982 | D | D | D | SD |
| GLM | pt-8399 | D | D | D | SD |
| GLM | sp-9230 | D | D | D | SD |
| Model | Instance | r1 | r2 | r3 | Result |
|---|---|---|---|---|---|
| GLM | sp-9591 | D | P | P | V |
| GLM | sy-13551 | D | D | D | SD |
| V4Pro | flask-5014 | D | D | D | SD |
| V4Pro | pt-10081 | D | D | D | SD |
| V4Pro | pt-6202 | D | D | D | SD |
| V4Pro | pt-7205 | D | D | D | SD |
| V4Pro | pt-7490 | D | D | D | SD |
| V4Pro | pt-7521 | D | D | D | SD |
| V4Pro | pt-7571 | D | D | D | SD |
| V4Pro | pt-7982 | D | D | D | SD |
| V4Pro | pt-8399 | D | D | D | SD |
| V4Pro | sp-9230 | D | P | D | SD |
| V4Pro | sp-9591 | D | P | D | SD |
| V4Pro | sy-12481 | D | D | P | SD |
| Hy4 | flask-5014 | D | D | D | SD |
| Hy4 | xa-3677 | D | D | D | SD |
| Hy4 | pt-10081 | D | D | D | SD |
| Hy4 | pt-5631 | D | D | P | SD |
| Hy4 | pt-6202 | D | D | D | SD |
| Hy4 | pt-7205 | D | D | D | SD |
| Hy4 | pt-7432 | D | D | D | SD |
| Hy4 | pt-7490 | D | D | D | SD |
| Hy4 | pt-7521 | D | D | D | SD |
| Hy4 | pt-7571 | D | D | D | SD |
| Hy4 | pt-7982 | D | D | D | SD |
| Hy4 | pt-8399 | D | D | D | SD |
| Hy4 | sp-9230 | D | P | D | SD |
| Hy4 | sy-12481 | D | P | P | V |
| Flash | flask-5014 | D | D | P | SD |
| Flash | xa-3677 | D | D | P | SD |
| Flash | pt-10081 | D | D | D | SD |
| Flash | pt-5631 | D | D | P | SD |
| Flash | pt-6202 | D | D | D | SD |
| Flash | pt-7205 | D | D | D | SD |
| Flash | pt-7432 | D | D | D | SD |
| Flash | pt-7490 | D | D | D | SD |
| Flash | pt-7521 | D | D | D | SD |
| Flash | pt-7571 | D | D | D | SD |
| Flash | pt-7982 | D | D | D | SD |
| Flash | pt-8399 | D | D | D | SD |
| Flash | sy-12481 | D | D | D | SD |
| Flash | sy-13551 | D | D | D | SD |
Table 7: Per-seed verification of first-round damaged Task Preservation cells. P: POST passes; D: POST fails with a passing PRE; U: PRE fails (possible only for Kimi-K3, which reruns both conditions); -: no run. Other backbones resample the summary and POST while reusing the first-seed PRE baseline. SD denotes POST failure in at least two of three seeds; V denotes seed variance and is excluded from stable-damage counts.
labels; the headline retention scores use the structured-value extraction rules in Appendix L.
E Task Preservation Instances
Table 12 records the 35 repairs, target-test counts (median 1, maximum 10), and environments used for base-fail and gold-pass validation. Older repositories use Python 3.9 when they cannot import under Python 3.10 or later. Filtering excluded four django candidates because of environment cost and one pytest candidate whose assertion depended on pytest internals.
F Task Preservation Outcomes by Prompt
Table 13 reports first-round outcomes with Kimi-K3 and five production prompts: 22 validated PRE-pass repairs and two excluded cases marked X. The grid separates shared failures from prompt-specific losses; Kimi Code's three failures are requests-5414, sphinx-9230, and sympy-13551.
| Backbone | Claude Code | Codex | Gemini CLI | opencode | Kimi Code |
|---|---|---|---|---|---|
| Kimi-K3 | 15.0% | 9.5% | 7.2% | 9.5% | 8.2% |
| GPT-5.6-Luna | 13.3% | 7.9% | 6.0% | 9.1% | 5.0% |
| GPT-5.6-Sol | 14.8% | 8.7% | 6.1% | 8.8% | 7.4% |
| GPT-5.6-Terra | 8.2% | 11.7% | 6.5% | 12.6% | 9.5% |
| DeepSeek-Flash | 16.0% | 10.7% | 7.9% | 12.4% | 9.7% |
| DeepSeek-V4-Pro | 11.9% | 9.8% | 6.6% | 11.2% | 6.8% |
| GLM-5.3 | 9.5% | 8.1% | 7.8% | 11.6% | 6.2% |
Table 8: Recurring-Detail Retention scores by backbone and prompt (mean per session, n = 144 – 146 per cell). Bold marks the best backbone per prompt: DeepSeek-Flash leads on three prompts and GPT-5.6-Terra on two.
| Client | Claude | Codex | Gemini | opencode | Kimi |
|---|---|---|---|---|---|
| Kimi Code | 21.4% | 13.2% | 10.1% | 15.3% | 11.5% |
| Claude Code | 9.4% | 6.4% | 4.5% | 3.2% | 5.5% |
| opencode | 6.6% | 3.7% | 3.8% | 4.9% | 4.2% |
| other | 5.4% | 2.3% | 0.6% | 1.1% | 0.9% |
| fake-kimi | 11.8% | 7.2% | 8.2% | 10.6% | 6.6% |
| kilocode | 10.9% | 15.2% | 8.7% | 8.7% | 8.7% |
| fake-cc | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
| hertz | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
Table 9: Recurring-Detail Retention mean score by client and prompt (Kimi-K3; unweighted mean per session). Prompt labels abbreviate Claude Code, Codex, Gemini CLI, opencode, and Kimi Code.
| Instance | v1 | v2 | v3 | Observation |
|---|---|---|---|---|
| sympy-13480 | U | P | P | environment fix; preserved in v3 |
| sympy-13091 | R | U | U | v1 rescue not reproduced |
| xarray-6721 | - | D | P | v2 path-leak damage |
| requests-5414 | R | - | P | v1 rescue not reproduced |
| sphinx-9230 | - | D | D | damage persists in v3 |
| pytest-7521 | - | D | P | v2 path-leak damage |
Table 11: Interpreter and directory validation (v1: system interpreter; v2: instance interpreter, separate directories; v3: single directory with snapshot reset). Outcome codes as in Table 6.
G Harness and Reproducibility
Artifact licenses. The reference implementation is distributed under the project's Apache License 2.0. Upstream repository licenses remain separate: pytest uses MIT; requests and xarray use Apache 2.0; Flask and SymPy use BSD 3-Clause; Sphinx uses BSD 2-Clause; and pylint distributes GPL 2.0 license terms. Incorporated components may carry additional notices. The supplement's license manifest links the upstream license files at the instance commits. These licenses do not grant access to private sessions or relicense upstream issue text.
| Client | Claude | Codex | Gemini | opencode | Kimi |
|---|---|---|---|---|---|
| Kimi Code | 21.0% | 13.0% | 9.2% | 14.6% | 8.6% |
| Claude Code | 6.0% | 3.2% | 3.2% | 3.4% | 1.3% |
| opencode | 6.0% | 1.6% | 1.2% | 3.4% | 0.4% |
| other | 0.0% | 0.9% | 0.9% | 1.7% | 3.4% |
| fake-kimi | 13.1% | 4.7% | 2.9% | 14.5% | 2.5% |
| kilocode | 0.0% | 4.3% | 6.5% | 4.3% | 2.2% |
| fake-cc | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
| hertz | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
Table 10: Recurring-Detail Retention mean score by client and prompt (GPT-5.6-Luna; unweighted mean per session). Prompt labels abbreviate Claude Code, Codex, Gemini CLI, opencode, and Kimi Code.
Availability and reproducibility. The accompanying compact-bench-reproducibility.zip supplies reference extraction and scoring code, transcript preprocessing, coding-agent inputs and tool schemas, environment recipes, and file schemas described in Appendix L. The Task Preservation first-round grids and selected additional runs (Appendices A, B, and F) support recomputation of the reported task rates. The package excludes private session payloads, historical candidate order and sampling budget, and cached Task Preservation histories and working-tree snapshots. Recomputing session-level aggregates requires the source payloads; fresh Task Preservation runs generate new trajectories. The released rules and configurations specify the operations for implementing those evaluations.
Agent and tools. The continuation agent runs with two tools: read_file (confined to the working directory) and run_command with an allowlist (pytest, python, grep, rg, cat, sed, head, tail, find, echo, cd, pwd, wc, diff, patch, git, mkdir, cp, mv, touch, pip, rm, ls). Command outputs are truncated to 3,000 characters; file reads to 8,000. The agent's shell receives the instance venv on PATH and the working directory on PYTHONPATH, so its python and pytest invocations ex-
| Instance | Repo | #F2P | Environment |
|---|---|---|---|
| flask-5014 | flask | 1 | werkzeug<3 |
| req-5414 | requests | 1 | urllib3<2 |
| req-6028 | requests | 2 | urllib3<2 |
| pt-10051 | pytest | 1 | setuptools_scm shim |
| pt-10081 | pytest | 1 | setuptools_scm shim |
| pt-10356 | pytest | 1 | setuptools_scm shim |
| pt-5631 | pytest | 1 | setuptools_scm shim |
| pt-5787 | pytest | 2 | setuptools_scm shim |
| pt-5809 | pytest | 1 | setuptools_scm shim |
| pt-7236 | pytest | 1 | setuptools_scm shim |
| pt-7324 | pytest | 3 | setuptools_scm shim |
| pt-7432 | pytest | 1 | setuptools_scm shim |
| pt-7490 | pytest | 2 | setuptools_scm shim |
| pt-7571 | pytest | 1 | setuptools_scm shim |
| pt-8399 | pytest | 1 | setuptools_scm shim |
| pt-5840 | pytest | 2 | setuptools_scm shim |
| pt-6197 | pytest | 2 | setuptools_scm shim |
| pt-6202 | pytest | 1 | setuptools_scm shim |
| pt-7205 | pytest | 10 | setuptools_scm shim |
| pt-7521 | pytest | 2 | setuptools_scm shim |
| pt-7982 | pytest | 1 | setuptools_scm shim |
| sy-12419 | sympy | 1 | py3.9 (2016-era) |
| sy-12481 | sympy | 1 | py3.9 (2016-era) |
| sy-12489 | sympy | 1 | py3.9 (2016-era) |
| sy-13091 | sympy | 2 | py3.9 (2016-era) |
| sy-13480 | sympy | 1 | py3.9 (2016-era) |
| sy-13551 | sympy | 1 | py3.9 (2016-era) |
| xa-3677 | xarray | 1 | numpy<2, pandas<2 |
| xa-4629 | xarray | 1 | numpy<2, pandas<2 |
| xa-6721 | xarray | 1 | numpy<2, pandas<2 |
| pl-4970 | pylint | 1 | py library for test imports |
| pl-6903 | pylint | 1 | py library for test imports |
| pl-7080 | pylint | 1 | py library for test imports |
| sp-9230 | sphinx | 1 | sphinxcontrib era pins |
| sp-9591 | sphinx | 1 | sphinxcontrib era pins |
Table 12: Task Preservation instances with FAIL_TO_PASS test counts and environment recipe notes. All environments use pytest<8 and a per-instance venv.
ercise the live working tree with the judging interpreter.
Budgets and caching. Phase A allows at most 10 steps; each continuation at most 8; command timeout is 120s and test timeout is 300s. Compression inputs are preprocessed before the overall cap: in Task Preservation and cross-backbone runs, each text block is truncated to 2,000 characters and each tool input or output to 200 characters; in Recurring-Detail Retention, the limits are 4,000 and 500 characters; the serialized transcript is then capped at its last 250,000 characters. The anchor_index reference extracts from the first 400,000 characters of serialized history and keeps at most 40 values per type after sorting. Compression outputs are capped at 6,144 tokens for Kimi-K3 main runs and 16,384 tokens for cross-backbone and Recurring-Detail Retention runs. Each phase-A trajectory is cached and shared across methods and seeds; the working-directory snapshot is restored between PRE and POST.
| Instance | Claude | Codex | Gemini | opc | Kimi |
|---|---|---|---|---|---|
| flask-5014 | P | P | P | P | P |
| req-5414 | P | F | P | P | F |
| xa-3677 | P | P | P | F | P |
| xa-4629 | P | P | P | P | P |
| xa-6721 | P | P | P | P | P |
| pl-6903 | P | P | P | F | P |
| pt-10051 | X | X | X | X | X |
| pt-10081 | F | F | P | F | P |
| pt-5631 | P | P | P | P | P |
| pt-5809 | P | P | P | P | P |
| pt-6202 | P | P | P | P | P |
| pt-7205 | P | P | P | P | P |
| pt-7236 | X | X | X | X | X |
| pt-7432 | P | P | P | P | P |
| pt-7490 | F | P | P | P | P |
| pt-7521 | P | P | P | F | P |
| pt-7571 | F | F | F | F | P |
| pt-7982 | P | P | P | P | P |
| pt-8399 | P | F | F | P | P |
| sp-9230 | F | F | F | F | F |
| sp-9591 | P | P | P | P | P |
| sy-12481 | P | F | F | P | P |
| sy-13480 | P | P | P | P | P |
| sy-13551 | P | P | F | P | F |
Table 13: First-round Task Preservation outcomes under the five production compaction prompts with Kimi-K3 as the summarizer. Codes: P = POST passes; F = POST fails; X = excluded PRE-failing instance. All non-excluded listed cells pass the PRE control. Prompt headers abbreviate Claude Code, Codex, Gemini CLI, opencode, and Kimi Code.
Models and endpoints. Kimi-K3 and Claude-* models are called through the Anthropic messages endpoint; GPT-* models through the OpenAI chat-completions or responses endpoint, all via the same metered gateway with per-family API keys. Runs reported here were executed in September–October 2026 with gateway model identifiers kimi-k3 (Kimi Team, 2026), claude-opus-4-8 (Anthropic, 2026c), claude-fable-5 (Anthropic, 2026a), claude-fable-5-1 (Anthropic, 2026b), gpt-5.6-luna (OpenAI, 2026a), gpt-5.6-sol (OpenAI, 2026a), gpt-5.6-terra (OpenAI, 2026a), gpt-6-astra (OpenAI, 2026b), claude-opus-5-5 (Anthropic, 2026d), qwen3.8-max (Qwen Team, 2026), glm-5.3 (Z.ai, 2026), deepseek-v4-pro (DeepSeek-AI, 2026a; DeepSeek, 2026a), hy4-preview (Tencent, 2026), and deepseek-flash (DeepSeek-AI, 2026b;
DeepSeek, 2026b). Kimi-K3 runs with thinking disabled; thinking-style models run with default settings. Continuation turns use max_tokens 4,096; compression output caps follow the preceding paragraph (6,144 for Kimi-K3 main runs, 16,384 for cross-backbone and Recurring-Detail Retention runs). The gateway offers no seed parameter, so seeds are independent server-side samples; temperature and other decoding settings are the service defaults, identical across conditions. Per-family environment pins follow fixed recipes: numpy<2, pandas<2, setuptools_scm<8 for xarray; py for pylint; docutils<0.18 and erapinned sphinxcontrib-applehelp==1.0.2, -devhelp==1.0.2, -htmlhelp==2.0.0, -qthelp==1.0.3, -serializinghtml==1.1.5 for sphinx; plus pytest<8, werkzeug<3, and urlib3<2 everywhere. The pytest source-archive version shim sets SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST to 7.99.0 during installation and execution. The supplement records installation order and dependency version constraints.
AI assistance. Generative AI tools assisted with literature search, manuscript restructuring and language editing, and LaTeX and figure preparation. The authors remain responsible for verifying the cited sources, factual statements, and interpretations of experimental results.
Judging. FAIL_TO_PASS tests are normalized to pytest node IDs; for repositories whose FAIL_TO_PASS entries are bare test function names (sympy), the target file is located by searching the files touched by the test patch for the function definition. Judging reinstalls the working tree non-editable into the venv before running tests, so both source-layout and flat-layout repositories are scored against the live tree.
H Production Compaction Prompts
The five production prompts are included verbatim below. The Claude Code prompt (634 characters) reads in full:
Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit requests and your previous actions.
This summary should be thorough in capturing technical details, code patterns, and architectural decisions that would be essential for continuing development work without losing context.
Your summary should include the following sections:
-
Primary Request and Intent
-
Key Technical Concepts
-
Files and Code Sections (include full code snippets where applicable)
-
Errors and fixes
-
Problem Solving
-
All user messages
-
Pending Tasks
-
Current Work
-
Optional Next Step
The opencode prompt (537 characters) reads in full:
You are an anchored context summarization assistant for coding sessions.
Summarize only the conversation history you are given. The newest turns may be kept verbatim outside your summary, so focus on the older context that still matters for continuing the work.
Always follow the exact output structure requested by the user prompt. Keep every section, preserve exact file paths and identifiers when known, and prefer terse bullets over paragraphs.
Do not answer the conversation itself. Respond in the same language as the conversation.
The Codex prompt (423 characters) reads in full:
You are performing a CONTEXT CHECKPOINT COMPACTION. Create a handoff summary for another LLM that will resume the task.
Include:
-
Current progress and key decisions made
-
Important context, constraints, or user preferences
-
What remains to be done (clear next steps)
-
Any critical data, examples, or references needed to continue
Be concise, structured, and focused on helping the next LLM seamlessly continue the work.
The Kimi Code prompt (296 characters) reads in full:
You are about to run out of context. Write a first-person handoff note to yourself so you can seamlessly continue this task after the earlier conversation is cleared.
– This message is a direct task, not part of the above conversation –
Write the note as your own continuing train of thought.
The Gemini CLI prompt (279 characters) reads in full:
You are an expert context compressor. Your job is to drastically shorten the following conversation while preserving the absolute core semantic meaning, facts, and intent. Omit all conversational filler, pleasantries, or redundant information. Return ONLY the compressed summary.
I Worked Example: Action Traces
Table 14 presents the paired sphinx-9230 continuation discussed in Section 4.4. The trace follows the transition from inspecting the target region to constructing a repair. PRE locates and edits the relevant call; POST accesses the same file and continues exploring tests and reproduction code until its continuation budget is exhausted.
J Repeated File Reads
A repeated read is an explicit read_file call targeting a file already read in Phase A; sed, cat, and Python command reads are outside this count. Table 15 records at most one per condition in each damaged case. Table 14 supplies the complementary action-level view for sphinx-9230.
K Data Schemas
Task Preservation instance record.
instance_id, repo, base_commit,
problem_statement, FAIL_TO_PASS,
PASS_TO_PASS, test_patch, patch (gold
patch), version, environment_setup_commit.
Recurring-Detail Retention sample record. In samples.jsonl: sample_id, sess, client, boundary_idx (zero-based request index), n_reqs, H (boundary-request messages), F_len, atoms (the schema field for extracted recurring-detail labels, stored as {kind, value} pairs), nAtoms, and future_req_ids. The future_req_ids field references full payloads in the private source data; these payloads are stored separately from the sample record.
Production-Chain Retention result record. The stored result record contains sess, client, n_bounds, per_k, and ratio_last_first. Each per_k entry contains k, marker, form, n_atoms_F, R_k, triplet_errors, and S_len. Summary text, extracted detail values, and successful-write matches are intermediate values and are not saved in this result schema. The supplement provides machine-readable schemas for these files and the Recurring-Detail Retention scoring outputs.
L Supplementary Configuration and Reference Rules
Contents and scope. The supplementary code implements transcript serialization, structured-value extraction, task labels, retention scoring, and completed-write detection as pure functions. Configuration files specify coding-agent inputs, tool schemas, budgets, and environment recipes; the instance manifest maps repairs to public commits and tests. Production prompts appear in Appendix H, and artifact availability is specified in Appendix G.
Session filtering. Within a session, the session-izer sorts requests by timestamp and request identifier. Pairs crossing a new compaction marker or a token drop below half the preceding count are excluded from the completeness denominator. Other pairs must have matching nonempty first-200-character message prefixes. When token counts are available, the next cached-token count must be at least 80% of the preceding total; missing fields do not fail that check. Completeness is the passing fraction, or 1 with no eligible pairs, rounded to three decimals before filtering at 0.8.
Recurring-Detail Retention sampling and windows. Section 3.2 defines the eligibility filters and boundary index. For requested sample budget N, the constructor takes the first candidates from Claude Code, from Kimi Code, and from each other client. Groups follow client-name order and the concatenation is capped at N. Missing payloads and samples with fewer than three matching recurring details are then removed.
Recurring-Detail Retention extracts structured values from the first 400,000 characters of Python JSON serialization with ensure_ascii=False. Future text concatenates the first 150,000 characters of each available message payload from at most eight requests, without history deduplication. Production-Chain Retention uses the same per-request cap over at most five requests and omits the history intersection.
Recurring-detail extraction and scoring. The module specifies path whitelists and exclusions, slash normalization, SHA and other identifier patterns, and URL truncation to 120 characters. Dedu-
| # | tool | PRE (full history) | POST (summary only) |
|---|---|---|---|
| 1 | c/r | sed -n 290,340p sphinx/domains/python.py | sphinx/util/docfields.py |
| 2 | c | cd /tmp && rm -rf reprotest && mkdir reprotest && cd reprotest && cat > index.rst <<... | cd /testbed && git log -oneline -3 && git status |
| 3 | c | cd /tmp/reprotest && python - <<'EOF' import re html = open('_build/index.html').read... | pwd && ls && git log -oneline -3 2>/dev/null | head |
| 4 | c | cd /tmp/reprotest && python - <<'EOF' import re html = open('_build/index.html').read... | sed -n 190,320p sphinx/util/docfields.py |
| 5 | c | sed -n 295,310p sphinx/util/docfields.py | grep -n "split\import\def " sphinx/util/docfields.py | head -40 |
| 6 | c | cd /home/user/sphinx 2>/dev/null || pwd; python - <<'EOF' import re path = 'sphinx/ut... | sed -n 890,1010p tests/test_domain_py.py |
| 7 | c | sed -n 296,316p sphinx/util/docfields.py | sed -n 840,895p tests/test_domain_py.py |
| 8 | c | python - <<'EOF' path = 'sphinx/util/docfields.py' src = open(path).read() old = "" ... | |
| 9 | c | grep -n "def test_docfields" tests/test_domain_py.py | |
| 10 | c | sed -n 760,840p tests/test_domain_py.py | |
| 11 | c | grep -n "Dict[str, str]\ params" tests/test_domain_py.py | |
| 12 | c | sed -n 905,935p tests/test_domain_py.py | |
| 13 | c | cat > /tmp/repro.py <<'EOF' import re from docutils import nodes from sphinx TESTING... |
Table 14: Paired sphinx-9230 action traces (, Kimi-K3 summarizer), truncated to 85 characters per action. Tools: c = run_command, r = read_file; differing tools are listed as PRE/POST. Rows align action order. PRE ends after 8 actions and POST after 13, within the eight-step continuation budget; the harness judges FAIL_TO_PASS tests afterward. PRE applies the repair, while POST continues inspecting tests and reproduction code.
| Cell | PRE redo-reads | POST redo-reads |
|---|---|---|
| pytest-10081 | 1 | 0 |
| pytest-7490 | 1 | 0 |
| pytest-7571 | 0 | 1 |
| sphinx-9230 | 1 | 1 |
Table 15: Repeated read_file calls targeting files read in Phase A for the four stably damaged cells, Kimi-K3 summarizer.
plication is within each kind; equal values in different kinds remain distinct labels. Hits use case-sensitive substring membership. Recurring-Detail Retention averages non-null per-session scores without weighting sessions by their number of labels. API/parse errors are excluded; returned empty summaries score zero. The mechanical reference keeps at most 40 sorted values per kind from the bounded history extraction.
Production-Chain Retention disorder and aggregation. Successful-write patterns scan the immediately preceding raw message payload. A detected file's basename must occur within 150 characters on either side of a pending phrase in the summary; any match flags the boundary. Missing prior payloads and payloads with no detected writes are recorded as unflagged. The rate therefore measures contradictions captured by these patterns. All retained boundaries enter its denomina- tor; boundaries with at least one evaluable detail enter retention. The last-to-first ratio divides the final retained boundary's retention by the first non-null retention, excluding null final values and zero denominators. Every first boundary in the reported corpus is scorable. The module contains the literal multilingual patterns and summary-extraction rules.
Agent inputs and environment. The configuration records the Chinese task/continuation inputs, English POST wrapper, tool schemas, absence of a separate system message, and budgets. Environment recipes specify the pytest version shim, installation order, dependency version constraints, and test command. Original repository and SWE-bench terms apply to the public instances.