ClaudeCodeMod

All shelves / Mods / Usage

idle-compact

By davidar

idle-compact is a Claude Code usage mod by davidar.

Compacts an idle session after 50 minutes, while the prompt cache is still warm, and pins a status line under the prompt with the before and after sizes.

Draws

Install

The marketplace name is idle-compact.

In Claude Code
/plugin marketplace add davidar/claude-idle-compact
/plugin install idle-compact@idle-compact
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.5.0
License
MIT
Repo stars
4
Last change
2026-10-09

What it can reach

  • Draws in the session
  • Reads usage or context figures

Needs Claude Code 2.1.287 or later. It assumes the 1-hour prompt cache a Claude subscription gets within its usage limits; on a 5-minute cache, an API key, Bedrock, Vertex or Foundry by default, it has nothing to offer. Compaction is lossy: you come back to a summary, not the full transcript. Set idleMinutes (50) and minTokens (40000) with /plugin configure idle-compact@idle-compact. The README also lists it in the Anthropic Directory, as /plugin install idle-compact@anthropic-plugin-directory, reviewed by Anthropic before each version goes live; install one or the other, not both. To try it without installing: claude --plugin-dir /path/to/claude-idle-compact.

The marketplace, idle-compact, holds only this plugin. Saving on the prompt cache is why this page files it under usage. idle-compact, by noash-xrc, runs /compact on a session idle for 55 minutes with 120k tokens or more and shows a toast when it did. smart-compact, by hellosverre, offers /compact in a dialog above the prompt at good moments, before the prompt cache expires among them. This one asks nothing and waits 50 minutes with no activity. It leaves a conversation under 40k tokens alone, counting the Messages row of /context, and does not compact when the timer fires more than 10 minutes late, as when the machine slept. The compaction tells the summariser that you stepped away and to keep open tasks, decisions and their reasons, follow-ups with dates, file paths, and anything you asked to remember. It writes a line to the transcript and pins a status line under the prompt with the sizes and how much of the summary request the prompt cache served; the status line goes away when the next turn starts. The README's example is a 367k-token session. The transcript records the compaction as a manual one.

Demo

The What it does section of the author's README, on what idle-compact leaves behind: a line in the transcript and a pinned status line under the prompt reading idle-compact: compacted at 19:13 after 50 min idle (367k tokens to 12k summary, 99% read from cache), then how to read the two figures and the percentage. The numbers are the author's sample.
Screenshot of the author's GitHub page.

What it hooks into

  • turn.startWhen Claude starts a turn
  • turn.completeWhen a turn ends
  • session.endWhen a session ends
  • session.startWhen a session starts

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Files

The author's README and source, 4 files. They load when you open them.

Facts

Author
davidar
Category
Usage
Marketplace
idle-compact
Repo
davidar/claude-idle-compact
Version
0.5.0
License
MIT
Repo stars
4
Last change
2026-10-09
Language
TypeScript
Files
12

Other mods in Usage

compact-timinglbzepoqoLets the model mark task boundaries and compacts at the end of a turn once the context passes 200k tokens, then resumes the work; a toast shows each compaction.context-metervumichienDraws a band above the prompt with what fills the context window by category, a countdown to when the prompt cache expires, and a Compact button.usage-meterhamzaferDraws the 5-hour and 7-day plan limits as small bars above the prompt, with the reset countdown and what this session cost.context-barhamzaferDraws the context window as one stacked bar, a color per category, with token counts and the compaction point.token-weatherAnthropicDraws a one-line forecast of the context window above the prompt. Fuller goes from clear toward a storm.token-weatherhamzaferDraws the context-window forecast above the prompt, plus how long the prompt cache has left.cache-clockhamzaferDraws a prompt-cache line under the status line: time left while warm, hits and misses, and how many tokens the next message re-caches once it goes cold.openai-balancehamzaferDraws your OpenAI API credit above the prompt: an estimated balance, today's spend, where the money went, and the last call.cost-meterSingh-APHolds a commandDraws session cost, context fill, and the 5-hour and 7-day windows on the status line, plus each turn's cost. An optional budget asks before the next tool call.session-meterarasovicDraws a pane of context by category, the 5-hour and 7-day windows and their pace, and the last 30 tool calls and model requests.cache-timerarasovicDraws a countdown above the prompt until the prompt cache expires, then how many tokens the next message writes again.turn-footerarasovicDraws tool calls, subagents, requests, tokens, and cache hit rate under each answer, and the running tool in the spinner.
All 183 in Usage