ClaudeCodeMod

All shelves / Mods / Usage

smart-compact

By hellosverre

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.

Draws

Install

The marketplace name is smart-compact.

In Claude Code
/plugin marketplace add hellosverre/smart-compact
/plugin install smart-compact@smart-compact
Open the repo

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

The author's animation of a session: finish the session-token refactor and commit it, the tests pass and the commit lands, Claude calls smart-compact's request_compact with what the summary must keep, queued at 74% context; then Conversation compacted, kept: the open TODO on refresh-token reuse, and the context at 9%.
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.

Facts

Author
hellosverre
Category
Usage
Marketplace
smart-compact
Repo
hellosverre/smart-compact
Version
0.3.1
License
MIT
Repo stars
4
Last change
2026-10-20
Language
TypeScript
Files
18

Other mods in Usage

tideHula-Hoop-AIDraws the context window as a tide above the prompt: a fill bar by phase, a sparkline of recent turns, the rise per turn, and turns left before compaction.cache-ttl-statuslineJerrettDavisDraws session, plan-limit, and Headroom lines with model, cost, context, and a cache TTL that turns yellow then red, below the prompt or, in mod mode, above it.usage-meterLeeHigma0201Shows context fill, the 5-hour and 7-day plan windows, and session cost on the status line, and toasts when a plan window crosses 80% and 95%.subagent-meterNarenDawarShows on the status line how many subagents ran, their share of output tokens and of all tokens, and the agent type that used the most.usage-weatherptpmediabrDraws one line above the prompt with the context as a weather icon, the 5-hour and weekly limits with resets, cache warmth, and a Clear & continue button.am-context-barromnycristopherDraws a card above the prompt with context use against where quality drops, what fills it, turns left, limits, git status, and the phase of a plan you're on.compactlyswapnildahiphaleOpens a cost and cache pane with each turn's cost and when the cache goes cold, and compacts at a natural break a Sonnet judge picks, with a handoff summary.cache-meterT-AI-LabsDraws one row above the prompt with how much of the last turn the prompt cache served, how long it stays warm, and a Keep warm switch that refreshes it.context-meterT-AI-LabsDraws one row above the prompt with the context fill against an auto-compact threshold you pick, and Compact and Clear buttons.usage-limitsT-AI-LabsDraws one row above the prompt with how much of the 5-hour and weekly limits is used, with the time until each resets.context-usageT-AI-LabsDraws the context fill with an auto-compact threshold, Compact and Clear buttons, and the 5-hour and weekly limits in two rows above the prompt.rich-statuslineTheBabaYagaDraws one line above the prompt with the directory, git branch and changes, model and effort, and bars for context and the 5-hour and 7-day limits.
All 183 in Usage