smart-compact is a Claude Code usage mod by hellosverre.
Offers /compact in a dialog above the prompt at good moments: after a commit, when tests go green, before the prompt cache expires, or when Claude asks.
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
Version
0.3.1
License
MIT
Repo stars
4
Last change
2026-10-20
What it can reach
Draws in the session
Reads usage or context figures
Sees tool calls
Runs a command when you press
Calls another program on this machine
Claude Code 2.1.295 or later, in a terminal or the desktop app's Code tab. Restart Claude Code after installing. Nothing shows until the context is 40% full (minPercent). onRequest set to auto compacts as soon as Claude asks, idleCompact compacts a minute before the cache expires, and cacheTtlMinutes is 60 for the 1-hour cache. Where the session cannot compact itself, as in the desktop app's Code tab, it queues your own /compact with Claude's instructions.
The plugin is the repository, and the marketplace name is smart-compact. hellosverre also makes skins, redgreen, and mod-store. A compact offer timed to the prompt cache is why this page files it under usage. compact-adviser, by kunchenguid, draws a hint to run /compact when Jev calls the session a finished checkpoint. cache-timer, by arasovic, counts down until the prompt cache expires. This one gives Claude a request_compact tool with a reason and what the summary must keep, turns that down below the threshold, and never compacts mid-answer. Before every compact, its own or not, it copies the whole conversation to a session of its own that /resume can open.
Demo
From the author's repo.
What it hooks into
session.startWhen a session starts
tool.callAround a tool call, where it can hold oneBashPowerShell
prompt.submitWhen you send a prompt
turn.completeWhen a turn ends
classic.PreCompactA Claude Code event
ui.closeWhen its pane closes
ui.renderDraws into the sessionPaneAbovePrompt
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Files
The author's README and source, 4 files. They load when you open them.