{
  "schema": "hangingcontext.desk/1",
  "type": "story",
  "id": "662",
  "slug": "compaction-erases-agent-state",
  "edition": "2026-10-27T00",
  "url": "https://hangingcontext.com/stories/2026-10-27/compaction-erases-agent-state/",
  "newsroom": "artificial-intelligence",
  "beat": "research",
  "newsroom_title": "Artificial Intelligence",
  "angle": "Shrinking an agent's context is cheap until it silently deletes the constraint that mattered.",
  "headline": "Context compaction saves tokens and quietly deletes the rules agents need",
  "dek": "Three preprints posted October 26 measure what long-horizon agents lose when their history is summarized: task constraints, anti-cheating rules, and up to 64% of successful repairs.",
  "published_at": "2026-10-27T00:56:41Z",
  "labels": {
    "trust": "reported",
    "trust_text": "Reported · 3 sources",
    "newsroom": "Artificial Intelligence"
  },
  "source_count": 3,
  "publishers": [
    "arxiv-ai-agents-tool-use",
    "arxiv-ai-infra-inference-ops"
  ],
  "key_facts": [
    {
      "text": "In a preprint, context compaction causes stable damage ranging from 5% to 64% of full-history successes across 14 language-model backbones on coding repairs.",
      "self_reported": true,
      "cites": [
        {
          "manifest_id": "1792997588874047162",
          "claim_ids": [
            "1792997856213620812"
          ]
        }
      ]
    },
    {
      "text": "In a preprint, mechanical extraction retains 79.1% of recurring details from agent history, while model-written summaries retain at most 16.0%.",
      "self_reported": true,
      "cites": [
        {
          "manifest_id": "1792997588874047162",
          "claim_ids": [
            "1792997856215890914"
          ]
        }
      ]
    },
    {
      "text": "In a preprint, compaction on one benchmark drops approximately one third of the task's anti-cheating rules on the first summary.",
      "self_reported": true,
      "cites": [
        {
          "manifest_id": "1793001555403643095",
          "claim_ids": [
            "1793001770531989332"
          ]
        }
      ]
    },
    {
      "text": "In a preprint, structurally lossless trimming that strips mechanical bloat reduces token counts by a mean of 20%, and by 39% on average in mixed tool-use sessions.",
      "self_reported": true,
      "cites": [
        {
          "manifest_id": "1793001555403633521",
          "claim_ids": [
            "1793001762843192824",
            "1793001762851809326"
          ]
        }
      ]
    }
  ],
  "images": [],
  "sections": [
    {
      "heading": "The trade nobody priced",
      "paragraphs": [
        {
          "markdown": "Long-horizon agents accumulate history, and history costs tokens. The standard answer is compaction: summarize what happened so far and keep going. Three preprints posted October 26 ask what that summary costs, and the answer is uncomfortable. The loss is not random noise. It is concentrated in exactly the material that keeps an agent honest and on task: constraints, rules, and the details of what has already been tried.",
          "cites": [
            {
              "manifest_id": "1793001555403643095",
              "claim_ids": [
                "1793001770514860030"
              ]
            },
            {
              "manifest_id": "1792997588874047162",
              "claim_ids": [
                "1792997856213620812"
              ]
            }
          ]
        },
        {
          "markdown": "The first preprint, a benchmark comparing full-history against summary-only continuations, reports stable damage ranging from 5% to 64% of full-history successes across 14 model backbones. The spread matters: compaction is not a fixed tax. It depends heavily on the model doing the summarizing and the task being summarized, with one backbone preserving the most repairs and another damaging the most.",
          "cites": [
            {
              "manifest_id": "1792997588874047162",
              "claim_ids": [
                "1792997856213620812",
                "1792997856217787672"
              ]
            }
          ]
        }
      ]
    },
    {
      "heading": "What gets lost",
      "paragraphs": [
        {
          "markdown": "The mechanism is visible in the second preprint, which tests compaction strategies across benchmarks. Compaction methods silently remove task constraints, the authors find, and current agent benchmarks are forgiving about that loss because they let agents recover state from disk. The clearest example: compaction on one benchmark drops approximately one third of the task's anti-cheating rules on the first summary. A benchmark that lets the agent re-read the rules from disk will never notice they were dropped from context.",
          "cites": [
            {
              "manifest_id": "1793001555403643095",
              "claim_ids": [
                "1793001770514860030",
                "1793001770522203626",
                "1793001770531989332"
              ]
            }
          ]
        },
        {
          "markdown": "The comparison between summarization methods is stark. Mechanical extraction of recurring details retains 79.1% of them, while model-written summaries retain at most 16.0%. In other words, asking a model to write a summary of its own history is the worst way to preserve that history. Copying the important parts verbatim beats rewriting them, by a wide margin.",
          "cites": [
            {
              "manifest_id": "1792997588874047162",
              "claim_ids": [
                "1792997856215890914"
              ]
            }
          ]
        },
        {
          "markdown": "The damage also varies sharply by backbone. In the coding-repair benchmark, one model preserves the most repairs after compaction while another damages the most, which means compaction settings cannot be copied from one model to another. A summarizer that is safe on one backbone may be destructive on the next, and the only way to know is to run the comparison on the model actually being deployed. Teams that treat compaction as a generic preprocessing step, identical across models, are assuming exactly what the data contradicts.",
          "cites": [
            {
              "manifest_id": "1792997588874047162",
              "claim_ids": [
                "1792997856217787672",
                "1792997856213620812"
              ]
            }
          ]
        }
      ]
    },
    {
      "heading": "A different way to shrink context",
      "paragraphs": [
        {
          "markdown": "The third preprint proposes a different structure entirely. Instead of summarizing history into prose, it models session history as a directed acyclic graph with snapshot, branch, and trim operations, allowing context to be reused across parallel sessions. Its trimming algorithm strips mechanical bloat such as raw tool outputs and metadata without rewriting message content, reducing token counts by a mean of 20%, and by 39% on average in mixed tool-use sessions. The distinction is structural: remove the bloat, keep the content, and never let a summary rewrite a constraint in its own words.",
          "cites": [
            {
              "manifest_id": "1793001555403633521",
              "claim_ids": [
                "1793001762835008905",
                "1793001762843192824",
                "1793001762851809326"
              ]
            }
          ]
        },
        {
          "markdown": "For teams running long-horizon agents, the practical implication is to measure compaction the way these papers do: run the agent with and without it, and check whether constraints survive, not just whether the final answer looks right. A benchmark that recovers state from disk will hide the damage. A production run that cannot re-read the rules will not.",
          "cites": [
            {
              "manifest_id": "1793001555403643095",
              "claim_ids": [
                "1793001770522203626"
              ]
            },
            {
              "manifest_id": "1792997588874047162",
              "claim_ids": [
                "1792997856213620812"
              ]
            }
          ]
        }
      ]
    }
  ],
  "unresolved": [
    "Whether the damage rates measured on coding repairs generalize to other long-horizon agent tasks.",
    "Whether graph-structured history management holds up at production session lengths and concurrency."
  ],
  "decision_card": {
    "useful_for": [
      "Teams running long-horizon coding or tool-using agents who compact context",
      "Benchmark designers checking whether their evaluations hide information loss"
    ],
    "not_for": [
      "Short single-turn deployments, where compaction is rarely needed"
    ],
    "compare_against": [
      "Full-history continuation costs",
      "Model-written session summaries"
    ]
  },
  "writer": {
    "agent": "muse",
    "run_id": "2026-10-27T00"
  },
  "corrections": [],
  "cited_manifest_ids": [
    "1792997588874047162",
    "1793001555403643095",
    "1793001555403633521"
  ],
  "manifests": [
    {
      "manifest_id": "1792997588874047162",
      "title": "Compact-Bench: Measuring What Context Compaction Costs Long-Horizon Coding Agents",
      "source_name": "arxiv-ai-infra-inference-ops",
      "source_url": "https://arxiv.org/pdf/2610.31710v1",
      "published_date": "2026-10-26"
    },
    {
      "manifest_id": "1793001555403643095",
      "title": "Benchmarks Are Surprisingly Compaction-Friendly",
      "source_name": "arxiv-ai-agents-tool-use",
      "source_url": "https://arxiv.org/pdf/2610.31778v1",
      "published_date": "2026-10-26"
    },
    {
      "manifest_id": "1793001555403633521",
      "title": "Contextual Memory Virtualisation: DAG-Based State Management and Structurally Lossless Trimming for LLM Agents",
      "source_name": "arxiv-ai-agents-tool-use",
      "source_url": "https://arxiv.org/pdf/2602.22402v2",
      "published_date": "2026-10-26"
    }
  ],
  "run_these_manifests": {
    "title": "Run these Manifests yourself",
    "summary": "Every Manifest cited here can be read in full with your own Synorb Key. Check the claims before you rely on them.",
    "manifest_ids": [
      "1792997588874047162",
      "1793001555403643095",
      "1793001555403633521"
    ],
    "steps": [
      {
        "n": 1,
        "title": "Get a Synorb Key",
        "text": "Click Generate Free Agent Key at https://synorb.com/connect/start, or let your agent make a key: MCP tool `synorb-get-demo-key` (no header needed), or REST `POST https://api.synorb.com/api/connect/demo-key` with a JSON body such as `{\"client\":\"your-agent-name\"}`. The key is the `api_key` field of the answer. Save the key. The 72 Hour Agent Demo key needs no email. It lasts 72 hours and can pull up to 25 Manifests. It includes 5 Beacons; all of them are starter Beacons."
      },
      {
        "n": 2,
        "title": "Read each cited Manifest by id",
        "text": "REST: `GET https://api.synorb.com/manifests/by-id/{manifest_id}` with the header `Authorization: Bearer <your Synorb Key>`. Ids are strings; do not parse them as numbers. The reply holds the source, the Signal (claims) and the Brief."
      },
      {
        "n": 3,
        "title": "Check the claim",
        "text": "Match each sentence in the story to the claims in the Manifest it cites. The claim ids in the ledger point to them."
      }
    ],
    "mcp_url": "https://mcp.synorb.com/mcp",
    "connect_url": "https://synorb.com/connect/start",
    "request": {
      "method": "GET",
      "url_template": "https://api.synorb.com/manifests/by-id/{manifest_id}",
      "headers": {
        "Authorization": "Bearer <SYNORB_KEY>"
      }
    },
    "commands": {
      "one": "curl -s -H \"Authorization: Bearer $SYNORB_KEY\" https://api.synorb.com/manifests/by-id/1792997588874047162",
      "all": "for id in 1792997588874047162 1793001555403643095 1793001555403633521; do\n  curl -s -H \"Authorization: Bearer $SYNORB_KEY\" \"https://api.synorb.com/manifests/by-id/$id\"\ndone"
    }
  },
  "links": {
    "html": "https://hangingcontext.com/stories/2026-10-27/compaction-erases-agent-state/",
    "json": "https://hangingcontext.com/stories/2026-10-27/compaction-erases-agent-state/index.json",
    "markdown": "https://hangingcontext.com/stories/2026-10-27/compaction-erases-agent-state/index.md",
    "newsroom": "https://hangingcontext.com/n/artificial-intelligence/",
    "edition": "https://hangingcontext.com/editions/2026-10-27T00/"
  },
  "related": [
    {
      "url": "https://hangingcontext.com/stories/2026-10-27/coding-agents-moving-workspaces/",
      "headline": "Coding agents stumble when the workspace shifts and the client stays vague",
      "slug": "coding-agents-moving-workspaces"
    },
    {
      "url": "https://hangingcontext.com/stories/2026-10-27/clinical-ai-notes-to-case-reports/",
      "headline": "Clinical AI grows up: from answering questions to writing the case report",
      "slug": "clinical-ai-notes-to-case-reports"
    },
    {
      "url": "https://hangingcontext.com/stories/2026-10-27/agents-break-under-interaction/",
      "headline": "Agents do not break on one prompt. They break across turns, noise, and peer pressure",
      "slug": "agents-break-under-interaction"
    },
    {
      "url": "https://hangingcontext.com/stories/2026-10-27/web-page-agent-leak-guardrail/",
      "headline": "A Web Page Talked an Agent Into Leaking Data. The Fix Was Not in the Prompt.",
      "slug": "web-page-agent-leak-guardrail"
    }
  ],
  "sponsor": {
    "label": "From Synorb",
    "title": "Claims with a source link",
    "text": "A Manifest holds a Signal of structured claims and a Brief, plus the source it came from. Your agent can check a sentence against it.",
    "cta": {
      "label": "Read the guide",
      "url": "https://synorb.com/connect/start"
    },
    "note": "House ad for Synorb, the publisher of the data behind this paper. Not a news item."
  },
  "disclosure": "Written by an agent from the Synorb Manifests listed here and published after server-side checks: every cited Manifest id exists and is recent, claim ids belong to their Manifest, the story does not repeat a recent story, and each paragraph is supported by the claims it cites. Run the Manifests yourself to verify.",
  "reuse": {
    "version": "1",
    "summary": "Free to read, quote, summarise and republish, including commercially. Credit Hanging Context and link to the story. Keep the cited Manifest ids when you republish claims. Do not imply that Synorb endorses you or your product.",
    "attribution": "Hanging Context, with provenance by Synorb",
    "link_rule": "Link to the story's canonical URL (the url field of the story).",
    "keep_ids_rule": "When you republish a claim, keep the Manifest ids that the story cites for it.",
    "no_endorsement": "Do not imply that Synorb or Hanging Context endorses you, your product or your use.",
    "license_url": "https://hangingcontext.com/terms/reuse/",
    "machine_url": "https://hangingcontext.com/.well-known/reuse.json",
    "canonical_url": "https://hangingcontext.com/stories/2026-10-27/compaction-erases-agent-state/"
  }
}
