set

A session command that sets when the agent should compact, or shorten, its working context. You can set trigger, soft, hard, and window thresholds.

In plain words
What is it for?
Adjusting compaction percentages and token limits for the current session.
Why use it?
It lets you control how much context remains before compaction happens, instead of relying on fixed settings.

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/set
Clone the repo
git clone --depth 1 https://github.com/msshives-gif/claude-plugins
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 508 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.00015 $0.00508
Opus 5 $0.00008 $0.00254
Sonnet 5 $0.00003 $0.00102
Haiku 4.5 $0.00002 $0.00051

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

Security

Grade B, and why

set 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/set.md · 38 lines

What it actually says

Apply the user's requested per-session compaction thresholds: $ARGUMENTS

  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. Determine this session's id. The start-of-session compact-manager status line bakes the exact override <session-id> … command — prefer that id. Failing that, run "${CLAUDE_PLUGIN_ROOT}/bin/compact-manager" overview and use the >-marked row's session id ONLY if its updated age is seconds-old (> is recency, not identity); if it is older, ask the user rather than guessing.
  3. Translate the user's request into the CLI's key=value form — keys trigger, soft, hard (percentages like 60% or fractions like 0.6) and window (integer tokens) — and run: "${CLAUDE_PLUGIN_ROOT}/bin/compact-manager" override <session-id> key=value […]. To undo, pass --clear instead of assignments; with no assignments at all the command just shows the current state. Relay the command's own output verbatim — it prints the stored override file and the resulting effective thresholds; do not re-derive them.
  4. If the user's request doesn't map cleanly onto these keys (e.g. a global or per-model change, or another session's), say so and point at ~/.claude/compact-manager.json instead of forcing it through this per-session mechanism.
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 · 38 lines · 15 tokens per session scan B 39a12ccaec19

Subscribe to this mod's changes

set is a command published in the GitHub repository msshives-gif/claude-plugins (2 stars, last pushed 5d ago), licensed MIT. It adds 15 tokens to every session and 508 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.