Claude Modsunofficial directory

Context & memory·terminal · desktop·Apache-2.0

idle-compact

Compacts an idle session once at minute 50, before the 1-hour prompt cache expires.

Generic Claude Mods cover used for idle-compact, which has no screenshots in its repository

idle-compact compacts your Claude Code session once after 50 minutes without activity, while the 1-hour prompt cache is still warm. It is for long sessions you walk away from: when you come back, the next turn starts from a short summary instead of the full context.

Install

Needs Claude Code 2.1.287 or later.

claude plugin marketplace add takahirom/takahirom-claude-code-marketplace
claude plugin install idle-compact@takahirom-claude-code-marketplace

There is nothing to run or configure. After each answer, a line in the transcript tells you at what time it will compact if you stay away.

How it works

The prompt cache keeps your context for an hour after the last request. Come back later than that and your first turn sends the whole context uncached, to be cached all over again; compact at minute 50 instead and the summary call reads that context from the still-warm cache, and you resume from a small one.

The compaction is a normal Claude Code compaction: one summary call over the whole conversation, which counts against your usage like /compact, and the summary replaces the detailed history. Afterwards a second line reports how much of that call’s input came from the cache; the README’s example is a 95% hit, with 74,482 tokens read and 2,813 uncached.

Only the end of a normal answer in the main conversation starts the timer, and there is never more than one. Sending a message, ending the session or any manual or automatic compaction cancels it. When it fires, the module checks the clock and the session id again, compacts only if 50 to 58 minutes have passed, and schedules nothing more until you send something.

It reads no prompts, commands or files, makes no network requests of its own and writes nothing to disk. The transcript lines are never sent to the model; everything else goes to the debug log.

cache-keepalive takes the other route: it keeps the cache warm while background tasks run instead of compacting.

Limitations

  • It assumes the 1-hour cache. Claude Code does not tell plugins the cache’s TTL, so the timer counts from the end of your last answer, and a session on the 5-minute TTL is not detected.
  • A late timer does nothing. If the machine sleeps and the timer fires after 58 minutes, it skips, because the cache may already be cold.
  • No retries. A compaction refused because a turn is running, DISABLE_COMPACT is set or the session is headless fails silently and is not tried again.

Similar Claude Mods

The whole directory →