Composable Cognition
Field note

Context Folding

An agent branches off to handle a sub-task, then folds that work back into a short summary — collapsing intermediate steps so its working context stays small.

What it is

Long-horizon agents drown in their own history: every tool call, observation, and dead end piles into the context window until recall degrades. Context folding attacks this directly. When an agent spins up a sub-task, it works in a branch, and on completion it discards the raw intermediate steps and folds only a compact summary back into the main thread.

The result is an agent that can run for hundreds of steps while keeping its live context an order of magnitude smaller than a flat ReAct loop — more signal, less rot.

Why it's worth watching

The composition angle

Context folding is composition in the time dimension: instead of one giant context, you compose a chain of small, summarized ones. It is the clearest example of why the future is many tightly-scoped contexts, not one infinite window.

Following context folding closely?

I'm collecting the papers, implementations, and failure modes as this technique matures. Leave an email to get the running notes.

Term: Context Folding. No spam — occasional notes as this develops.
Thanks — you're on the list. I'll be in touch as this develops.