idle-compact
by ukwhatn · ★ 4 · updated 4 days ago
Compacts the main conversation once it has sat idle for idleMinutes, while the prompt cache is still warm, and hands every compaction of the main conversation (manual, auto, plugin, precompute) the Compact Instructions section of the user's AGENTS.md. Skips while a turn runs, below minMessageTokens of conversation, and past cutoffMinutes (a wake from sleep, when the cache has likely expired)...
Install
git clone https://github.com/ukwhatn/.claudeclaude --plugin-dir ./.claude/skills/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
session.startturn.startturn.completesession.compact- API calls
$.clock.after$.clock.now$.env.get$.fs.read$.session.compact$.session.usage$.state.get$.state.set$.ui.log- Can see
compaction- Reach
- level 2 of 3 drives Claudereads filesreads env varsreads mod statedraws
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/ukwhatn/.claude
- Path in repo
skills/idle-compact- Source commit
651162fthe exact code the scan read- Author
- @ukwhatn
- License
- No license declared — ask the author before reusing code.
- First published
- Last pushed
- First listed here
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.