setup

A first-run setup command for compact-manager, a tool that monitors and manages context usage in coding-agent sessions.

In plain words
What is it for?
Use it to choose a compact-manager mode and learn the related commands.
Why use it?
It explains the available operating modes and helps configure the tool before use.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/msshives-gif/claude-plugins/setup
Clone the repo
git clone --depth 1 https://github.com/msshives-gif/claude-plugins
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 874 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.00874
Opus 5 $0.00006 $0.00437
Sonnet 5 $0.00003 $0.00175
Haiku 4.5 $0.00001 $0.00087

Measured 2d ago against content hash 190fb4c23549, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

setup scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

itself: `find ~/.claude/plugins -maxdepth 8 -type f -name
plugins/compact-manager/commands/setup.md · 65 lines

What it actually says

Walk the user through turning compact-manager on. Be brief — this is two decisions, not a tutorial.

  1. Locate the compact-manager CLI. The path in the later steps normally reads as an absolute path (script installs write it in). If it instead still says ${CLAUDE_PLUGIN_ROOT} literally — plugin installs may not substitute command markdown — find the CLI file itself: find ~/.claude/plugins -maxdepth 8 -type f -name compact-manager -path "*/bin/*" 2>/dev/null (this handles versioned cache layouts, where a directory merely NAMED compact-manager has no bin/). If several paths match, use the most recently modified (ls -t).
  2. Read the current state: ~/.claude/compact-manager.json (may not exist; mode defaults to off), "${CLAUDE_PLUGIN_ROOT}/bin/compact-manager" overview, and env | grep '^COMPACT_MANAGER_' — environment variables OVERRIDE the file, so if any are set, warn the user that editing the file alone may not change effective behavior in sessions carrying those variables. If a mode is already set, say so and ask whether the user wants to change it before continuing.
  3. Explain the choice in about three sentences, then ask which mode they want:
    • advisory — pure hooks, any platform, zero risk: the model is warned crossing 70% of the context window (and again, firmer, at 80% — whichever thresholds are crossed) so it can save its working state, and after any compaction the saved state is injected back so the session resumes oriented. The user still runs /compact themselves.
    • managed — advisory plus a per-session watcher that types /compact into the session's tmux pane at a verified-idle moment. Linux/WSL + tmux only; each session must be attached explicitly.
    • (off stays available — everything inert.)
  4. Ask one follow-up: do they run models with a context window other than 1M? The default context_window is 1,000,000 (the Claude 5 standard); smaller/legacy models need a models override, e.g. {"haiku": {"context_window": 200000}} (substring match, longest wins). Getting this wrong is asymmetric: too small warns — and in managed mode compacts — far too early; too large just means advisories never fire.
  5. If the user is switching AWAY from managed (to advisory or off): running watchers snapshot their config at spawn and will keep typing /compact regardless of the file change. Check overview for live watchers and stop each one ("${CLAUDE_PLUGIN_ROOT}/bin/compact-manager" stop <session-id>, with the user confirming the list) — or tell the user explicitly that existing watchers stay active until stopped or their session ends.
  6. Write ~/.claude/compact-manager.json with the chosen mode (and any overrides). If the file exists, MERGE — show the user the exact final JSON before writing, and never drop keys they already set. The hooks re-read the file each time, so it takes effect immediately.
  7. Close with the command map, one line each: managed sessions attach with the attach command (/compact-manager:attach or /compact-manager-attach); …status shows mode, watchers, and per-session usage (or run bin/compact-manager overview directly — no model turn); …detach stops this session's watcher. If they chose managed and this session is in tmux ($TMUX_PANE non-empty), offer to attach right now.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 65 lines · 13 tokens per session scan B 190fb4c23549

Subscribe to this mod's changes

setup is a command published in the GitHub repository msshives-gif/claude-plugins (2 stars, last pushed 5d ago), licensed MIT. It adds 13 tokens to every session and 874 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.