🚀NEW LABGetting Started with Claude AgentsStart lab
← All papers  /  Oct 27, 2026
Agents · Memory

CTXAgent - Self-Controlled Context Management of LLM Agents

First page
CTXAgent - Self-Controlled Context Management of LLM Agents
The curator’s take

Matthias Busch, Marius Tacke, Roland C. Aydin, Christian Feiler and Christian J. Cyron (Hamburg University of Technology, Helmholtz-Zentrum Hereon) give the model two context tools and one paragraph of guidance so it decides itself when to compact, what to keep and what to write as the hand-off.

Ask this paper

Key points
01

Setup. Seven frontier models are compared with and without the context tools under identical conditions, and the harness is compared with three widely used harnesses on two of them.

02

Benchmark. Sessions of 35 to 212 turns interleave coding exercises, SciCode problems, SWE-bench Pro and Terminal-Bench 4.0 tasks with planted facts, ephemeral observations and standing instructions, all checked deterministically.

03

Results. Most of the strongest models compact and curate regularly, keep live context mostly below 100k tokens, and mostly show no significant score drop. Cost savings vary because some models compact so often that other costs rise.

04

Claude Opus 5.5. With Opus 5.5 the self-managed harness matches Claude Code on task success at 34% lower cost than its explicit 200k-window configuration and 49% lower than its default.

Abstract

Agent harnesses keep long sessions inside the context window by compacting the history when a token threshold is crossed. We study an alternative in which the model manages its own context: it decides when to compact, what to keep and what to write as the hand-off, given two tools and one paragraph of guidance. Since earlier work found that open-weight models cannot manage their own context without scaffolding, we compare seven frontier models under identical conditions, with and without the context tools, on token cost and benchmark score, and we compare our harness with three widely used harnesses on two of these models. The benchmark is assembled from existing ones: coding exercises, multi-step SciCode problems and SWE-bench Pro and Terminal-Bench 4.0 tasks are interleaved with planted facts, ephemeral observations and standing instructions, all checked deterministically, in sessions of 35-212 turns that resemble a user working through different tasks in one chat. Most of the strongest models manage their context: they compact and curate regularly, the live context of the mixed sessions stays mostly below 100k tokens, and their benchmark scores mostly do not drop significantly. For the models that manage their context well, the cost reduction is substantial but varies between models, because some models compact so often that other costs increase. With Claude Opus 5.5, the self-managed harness matches Claude Code on task success at 34% lower cost than its explicit 200k-window configuration and 49% lower than its default, with no context window to choose. We release the agent, the benchmark and all result rows.

Every Monday
Get next week’s papers.
Subscribe on Substack