idle-compact

idle-compact is a Claude Code mod by xyjk0511 that compact once after 50 idle minutes, while the 1h prompt cache is still warm. Works in the desktop app and SDK sessions too.

Updated 2026-10-04

What is idle-compact?

idle-compact is a Claude Code mod by xyjk0511 that compact once after 50 idle minutes, while the 1h prompt cache is still warm. Works in the desktop app and SDK sessions too. It is listed under Cost & usage and has no public popularity data yet.

TypeClaude code mod
Authorxyjk0511
Repositoryxyjk0511/idle-compact
Popularityno public popularity data yet
CategoryCost & usage
SecurityLow risk (88/100)
Rank#5,168 of 5,272 Claude Code mods; #1,017 in Cost & usage
LicenseApache-2.0
Last commit2026-10-04
Hooks5 events
Seescompaction
Draws onSessionMode

Is idle-compact safe to install?

idle-compact scores 88/100 on the MCPMods security check: Low risk. Things to review: starts processes outside the sandbox. It passed 7 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts processes outside the sandboxReview
Writes no files or configPass
Doesn't read environment variablesPass
Only sees the events it hooksPass
Doesn't drive ClaudePass
Passes claude plugin validatePass
Has an open-source licensePass

API calls in its code

CallWhat it means
$.clock.after
$.clock.now
$.command.rundrives Claude
$.process.runruns processes
$.session.compactdrives Claude
$.session.cwd
$.session.id
$.ui.invalidatedraws interface
$.ui.logdraws interface

How do I install idle-compact?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/xyjk0511/idle-compact
    claude plugin validate ./idle-compact/plugins/idle-compact
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add xyjk0511/idle-compact && claude plugin install idle-compact@idle-compact

Or ask Claude to set it up

Paste this into Claude Code and it installs idle-compact for you:

Install the "idle-compact" Claude Code mod from https://github.com/xyjk0511/idle-compact/tree/main/plugins/idle-compact. Run claude plugin validate on it first and show me what it can access before you enable it.