optionOS optionOS

Compaction stops the agent; an active goal and the raw conversation resume it losslessly

How do I work?
Tags
  • WORKFLOWRepeatable working flow.
  • AI-DEVELOPMENTAI development practice.
  • EVIDENCE-UIUnderstood through visual evidence.
  • ANNOTATIONMark, number, box or arrow tied to a speech moment.

In long autonomous work with agents the biggest breaking point is compaction: when the agent's memory fills up it gets squeezed, and squeezing means summarization. Every summary is lossy — at 5–10% loss per pass, most of the work is gone after three or four compactions; this is why agents forget. My mechanism does not lose it. The frame below is a real moment of that mechanism; walk the nine marked regions in order.

A Codex agent stopped after compaction and resuming from its active goal Context compacted — the moment the agent's memory is squeezedPostCompact hook (stopped) — my hook stops the agent on purposeConversation interrupted — this is what the stop looks like in the terminalPursuing goal (3m) — the goal set before the work started is still activeGoal active — the Objective text stays exactly where the agent left itSessionStart hook — a second hook hands the conversation back<<<optionos:conversation-cap>>> — the injection's signature+2417 lines — the size of the raw conversation handed backThe tab strip — agent sessions running at the same time
·
Context compacted

Compaction is a summarization mechanism and it is lossy every time. At 5–10% loss per pass, most of the work is gone after three or four compactions; this is why agents forget.

Everything starts here: the agent's memory filled up and got compacted
Compaction stops the agent; the active goal and the raw conversation record resume it losslessly.

The compaction moment, the PostCompact hook that stops the agent, the active goal and the conversation-cap that hands the conversation back verbatim, all in one terminal frame.

The logic: I have a hook that stops the agent the moment its memory runs out. In Codex, content injected while the agent is running lands late; it lands when the agent stops. So I perform the stop before handing the conversation back.

A goal has already been set when the work starts. Whether I stop the agent or the hook does, the goal stays active, so the agent continues from where it stopped. Think of it as manually stopping and restarting the agent, with the goal re-stated in between.

Then another hook delivers the conversation: conversation-cap. It is not a summarization mechanism; it hands the context over directly. It trims the recent context with a specific calculation and delivers the valuable part — the signal — as it was. Human messages are carried verbatim, along with the agent's responses and the human's interactions. In this frame that hand-back is about 2,400 lines.

Does token usage go up? I believe it does not, but I have not measured it: because the agent also receives its own past behavior, it continues from where it left off with only the changed patches instead of re-researching from scratch.

The result is that agents can work fully autonomous this way — without loss. Otherwise they wrestle with compaction and forget, because summarization is the agent's default logic and the risk compounds every time. This is how I can work across many agents at once.

Requirements — currently unreleased. If you are asking "how do I use this myself": the mechanism stands on two pieces, and neither has shipped yet. When they ship they will appear in What's New.

1. optionOS hooks system — the hooks that catch compaction, stop the agent and restate the goal
2. agent transcript — the raw conversation record that conversation-cap is computed from