Wait...what was I doing? A Case Analysis of How Compaction Methods Shape a Coding Agent's Continuity in Task and Metacognitive Stance

Felix Woolford, Keisuke Suzuki
11/28/2026
cs.AIcs.CLcs.SE

No confident code implementation found for this paper.

Abstract

When an LLM coding agent's context window fills, compaction replaces its history with something shorter. Compaction (context compression) methods are usually judged by whether relevant information survives or how a compacted agent performs on benchmarks.

Show full abstract

We instead ask whether the agent carried on in its task as it was doing before compaction. In the Pi coding-agent harness, we compare Pi's default model summary with two alternatives: transparent-compact-pi (TC), our own design, and pi-vcc, a third-party extension taking a similar approach. We tested them on a natural case from an agentic-coding session, in which an agent using a local model (Qwen3.8-27B) settled on a solution to its task, but after its first compaction, before building anything, changed course and produced a workaround. We forked the session just before compaction and varied the compactor over 35 runs per arm. TC continued the pre-compaction direction significantly more often than both alternatives; with compaction switched off the agent continued it in all 15 runs, supporting the test as a measure of continuity. Without TC's agent-facing guidance on the compacted state, the agent kept its direction somewhat, but not significantly, less often. Without access to the agent's earlier reasoning, TC still kept its direction significantly more often than the alternatives. We interpret the results as pointing to two carriers of an earlier decision across compaction: its explicit statement, here only in reasoning, and its implicit consequences, the prose and actions that followed it. TC appears to carry both more faithfully; a study on a second model (GPT-6.1 Terra) shows the same advantage for TC. We frame compaction as a metacognitive problem: it disrupts the agent's knowledge of its own intentions, and what the compacted context keeps of the agent's earlier words and actions shapes whether it can recognise its earlier plan.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{woolford2026waitwhat,
  title  = {Wait...what was I doing? A Case Analysis of How Compaction Methods Shape a Coding Agent's Continuity in Task and Metacognitive Stance},
  author = {Felix Woolford and Keisuke Suzuki},
  year   = {2026},
  eprint = {2611.38421},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.38421v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.38421.svg)](https://codeofpaper.com/paper/2611.38421)

Discussion