smart-compact

by hellosverre · ★ 0 · updated 16 days ago

PanesBandsGuardsCommandsPromptTools & agentswarnings

0

Compacts at the right moment: after a commit or green tests, a minute before the prompt cache expires, or when Claude asks for it with its own request_compact tool.

install smart-compact

Install

/plugin marketplace add ZH-L1N/agent-window-mods
/plugin install smart-compact@zehui-mods

Then run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.

View source on GitHub

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.startcommand.runtool.callprompt.submitturn.completeclassic.PreCompactui.closeui.render
API calls
$.clock.after$.clock.now$.command.register$.command.run$.process.run$.session.compact$.session.usage$.state.get$.state.set$.tool.register$.ui.close$.ui.open$.ui.resolve$.ui.toast
Draws
PaneAbovePrompt
Can see
mcp__smart-compact__request_compact callsBash callsPowerShell callsevery promptclassic hooks
Reach
level 2 of 3 runs processesdrives Claudereads 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/ZH-L1N/agent-window-mods
Path in repo
smart-compact
Source commit
5122d45 the exact code the scan read
Author
hellosverre @ZH-L1N
License
No license declared — ask the author before reusing code.
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 ZH-L1N/agent-window-mods

strip

ZH-L1N/agent-window-mods

One strip of quiet pills above the prompt in place of the SYS, PLAN, HANDOFF and CACHE rows: context, cache, diff, tests, agents, queue, system and peers, with a STOP and a health pill when needed. It reads the other mods' state, orders the whole band, puts one background colour behind it, and opens a context, a system and a last-turn diff pane. /strip.

★ 0PanesBandsGuards

sys

ZH-L1N/agent-window-mods

A SYS band above the prompt: CPU load, RAM in use and battery, each with a 6-cell bar and traffic-light colours, read every 5 seconds; a btop button that opens btop in a herdr pane below, and /sys.

★ 0BandsCommands

token-weather

ZH-L1N/agent-window-mods

A live forecast of the context window, drawn above the prompt: a weather icon, the fill percentage, and a chart of the last turns.

★ 0Bands

web

ZH-L1N/agent-window-mods

/web opens a link in terminal-browser in a herdr pane below (the last link of Claude's reply by default); the web_read tool lets Claude read the open page as a bounded capture (title, origin and path, main text, first 50 links), asking once per new site.

★ 0GuardsCommandsTools & agents

zh

ZH-L1N/agent-window-mods

/zh translates the last assistant reply (or the n-th back) into Simplified Chinese with Haiku or Sonnet and shows it in a pane, code, paths, commands and names kept exactly; prev, next, latest and close buttons, the last three translations kept.

★ 0PanesCommands

agents

ZH-L1N/agent-window-mods

Live subagents, background shells, Monitor watches and cron timers: an AGENTS band above the prompt (main model, each run with its model or command, task and status, watches with time left, crons with their next fire, skills fired, ☕ while idle sleep is held), an /agents-info pane with a Who view (cost, tokens, time and a pixel mascot per run, picked from a pool for its state), a Code view...

★ 0PanesBandsGuards

blast-radius

ZH-L1N/agent-window-mods

Holds risky shell commands (rm -rf, git reset --hard, git clean, force push, migrations) and shows what they would change, with Proceed and Cancel buttons.

★ 0PanesGuards

breathe

ZH-L1N/agent-window-mods

Guided breathing exercises above the prompt while Claude works: coherent, box, 4-7-8 and the physiological sigh, seventeen animation styles, and the spinner can read the breath (/breathe spinner on). Appears when Claude starts, disappears when Claude answers.

★ 0BandsReskinsCommands

cache-clock

ZH-L1N/agent-window-mods

A CACHE band above the prompt: how long the prompt cache stays warm, how much of the last request it served, and what rewriting it would cost (estimate); a Compact button and /cache-clock.

★ 0BandsCommands

filetree

ZH-L1N/agent-window-mods

A small tree of the working folder in a Files pane: folders open and close, git marks changed files, and the files read or written this turn are listed on top. /tree opens it.

★ 0PanesGuardsCommands

goal-meter

ZH-L1N/agent-window-mods

A GOAL band above the prompt that reads Claude's own task list: the goal's name, a 6-cell bar of tasks done, percent, time, ETA and the task running now; a /goals pane with every task and the last five goals.

★ 0PanesBandsGuards

handoff

ZH-L1N/agent-window-mods

A HANDOFF band above the prompt: the context bar stacked by /context category, fill against the compaction point, and at the threshold a save-now button that writes HANDOFF.md, then clear & continue and a resume offer in the next session.

★ 0BandsCommands

Other mods in Panes, close to this one by stars.