compress

compress is a command for Claude Code from anshss/shiploop. It costs 28 tokens per session (1,989 once invoked), scanned A, original, Apache-2.0.

A manual command that shortens how project rules are delivered to the coding agent by moving mechanically triggered rules out of CLAUDE.md into rule packs. CLAUDE.md is a project instruction file read during agent sessions.

In plain words
What is it for?
Reducing the per-turn context cost of a large CLAUDE.md file while preserving its rules.
Why use it?
It reduces repeated context sent on every turn without deleting the rules. Rules that matter only for certain file changes can be loaded only when needed.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions subagents; positional $N argument.

Part of the shiploop plugin — 2 skills, 7 commands, 4 agents shipped together

Good fit Reducing the per-turn context cost of a large CLAUDE.md file while preserving its rules.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/anshss/shiploop/compress
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.

Clone the repo
git clone --depth 1 https://github.com/anshss/shiploop

Made for: Claude Code.

Or install shiploop, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 4 agents.

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/anshss/shiploop/compress/github.svg)](https://agentmods.dev/commands/anshss/shiploop/compress)
Your own site
<a href="https://agentmods.dev/commands/anshss/shiploop/compress"><img src="https://agentmods.dev/badge/commands/anshss/shiploop/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/anshss/shiploop/compress"><img src="https://agentmods.dev/badge/commands/anshss/shiploop/compress.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,989 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.00028 $0.01989
Opus 5.5 $0.00011 $0.00796
Sonnet 5.5 $0.00006 $0.00398
Haiku 4.5 $0.00003 $0.00199

Measured 2mo ago against content hash c835c0edb14d, 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 2mo 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 · 158 lines

How it starts

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

/shiploop:compress

The ONLY thing that compresses CLAUDE.md. Nothing automatic ever edits that file. scripts/govern/claudemd-trim.sh (operator-invoked, as govern:context-budgets or govern:trim) detects and reports only (`trim: CLAUDE.md / chars, compression candidate(s)

  • run /shiploop:compress), and scripts/govern/claudemd-trim.sh --apply ` moves one pre-approved block. Everything else happens here, with an operator watching.

CLAUDE.md is re-sent to the model in full on every turn, so a rule that only matters while editing a shell script is charged to every session that never opens one. This command reduces that per-turn tax without deleting a single rule.

The lever is delivery, not prose. On the workspace this method came from, a wording-only pass over the whole file bought 759 chars (2.9%) because the file was already at its hand-compressed floor. The same file then dropped 26,511 -> 18,830 chars (-29%) with no rule removed, purely by moving mechanically-triggered rules into scripts/rules-on-touch.sh. Do not open this command by rewriting sentences.

Sort by DETECTABILITY, never by frequency. Frequency was tested as a sort key and rejected: a rule that fires rarely but prevents a destroyed box is high value precisely because nobody recalls it, which argues for just-in-time delivery, not against it. The only question that decides a block is whether its trigger is mechanically detectable from a tool call.


Step 1 - Measure composition per section

Do not skip this. It is what proves where the mass actually is, and it usually contradicts the guess.

awk '/^## /{if(h)printf "%6d  %s\n",n,h; h=$0; n=0} {n+=length($0)+1} END{if(h)printf "%6d  %s\n",n,h}' CLAUDE.md | sort -rn
wc -c CLAUDE.md

Report the table to the operator before touching anything.

Step 2 - Read the candidates the automatic pass already found

governor/claudemd-trim-proposals.md. Each proposal carries a Class: field:

Read the full file on GitHub · 158 lines

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. 2mo ago Changed · +1 lines c835c0edb14d
  2. 2mo ago First seen · 157 lines · 28 tokens per session scan A 74dd1296b02c

Subscribe to this mod's changes

compress is a command published in the GitHub repository anshss/shiploop (11 stars, last pushed 4d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,989 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-09-09.

Related

compress compared with commands from other repositories

compress next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
compressanshss/shiploopCommand114d agoApache-2.0A28Claude Code
minutes-ideassilverstein/minutesCommand1.6ktodayMITA48Claude Code, OpenCode
learnReflexioAI/claude-smartCommand799yesterdayApache-2.0A14Claude Code
memory-storeverygoodplugins/mcp-automemCommand683d agoMITA10Claude Code
analyze-contextRohiRIK/OpenLtmCommand31todayMITA39Claude Code
vertical-spawnStarlight-Intelligence/Starlight-Intelligence-SystemCommand12todayMITA43Claude Code
recallnaimkatiman/continuous-improvementCommand11todayMITA44Claude Code