article feature
Context compaction: summaries that keep the kernel alive
Compaction summarizes older messages when context nears a threshold, keeping recent history and the persistent kernel state available. It is not a completion signal: goals, heartbeats, autonomous continuations, and running children continue. Overflow compaction can retry an oversized prompt after summarization.
Pinned repository file/line or test referenced in the audit.
Threshold compaction
Automatic compaction begins as the active conversation approaches a configured context threshold. Older messages are summarized while more recent history remains available to the model, reducing the prompt without discarding the entire session record.
The durable JSONL transcript still records the session path. Compaction changes the context supplied for continued reasoning, not the existence of the underlying session history.
Kernel persistence
The persistent IPython kernel is kept separate from conversational compaction. Variables, imports, and functions already present in the live namespace can remain usable after older messages have been replaced by a summary.
This is continuity, not a complete memory guarantee: an object can survive while the conversational explanation of why it exists is shortened or omitted. Durable names and files still matter.
Overflow retry
If a prompt exceeds the available context, overflow compaction can summarize and retry the request against the reduced history. The retry gives the model another chance without treating the first oversized prompt as final failure.
Success still depends on the model and the context budget remaining after summarization. Compaction cannot guarantee that every detail needed by an oversized request is retained.
Transcript summaries
Compaction summaries become part of the session record and stand in for older conversational spans during later model calls. They should be understood as lossy continuity aids, not byte-for-byte replacements for the messages they summarize.
Important decisions are safer when also captured in project artifacts or explicit current instructions, especially if later work depends on exact wording rather than the summary's main thread.
What this does not mean
A completed compaction does not mean the task has completed. Goals, heartbeats, autonomous continuation, and running child sessions can continue after the context has been shortened.
It also does not provide unlimited memory. Summaries are lossy, overflow retries remain model-dependent, and the policy for asynchronous kernel garbage collection is not fully documented.