[09.2025]

My first year at CMU started. Everything was new. My research topic—coding agents—was new to me too. I spent some time exploring it, trying different directions and looking at different problems, but nothing really clicked with me.

I ended my first semester feeling quite unhappy. I didn’t like it. :(

[01.2026]

The new semester began. I came back to coding agents and restarted my research, this time focusing on long-context, long-horizon coding agents. Mostly because that was the problem that bothered me the most when I used coding agents myself. (It was also kind of a thing back then—and maybe still is now.)

At the time, agents were generally considered not very good at long-horizon tasks or at working with long contexts. Coding agents struggled to make use of old observations and derive meaningful insights from their long, long trajectories.

I tried several approaches to help coding agents better interpret their past actions and observations. Some worked better than others, but none of them felt like the one. I didn’t find any of the solutions particularly exciting or interesting.

[03.2026]

Eventually, I got bored of trying to make coding agents better at interpreting their own trajectories, so I started thinking backward.

If coding agents aren’t very good at making use of their long, long context, why do we keep all of it in the context?

If it’s not that helpful, maybe we should just let it go. :)

Our lab has a shared toolkit for agents, and my advisor Tim had built a cool autocompaction tool for it. It fit perfectly with my pivot, so we started working on it.

That’s where CliffCompaction begins.

Kimi K3

88 90 92 91.2 full context 90.8 cliffcompaction −2.4 ran out of steps +2.0 patch quality

GLM 5.3

88 90 92 92.4 full context 89.0 cliffcompaction −3.8 ran out of steps +0.4 patch quality
SWE-bench Verified, CliffCompaction at 16K.
Top pair: resolve rate.
Bottom pair: what the difference is made of.

[04–07.2026]

CliffCompaction showed promising results in the paper. On two of the three benchmarks we tried—Terminal-Bench 2.0/2.1 and KernelBench—CliffCompaction showed no performance degradation with a far more constrained context, and sometimes even outperformed the models’ full context.

The one result that still bugged me was SWE-bench Verified.

CliffCompaction cut cost and wall-clock time, but it consistently made trajectories longer. When we labelled what the agent did at every step, the extra steps turned out to be almost entirely one thing: re-reading files it had already opened. After a compaction, the agent went back for information that was no longer in its active context.

For our SWE-bench Verified experiments, we capped each trajectory at a fixed number of steps. For a run already approaching that limit, the extra re-reading left less room to finish. Sometimes, the agent hit the cap before it could submit anything at all.

When we separated out those failures, almost all of the score drop came from runs that never submitted. The patches that did come out were as good as or better than the full-context ones.

We saw the effect of this budget more clearly in our newer experiments with Kimi K3 and GLM 5.3. Kimi K3 produced shorter trajectories, so it had enough room to absorb the extra re-reading. GLM 5.3 ran much longer, so the same behavior was more likely to push it into the cap.

I first viewed this as a drawback. But then I changed my perspective: the re-reading itself was not the failure it first appeared to be. Instead of carrying everything forward, the agent could decide what information it needed and bring it back into the context.

In the paper, we showed that this re-reading was not wasted work. It was how the agent recovered what it needed after compaction, and a large part of why CliffCompaction performed as well as it did.

CliffCompaction gives the agent more control over what it brings back into its active context.

So, CliffCompaction lets the agent spend more of its effort understanding the context and less on making changes—at a lower cost, in less time, and with work of similar or better quality.

I came to cherish this imperfection of CliffCompaction. It made me want to rethink the long-horizon coding-agent problem.

It is amazing that models now support increasingly large context windows, reaching around one million tokens. But perhaps the goal should not only be to make models work better with more and more context. We can also make agents just as capable when the context is small.

Turns out, minimalism looks good on agents too. :)

[08.2026]

For the experiments in the paper, we had to implement CliffCompaction separately inside each agent scaffold. CliffCompaction itself is simple and easy to implement, but we were not fully happy with this setup.

We know that people have their own favorite scaffolds, models, and setups. We wanted to build something that as many people as possible could use.

So, we moved CliffCompaction to the API level. It can now be plugged into different scaffolds and models without changing the agent itself. We wanted it to be minimal, general, and as smooth and transparent as possible.

I recently learned in one of my courses that the best systems are often the ones we can take for granted. That became my motto when building the CliffCompaction API.

Users should not have to notice when compaction happens or even think about managing their context. It should simply work in the background while they focus on what they actually want to do.

We have been using this version of CliffCompaction for the past few weeks, and it has been working well. I have left it enabled in my own setup the entire time and often completely forgotten that it was there—which is exactly what we wanted when building it.

Before CliffCompaction, I rarely let an agent run for very long. I always felt that its performance started to degrade as the context became more bloated.

Waiting for LLM summarization also usually takes a few minutes. It does not sound like much, but it interrupts my mental flow and deep focus. With the CliffCompaction proxy, I can stay in my working flow more consistently. I genuinely feel much more productive with it.

I have used CliffCompaction for sessions with millions of tokens without even noticing. Tim has even run sessions with more than a hundred million. :O

CliffCompaction keeps not only agents on track, but the people using them, too.

That is exactly how I want CliffCompaction to feel.

So, on 09.23.2026, we are releasing it.

I hope CliffCompaction can become something you take for granted too. :)

Photo 4 - full height

A special shout-out to Tim—I learned so, so, so much from you while working on CliffCompaction. Your creative perspectives and ideas constantly amaze me, and working with you has changed the way I approach research in so many ways. I’m really excited for everything I’ll continue to learn from you in the years ahead.