should-compact

should-compact is a skill for Claude Code from fledgeling-co/fledgeling-plugins. It costs 232 tokens per session (4,172 once invoked), scanned B, original, MIT.

A session check that rates from 0 to 10 whether the current point is suitable for compacting a coding-agent conversation.

In plain words
What is it for?
Use it before `/compact`, during long sessions, or in an automatic compaction hook that needs a go-ahead decision.
Why use it?
It considers whether the agent is between tasks rather than relying only on how full the context window is, reducing the risk of interrupting unfinished work.

Skill for Claude Code

Written for Claude Code: PreCompact hook event. Also seen: reads .claude/ paths; mentions Claude Code; mentions Gemini CLI.

Part of the should-compact plugin — 1 skill shipped together

Good fit Use it before /compact, during long sessions, or in an automatic compaction hook that needs a go-ahead decision.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fledgeling-co/fledgeling-plugins/should-compact
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.

Any agent
npx skills add fledgeling-co/fledgeling-plugins --skill should-compact
Clone the repo
git clone --depth 1 https://github.com/fledgeling-co/fledgeling-plugins

Made for: Claude Code.

Or install should-compact, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for should-compact

README.md
[![agentmods](https://agentmods.dev/badge/skills/fledgeling-co/fledgeling-plugins/should-compact/github.svg)](https://agentmods.dev/skills/fledgeling-co/fledgeling-plugins/should-compact)
Your own site
<a href="https://agentmods.dev/skills/fledgeling-co/fledgeling-plugins/should-compact"><img src="https://agentmods.dev/badge/skills/fledgeling-co/fledgeling-plugins/should-compact/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for should-compact

Your own site · 80×15
<a href="https://agentmods.dev/skills/fledgeling-co/fledgeling-plugins/should-compact"><img src="https://agentmods.dev/badge/skills/fledgeling-co/fledgeling-plugins/should-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 232 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,172 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00232 $0.04172
Opus 5.5 $0.00093 $0.01669
Sonnet 5.5 $0.00046 $0.00834
Haiku 4.5 $0.00023 $0.00417

Measured 1mo ago against content hash 2f6ae19f2d88, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

should-compact 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 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/precompact_gate.sh, scripts/session_log.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

grep -rl "<the exact string your gate writes to stderr>" ~/.claude/projects --include='*.jsonl'
plugins/should-compact/skills/should-compact/SKILL.md · 282 lines

How it starts

The opening of the file, as written. The whole thing — 282 lines — stays where its author put it; the contents beside it link to each section on GitHub.

should-compact

Compaction is the lossiest operation an agent session has, and harnesses fire it on the wrong signal. Claude Code compacts on token pressure: measured across 235 real events on this operator's machine, the median compaction fired at 998,289 tokens of a 1M window — 99.8% full. A later 90-day recount (n=258 main-chain events) put the median at 987,636 — same finding, larger sample. Token pressure knows nothing about whether the agent is between tasks or three files into a refactor.

Read that as a fraction of the wall, never as an absolute. The wall moves: a proxy that arms autoCompactWindow or CLAUDE_CODE_AUTO_COMPACT_WINDOW sets it, and once one does the same "compacts when full" behaviour arrives at a much smaller number. Recounted over seven days and 3,778 transcripts on the same machine, 1,522 automatic compactions had a median pre-context of 267,313 tokens — a quarter of the earlier figure, from an identical trigger against a lower wall. Every headroom judgement here is therefore made against the caller-supplied wall, and a gate that substitutes the hardware window for it will read a session at its limit as one with 700k to spare.

This skill scores the thing token pressure cannot see: is the work at a seam right now?

Running as a Gemini model? Read gemini.md in this directory first, then follow this file with the overrides it names. It binds the five signals and the score/verdict/block consistency rules to a readback before the object is emitted, because the PreCompact hook branches on score alone. Other models skip it.

What you produce

Two things, in this order. The reasoning comes first because writing the deduction before the number is what makes a small model's score stable — asked for a bare score it anchors on the first plausible digit and rationalises afterwards.

{
  "reasoning": "Last turn wrote plan-0406.md and exited plan mode. No tool call is open. Two files were read this session and neither is half-edited. Log shows the research phase closed at 12:04.",
  "signals": {"open_tool_chain": false, "unsaved_edit": false, "active_error": false, "below_floor": false, "at_the_wall": false},
  "boundary": "planning→implementation",
  "score": 8,
  "verdict": "compact",
  "block": false
}

Read the full file on GitHub · 282 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 282 lines · 232 tokens per session scan B 2f6ae19f2d88

Subscribe to this mod's changes

should-compact is a skill published in the GitHub repository fledgeling-co/fledgeling-plugins (2 stars, last pushed 4d ago), licensed MIT. It adds 232 tokens to every session and 4,172 once invoked, about $0.0009 per session on Opus 5.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-09-04.

Related

Other skills, from other repositories

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by your inbox assignment.

paperclipai/paperclip · 30 tokens

rowboat-spaces

How to work as a member of Rowboat Spaces, the team chat where people and agents work together. Load it once per session, before acting on any request that reaches you from Rowboat; it covers your setup, mentions and hand-offs, the tools, and files.

rowboatlabs/rowboat · 60 tokens

pinchtab-mcp

Use this skill when a task requires browser automation through PinchTab's MCP server connected to a remote browser instance. Covers navigation, element interaction, data extraction, form filling, multi-step flows, and session management via MCP tools.

pinchtab/pinchtab · 52 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens