sub-agent-compact
by Reza · Professor · ★ 0 · updated yesterday
0
Smart auto-compact for Claude Code: a separate compaction point for every sub-agent, and self-compaction at a milestone the model chooses.
Install
git clone https://github.com/rezzminator/sub-agent-compactclaude --plugin-dir ./sub-agent-compact/plugins/sub-agent-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.startprompt.submitturn.steptool.callclassic.Stopclassic.SubagentStartclassic.SubagentStopsession.compactturn.completesession.end- API calls
$.agent.list$.clock.after$.clock.now$.env.get$.fs.exists$.fs.list$.fs.read$.fs.stat$.fs.write$.process.run$.session.compact$.session.cwd$.session.id$.session.messages$.session.turns$.session.usage$.tool.check$.tool.register$.ui.log- Can see
every promptevery tool callclassic hookscompaction- Reach
- level 2 of 3 other: $.tool.checkruns processeswrites filesdrives Claudereads filesreads env varsreads the transcriptdraws
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/rezzminator/sub-agent-compact
- Path in repo
plugins/sub-agent-compact- Source commit
80c6632the exact code the scan read- Author
- Reza · Professor @rezzminator
- License
- MIT
- 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.