compress

compress is a command for Claude Code from mbanderas/maestro. It costs 20 tokens per session (344 once invoked), scanned A, original, MIT.

A command that shortens a Markdown or plain-text memory file, such as notes or an AGENTS.md file, while keeping a backup of the original.

In plain words
What is it for?
Use it to compress prose files up to 500 KB. It refuses sensitive files and stops if the required backup already exists or validation cannot confirm the shortened file is safe.
Why use it?
It reduces the amount of text an agent must load repeatedly, which can lower input-token use. It also checks that important details such as code blocks, links, paths, dates, and command options were preserved.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the maestro plugin — 8 skills, 6 commands, 7 hooks shipped together

Good fit Use it to compress prose files up to 500 KB. It refuses sensitive files and stops if the required backup already exists or validation cannot confirm the shortened file is safe.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add mbanderas/maestro
Claude Code
/plugin install maestro

Made for: Claude Code.

Or install maestro, the plugin that ships this one along with the rest of its 8 skills, 6 commands, 7 hooks.

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 compress

README.md
[![agentmods](https://agentmods.dev/badge/commands/mbanderas/maestro/compress/github.svg)](https://agentmods.dev/commands/mbanderas/maestro/compress)
Your own site
<a href="https://agentmods.dev/commands/mbanderas/maestro/compress"><img src="https://agentmods.dev/badge/commands/mbanderas/maestro/compress/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 compress

Your own site · 80×15
<a href="https://agentmods.dev/commands/mbanderas/maestro/compress"><img src="https://agentmods.dev/badge/commands/mbanderas/maestro/compress.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 344 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00020 $0.00344
Opus 5.5 $0.00008 $0.00138
Sonnet 5.5 $0.00004 $0.00069
Haiku 4.5 $0.00002 $0.00034

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

Security

Grade A, and why

compress scanned grade A with 0 findings 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 3mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/compress.md · 39 lines

What it actually says

Compress a natural-language memory file (CLAUDE.md, todos, notes) into terse format. Input-token savings compound every turn the file is loaded (AGENTS.md S8: persistent files are token cost).

Target file: $ARGUMENTS

Steps:

  1. If no filepath was given, ask for one and stop.

  2. Run:

    node "${CLAUDE_PLUGIN_ROOT}/scripts/compress.cjs" <filepath>
    
  3. Report the script's outcome to the user verbatim (chars saved, backup location, or the refusal/abort reason).

The script is self-contained and enforces its own guardrails — do not work around a refusal by editing or renaming files:

  • Sensitive-path denylist (.env, credentials, keys, .ssh/.aws paths, token-ish names): hard refusal — compression sends file contents to the Anthropic API.
  • Only .md/.txt/extensionless prose files; max 500 KB.
  • Original saved as <name>.original.md; aborts if that backup already exists.
  • Deterministic validation (headings, byte-exact code blocks, URLs, file paths, and needle preservation — versions, dates, S-ids, CLI flags, env vars, thresholds, inline code — as errors; bullet and heading-text drift as warnings) with up to 2 cherry-pick fix rounds; on persistent failure the original is restored untouched.
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. 3mo ago First seen · 39 lines · 20 tokens per session scan A 7bcbac0de524

Subscribe to this mod's changes

compress is a command published in the GitHub repository mbanderas/maestro (5 stars, last pushed 2mo ago), licensed MIT. It adds 20 tokens to every session and 344 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

compress compared with commands from other repositories

compress next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
compressmbanderas/maestroCommand52mo agoMITA20Claude Code
learnaffaan-m/ECCCommand313k7d agoMITA8Claude Code, OpenCode
export-closedloop-learningsclosedloop-ai/claude-pluginsCommand1223d agoApache-2.0A13Claude Code
read-my-mindellmos-ai/build-your-users-mindCommand34d agoMITA0Claude Code
recallvshulcz/deja-vuCommand1.7ktodayMITA17Claude Code
bootstrap-memory0xK3vin/MegaMemoryCommand7667mo agoMITA0Claude Code
pn-audit-apiperniemann/pnCoreCommand0yesterdayMITA44Claude Code, Cursor