Cache-aware online compaction

The idea

The main line compacts at a finished plan step only when the estimated cache-read savings are larger than the cost to rewrite, fold and carry.

The problem
Compaction triggered by size wasted the cache and sometimes cost more than it saved.
Why it matters
Compaction happens only when it pays, and each decision is recorded.
Where it stands
In production as of

A step-by-step replay of this idea is not published yet. The library adds one when a recorded run shows it.

  • Byte-stable prefix, one session per ticket

    The prefix stays reusable: one prompt and tool catalog per item, stage notes appended to the transcript, the model held within a stage, and cache breakpoints per provider. Claude Code runs as one live process.

Turn the numbers into shipped work.

Crewshal runs these choices for you: a persistent AI worker with memory and rules, on your Claude and Codex subscriptions.