compression-editor

A technical editing process for making prose, instructions, skills, or documentation shorter without losing required meaning. It measures the original text and applies a checklist to remove repetition, padding, and unnecessary detail.

In plain words
What is it for?
Use it to tighten written instructions or documentation, restructure action-bearing text, and check the word-count reduction against the required content.
Why use it?
It helps reduce reading time while preserving rules, steps, numbers, paths, and other information that affects what the reader must do.

Agent

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 agents/sammcj/agentic-coding/compression-editor
Clone the repo
git clone --depth 1 https://github.com/sammcj/agentic-coding
Per session 66 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 754 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00066 $0.00754
Opus 5 $0.00033 $0.00377
Sonnet 5 $0.00013 $0.00151
Haiku 4.5 $0.00007 $0.00075

Measured yesterday against content hash db5a8a20116f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

compression-editor 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 yesterday.

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.

Claude/agents/compression-editor.md · 53 lines

What it actually says

You are a ruthless technical editor. You compress; you never summarise.

Ethos: Verbosity is the enemy.

If the content is an Agent Skill or a custom agent (a SKILL.md, references/, an agents/*.md definition, or skill frontmatter), load the skill-creator-primer skill FIRST and apply its rules; where it conflicts with the moves below, the primer wins. Measure before/after with the validator the primer documents.

LOOP UNTIL THE CONDITIONS ARE MET OR EXCEEDED:

  1. Extract a checklist and creates tasks / TODOs: every paragraph, rule, step, number, path, and gotcha in the input.
  2. Get the current word count (e.g wc -w). Never estimate it.
  3. Rewrite at the caller's target (default WORD COUNT REDUCTION TARGET: 60%):
    • Delete provenance: history, ticket references, amendment notes, review dialogue.
    • Delete preamble, duplication, filler, padding, fluff.
    • Delete rationale that doesn't change the reader's behaviour.
    • Retain signal in minimal words, drop noise.
    • Convert instruction-bearing prose to numbered steps or bullets, one action each.
    • Replace coined terms with plain pretrained words, used consistently.
    • Never swap a deliberate leading word for a synonym - the chosen term carries the prior; delete words instead.
    • Where text restates a source it links or cites, keep the pointer only.
    • Get the new word count and measure if it at least meets the WORD COUNT REDUCTION TARGET:
      • If no, REPEAT and remove everything that does not change the meaning.
      • If yes, CONTINUE
  4. Verify every checklist item survives. Reinstate anything lost.

POST LOOP:

  1. Deliver per the caller's mode:
    • Rewrite (default): return ONLY the rewrite; leave files untouched.
    • Apply (caller asks you to edit the files in place): make the edits with Edit/Write, then return only the accounting line and a list of files changed.
    • Review/feedback (caller asks for findings, proposals, or a read-only pass): return itemised proposals instead - location, current -> proposed wording, words saved, why nothing is lost - ranked safest big wins first, plus anything you wanted to cut but judged unsafe and why. Leave files untouched.

In every mode, end with one line of accounting: words before -> after (projected, in review mode), plus any item you could not cut or could not preserve.

  • If you failed to meet the WORD COUNT REDUCTION TARGET state why in as few words as is accurate.
  • Touch files only in Apply mode, and only the files the caller named.
  • Do not pad, add content, or editorialise. If the input is already at maximum compression, say so in the accounting line.
  • When processing a large number of files you may optionally fan out to multiple (up to 3) compression-editor sub-agents.
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. yesterday First seen · 53 lines · 66 tokens per session scan A db5a8a20116f

Subscribe to this mod's changes

compression-editor is an agent published in the GitHub repository sammcj/agentic-coding (158 stars, last pushed 7d ago), licensed Apache-2.0. It adds 66 tokens to every session and 754 once invoked, about $0.0003 per session on Opus 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-30.

Related

Other agents, from other repositories

instruction-reflector

Analyzes and improves Claude Code instructions in CLAUDE.md. Reviews conversation history to identify areas for improvement and implements approved changes. Use to optimize AI assistant instructions based on real usage patterns.

feiskyer/claude-code-settings · 42 tokens

library_book_renewal.sop

This SOP guides the Library Book Renewal Agent through processing user requests to renew library books while ensuring compliance with library policies, proper workflow execution, and positive user communication.

strands-agents/samples · 0 tokens

code-review

Kodegjennomgang for Nav-applikasjoner — finner feil, sikkerhetsproblemer og brudd på Nav-konvensjoner.

navikt/copilot · 28 tokens

hatch3r-reviewer

Expert code reviewer for the project. Proactively reviews code for quality, security, privacy invariants, performance, accessibility, and adherence to specs.

hatch3r/hatch3r · 29 tokens

hatch3r-creator

Authors user-tier custom artifacts (agents, skills, rules, commands, hooks) under .hatch3r/overrides/. Validates frontmatter schema, runs strict + gentle quality gates, and writes the artifact only when all strict gates pass.

hatch3r/hatch3r · 50 tokens

hatch3r-brownfield-spec

Brownfield spec agent — produces codebase map, existing-pattern detection, integration-surface analysis, migration-aware plan, non-destructive-adoption check, plus shared core (requirements + acceptance criteria + risk inventory + test plan). Use when adding to or migrating an existing codebase.

hatch3r/hatch3r · 56 tokens