smart-compact
by Tartiner Labs · ★ 0 · updated 4 days ago
Compacts between turns when the context is full enough, sooner after a commit, PR, approved plan or finished todo list, or when the prompt cache is about to go cold or the 5-hour limit runs low.
Install
/plugin marketplace add tartinerlabs/claude-code-mods/plugin install smart-compact@tartinerlabs-modsThen 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.completetool.call- API calls
$.clock.every$.clock.now$.prompt.submit$.session.compact$.session.usage$.state.get$.state.set$.ui.toast- Can see
every tool call- Reach
- level 2 of 3 other: $.state.getother: $.state.setdrives 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/tartinerlabs/claude-code-mods
- Path in repo
plugins/smart-compact- Source commit
52eaa9cthe exact code the scan read- Author
- Tartiner Labs @tartinerlabs
- 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.
More from tartinerlabs/claude-code-mods
auto-resume
tartinerlabs/claude-code-mods
Sends "continue" once a usage limit resets, so a turn cut off by the limit picks up where it stopped.
auto-session-name
tartinerlabs/claude-code-mods
Names each session from its first prompt, and again a few prompts in when that one was short, so it is easy to find in /resume.
cache-clock
tartinerlabs/claude-code-mods
Counts down to the prompt cache going cold, with the last request's hit rate, above the prompt.
limit-watch
tartinerlabs/claude-code-mods
Draws the 5-hour and weekly usage limits and the session's cost above the prompt, limits coloured by use, with reset countdowns and toasts at 80% and 95%.
pr-pilot
tartinerlabs/claude-code-mods
Shows the current branch's pull request above the prompt, with its checks and whether it can merge, toasts when checks finish, and merges it, or its whole gh-stack stack, with /merge.
token-weather
tartinerlabs/claude-code-mods
A live forecast of the context window, drawn above the prompt.