agent-compact-advisor
Reviewed
at commit 5486abe
A 0-100 score in the status line for how good a moment it is to /compact, with a ready /compact suggestion past a threshold and a template added to every…
0 upvotes
Log in to upvote or save- Made by
- apolenkov
- Pinned commit
-
5486abec02ae09bda76750993a0f68ca61b76dbf - What we checked
-
Shows a 0-100 score on the status line for how good a moment it is to /compact, based on context size, running agents, uncommitted or unpushed git changes and leftover lines in Claude's last answer, and suggests a ready /compact. It adds a preservation template to every compaction and never compacts by itself. When the rules say ready, Haiku on your own account checks the answer's end. Texts are Russian by default.
Review details
Static review of the source at the pinned commit; not run. Registers session.start (twice: one restores the list of written paths from the transcript via $.session.messages, including sub-agent transcripts up to 16, the other registers the /compact-advisor command and a 30-second redraw timer), session.measure, turn.start, turn.complete (main thread only), tool.call (observes only: passes the call through unchanged and notes the absolute paths Edit/Write/NotebookEdit/MultiEdit named or Bash changed), session.compact (appends a fixed preservation template plus the owner's question line, running background waits and up to 15 written paths to the instructions of manual and auto compactions of the main thread; guardCompactions turns it off) and command.run. Uses $.ui.status, $.ui.toast, $.prompt.suggest (a fixed one-line /compact suggestion), $.state atoms (facts and written paths), $.agent.list, reads agent-shell-watch's state when that plugin is installed, $.clock, $.model.complete (haiku, last 6000 characters of the answer, 8 max tokens, 15 s timeout; on by default via modelCheck, skipped below minTokens) and $.process.run for read-only git commands only (rev-parse, status --porcelain, symbolic-ref, config read, rev-list, merge-base, diff --name-only) with a 5 s timeout, in the session root and the repositories of written paths (at most 6). It also POSTs the last 8000 characters of the answer to a 'Kev System One' service at systemOneUrl (default http://127.0.0.1:8010); the URL is enforced loopback-only by a regex, so nothing leaves the machine, and a missing service just fails quietly after at most 20 s. All failures are swallowed and never block a turn or a compaction. Changes since the previous review are small scoring and suggestion tweaks (a gate now always holds the suggestion, tiny contexts skip the Haiku check, a pending P1 survives a reload) and a dev smoke script now using mktemp; scripts/live-smoke.sh and scripts/update-types.sh are developer tools the plugin never runs. Status line, toasts and leftover prefixes default to Russian (language: en switches).
- What it uses
-
- Reads your prompts: no
- Sees tool calls: yes
- Blocks or changes tool calls: no
- Reads or writes files: no
- Runs programs on your machine: yes
- Calls the model (uses tokens): yes
- Sends data over the network: no
- Stores data: yes
- Shows something on screen: yes
Status line score 0-100 for how good a moment it is to /compact now, with reasons; offers a ready /compact that keeps goal, decisions, leftovers and paths, and adds that template to every compaction. Never compacts by itself.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/agent-compact-advisor/)