Warm Compact
Compacts an idle session before its cache goes cold, or keeps it warm; tallies savings.
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-pluginsRun these commands one at a time in a Claude Code session.
claude plugin marketplace add ziedgithub/claude-code-mods
claude plugin install warm-compact@zied-modsThen run /reload-plugins in your session, or start a new session.
Please install the Claude Code mod "Warm Compact" (https://github.com/ziedgithub/claude-code-mods). Before installing, read the Security and Requirements sections of its README and tell me what it reads and writes, which commands it runs, whether it uses the network, and which Claude Code version, OS and terminal it needs. If everything looks fine, run claude plugin marketplace add ziedgithub/claude-code-mods and claude plugin install warm-compact@zied-mods, then remind me to run /reload-plugins in my session.Send this to Claude Code so it reads the author’s instructions before installing.
git clone https://github.com/ziedgithub/claude-code-mods
cd claude-code-mods
claude --plugin-dir ./warm-compactClone the repository and try it in a local session with --plugin-dir.
What it accesses
Based on the author’s documentation, checked when listed; use claude plugin validate to check for yourself.
Reads
YesReads the prompt box, session usage and limits, ~/.claude/settings.json, and cache env vars.
Writes files
YesWrites idleCompaction:false to ~/.claude/settings.json once; keeps savings stats in plugin storage.
Runs commands
UnspecifiedNetwork
YesTriggers 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.