idle-compact
by takahirom · ★ 17 · updated 10 days ago
Compact once after 50 idle minutes, while the 1h prompt cache is still warm.
Install
git clone https://github.com/takahirom/takahirom-claude-code-marketplaceclaude --plugin-dir ./takahirom-claude-code-marketplace/plugins/idle-compactThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
turn.startturn.completesession.compactsession.end- API calls
$.clock.after$.clock.now$.session.compact$.session.id$.ui.log- Can see
compaction- Reach
- level 2 of 3 drives Claudedraws
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/takahirom/takahirom-claude-code-marketplace
- Path in repo
plugins/idle-compact- Author
- @takahirom
- License
- Apache-2.0
- First published
- Last pushed
- First listed here
- On X
- Mentioned in 1 post on X
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
Posts about this repo
Claude Code を1時間放置するとキャッシュが切れて、再開時に履歴を全部処理し直すのでレートリミットをかなり消費しちゃう なので応答から50分放置されたら、切れる前に1回だけ compact する Claude Mod を作ってみた。入れておくと会議など間が空くときに節約できるかも。 https://github.com/takahirom/takahirom-claude-code-marketplace/tree/main/plugins/idle-compact