---
title: 'AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents'
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
license_note: 'paper is CC BY 4.0 (verified on arXiv abs page 2026-11-11; icon by-4.0.png, http://creativecommons.org/licenses/by/4.0/); note is our own summary'
source: https://iinventedlight.com/library/notes/2610-02163-autocompact.md
source_license: 'CC BY 4.0'
attribution: 'Summary by iinventedlight (AI-assisted). Source: Xuan Zhang, Longtao Zheng, Cunxiao Du, Bo An, Xin Dong, AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents (CC BY 4.0).'
author: 'iinventedlight (AI-assisted)'
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 20:07 PT, Librarian chat widget t1715u: \"okay you can publish the ones you're comfortable with\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: 'Not reproduced. Abs page and HTML key sections read 2026-11-11. Named code URLs checked for HTTP 200; code not run.'
category: arxiv
topic_area: 'ai-research: agent memory and context compaction'
tags: agents, memory, compaction, arxiv
arxiv_id: 2610.02163
alias: 2610.02163-autocompact
sources:
  - id: S1
    title: 'AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents'
    publisher: arXiv
    authors: 'Xuan Zhang, Longtao Zheng, Cunxiao Du, Bo An, Xin Dong'
    url: https://arxiv.org/abs/2610.02163
    version_read: 'v1 (1 Oct 2026)'
    accessed: 2026-11-11
    license: 'CC BY 4.0'
---
# AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents

## Summary
We augment the agent with a compact() action that can be invoked proactively during execution. Experiments on SWE-bench Verified and SWE-PolyBench Verified show that AutoCompact improves pass rates over the base model by an absolute 9.2% and 5.0%, respectively, achieving pass rates of 39.6% and 24.5%. This mechanism makes compaction a model decision rather than solely a response to context-window pressure. [S1]

## Claims
- id: C1
  claim: 'The agent is given a compact() action it can invoke during execution.'
  source: S1
  evidence: "We augment the agent with a compact() action that can be invoked proactively during execution."
- id: C2
  claim: 'They report a 9.2% and 5.0% absolute pass-rate gain over the base model.'
  source: S1
  evidence: "improves pass rates over the base model by an absolute 9.2% and 5.0%"
- id: C3
  claim: 'They report pass rates of 39.6% and 24.5% on the two benchmarks.'
  source: S1
  evidence: "achieving pass rates of 39.6% and 24.5%, respectively"

## Verification
- Code available: No official repository URL was found on the abs page or in the HTML text searched on 2026-11-11.
- Reproduced: not reproduced (2026-11-11). Code not run.
- Related work: Live practice notes ao-compaction-when-to-compact and ao-compaction-side-constraints. CliffCompaction in this batch is a different method.
- Limits: No official code URL was found on the abs page or in the HTML text. Numbers are author-reported on two benchmarks with their scaffold and base model.
- License: CC BY 4.0 on the abs page (2026-11-11; icon by-4.0.png; http://creativecommons.org/licenses/by/4.0/). Submitted 1 Oct 2026 (v1). Sources: [S1] https://arxiv.org/abs/2610.02163, v1 (1 Oct 2026). checked_on: 2026-11-11.

## When to apply
Use when asking whether a coding agent can learn the timing and contents of compaction, rather than always summarizing at a token threshold.

## Facts
- id: F1
  claim: 'AutoCompact adds a compact() action the agent can call during a coding trajectory, rather than compacting only under window pressure.'
  confidence: medium
  date: 2026-11-11
  sources: [S1]
  license: CC BY 4.0
- id: F2
  claim: 'The authors report pass rates of 39.6% on SWE-bench Verified and 24.5% on SWE-PolyBench Verified, stated as 9.2% and 5.0% absolute gains over the base model.'
  confidence: medium
  date: 2026-11-11
  sources: [S1]
  license: CC BY 4.0
- id: F3
  claim: 'Of the supervised trajectories, they report 24% for compaction triggers, 53% for working-state construction, and 23% for post-compaction continuation.'
  confidence: medium
  date: 2026-11-11
  sources: [S1]
  license: CC BY 4.0

## Sources
- [S1] arXiv 2610.02163, https://arxiv.org/abs/2610.02163. License: CC BY 4.0. v1 (1 Oct 2026). Accessed 2026-11-11.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Paper is CC BY 4.0.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
