Compact before the cache runs out
Providers cache a conversation for a limited time. Come back to a large thread after that, and your next message re-reads the whole context without the cache, at full price or from your plan's usage. Idle Compact compacts large idle Claude Code and Codex threads in BB just before the cache expires, while compaction can still read cached tokens.
A pill in the composer tells you what happens next, so the plugin never compacts silently.
What you get
- Compact before expiry. An idle thread above your threshold is compacted a few minutes before its prompt cache expires. On by default, 5 minutes before.
- Compact before sending. If the cache already expired, your next message waits while the thread compacts, then sends.
- A composer pill. It shows "Auto-compacts in 23m" while the cache is warm, "Compact 412K" in red once it expired, "Compacting" while it runs, and "Compacted 412K to 68K" until your next message. Click the first two to compact now.
- Threshold and settings. A thread qualifies over a percentage of the model's window (20% by default) and at least 100K tokens. Per-provider overrides and the Codex cache lifetime are in settings.
- Stats. The settings page shows the last 30 days: compactions, tokens not re-read, and compactions before expiry versus on return.
Compaction uses BB's own /compact and keeps a summary, not the full history. Claude Code reports its cache lifetime. Codex does not, so the plugin starts at 30 minutes and learns a longer one from cache hits. Cursor is not supported.
Install Idle Compact
Idle Compact requires BB 0.50.1 or a later 0.50.x release. Install it from BB Marketplace:
bb plugin install bb-idle-compactTurn it off or on with the switch in Settings > Idle Compact.
See the GitHub repository for screenshots, settings, and release details.








