before-compact
by Walter Reid · ★ 0 · updated 27 days ago
Keeps your last turns, verbatim, across compaction. PreCompact hooks save the last turns verbatim, yours and the assistant's as two bundles (and the full arc beside them); SessionStart hooks re-inject each as its own block after compaction. /before-compact:recover does it on demand; /before-compact opens a monitor pane with the summary the engine installed.
Install
/plugin marketplace add walterreid/before-compact/plugin install before-compact@walterreid-pluginsThen 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
config.setsession.startcommand.runsession.compactclassic.PreCompactclassic.SessionStartui.render- API calls
$.clock.every$.command.register$.env.get$.fs.exists$.fs.list$.fs.read$.fs.stat$.fs.write$.model.complete$.process.run$.session.cwd$.session.id$.session.messages$.session.usage$.state.get$.state.set$.ui.invalidate$.ui.log$.ui.open$.ui.resolve$.ui.toast- Draws
Pane- Can see
compactionclassic hooks- Reach
- level 2 of 3 runs processeswrites filesdrives Claudereads filesreads env varsreads the transcriptreads 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/walterreid/before-compact
- Path in repo
before-compact- Source commit
3c10d74the exact code the scan read- Author
- Walter Reid @walterreid
- 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.
Related mods
Other mods in Panes, close to this one by stars.