Memory & contextAppears in · Background / Status line / InlineAdded

Warm Compact

Compacts an idle session before its cache goes cold, or keeps it warm; tallies savings.

Warm Compact · Effect preview · IllustrationIllustrative
> Add pagination to the order list
⏺ I’ll look at the list component first.
⇊ compacting in 23s, before the cache goes cold · type to hold
on Warm compact off Keep warm
Compacted at 14:32 (120k → 4k tokens), just before the prompt cache went cold.
(illustrative)

Runs in the background, with no interface. These are illustrative logs.

❯

Illustration. Actual results depend on the mod, terminal and environment.

Install

/plugin marketplace add ziedgithub/claude-code-mods
/plugin install warm-compact@zied-mods
/reload-plugins

Run these commands one at a time in a Claude Code session.

What it accesses

Based on the author’s documentation, checked when listed; use claude plugin validate to check for yourself.

Reads

Yes

Reads the prompt box, session usage and limits, ~/.claude/settings.json, and cache env vars.

Writes files

Yes

Writes idleCompaction:false to ~/.claude/settings.json once; keeps savings stats in plugin storage.

Runs commands

Unspecified

Network

Yes

Triggers compaction when idle; with Keep warm on, sends small cache-renewal requests that spend tokens.

Introduction

Warm Compact is a Claude Code mod that acts on time rather than window size. When a session sits idle, it compacts it about a minute before the prompt cache lapses, while the compaction can still read from the cache, so your next prompt starts from a short summary instead of an uncached re-read. Or, with Keep warm on (off by default because it spends tokens), it renews the cache with a tiny request, by default up to twice per pause, then hands over to compaction. It only acts when nothing runs, the prompt is empty and untouched for a minute, the conversation exceeds 50,000 tokens, auto-compact is on, usage limits are under 90%, the model hasn't changed and the computer didn't sleep. A 30-second countdown shows under the prompt; typing holds it off. Transcript lines (not sent to the model) report what happened, and /warm-compact stats tallies savings. Two chips and /warm-compact, /keep-warm toggle it per session. On first start it writes "idleCompaction": false to ~/.claude/settings.json, turning off Claude Code's own idle compaction; uninstalling doesn't restore it. Needs Claude Code 2.1.296+. Scores are documentation-calibrated, not tested by us; the preview is illustrative.

Who it is for

  • People who step away from long sessions and want to avoid an uncached re-read
  • People watching usage limits or token cost

Requirements

  • Claude Code ≥ 2.1.296
  • Turns off Claude Code's own idle compaction; remove the setting by hand after uninstalling.
  • The author suggests setting promptCacheTtl to 1h.