idle-compact
Compacts once after ~50 idle minutes, while the 1h prompt cache is still warm.
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-pluginsRun these commands one at a time in a Claude Code session.
claude plugin marketplace add takahirom/takahirom-claude-code-marketplace
claude plugin install idle-compact@takahirom-claude-code-marketplaceThen run /reload-plugins in your session, or start a new session.
Please install the Claude Code mod "idle-compact" (https://github.com/takahirom/takahirom-claude-code-marketplace). 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 takahirom/takahirom-claude-code-marketplace and claude plugin install idle-compact@takahirom-claude-code-marketplace, 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/takahirom/takahirom-claude-code-marketplace
cd takahirom-claude-code-marketplace
claude --plugin-dir ./plugins/idle-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 session id, the clock, and usage fields on the compact result for the timer and cache-hit notice.
Writes files
UnspecifiedNo file writes seen; only transcript notices via the UI log API.
Runs commands
UnspecifiedNo external process launches seen; the author published no Security section.
Network
YesIdle $.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.