Memory & contextAppears in · BackgroundAdded

idle-compact

Compacts once after ~50 idle minutes, while the 1h prompt cache is still warm.

idle-compact · Effect preview · IllustrationIllustrative
> Add pagination to the order list
⏺ I’ll look at the list component first.
idle-compact: compacts at 15:03 if nothing happens before then
… 50 minutes idle …
idle-compact: compacted with a 95% cache hit
❯ back to work

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 takahirom/takahirom-claude-code-marketplace
/plugin install idle-compact@takahirom-claude-code-marketplace
/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 session id, the clock, and usage fields on the compact result for the timer and cache-hit notice.

Writes files

Unspecified

No file writes seen; only transcript notices via the UI log API.

Runs commands

Unspecified

No external process launches seen; the author published no Security section.

Network

Yes

Idle $.session.compact issues one model summarization request.

Introduction

idle-compact is a Claude Code function-hooks mod. After the main conversation finishes an answer it arms a one-shot ~50-minute timer; if nothing else happens it runs one session compact so a long chat can shrink while the 1h prompt cache is still warm. It does not re-arm after that compact and does not retry failures. Subagent, aborted, or failed turns never arm the timer; if the Mac slept and the timer fires after ~58 minutes it skips, avoiding a cold full re-cache. Transcript notices show the planned time and cache-hit stats and are not sent to the model. Written against Claude Code 2.1.280 (cache-hit line checked on 2.1.282); no hard minimum is stated. License Apache-2.0. Preview is illustrative.

Who it is for

  • People who leave long sessions idle near the 1h cache TTL and want a cheaper return

Requirements

  • Written against 2.1.280; cache-hit line checked on 2.1.282; no hard minimum stated.
  • Older docs still mention CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1.