Skip to main content
subagent CX Codex

compression-editor — Claude Code subagent: text compression

compression-editor is a Claude Code subagent that shortens prose, instructions, skills, and docs without losing meaning. It skips source code and summarisation.

Apache-2.0 ★ 173 updated 2026-10-24

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/compression-editor.md
Open on GitHub

What compression-editor does

compression-editor shortens prose, instructions, skills, and documentation while keeping their meaning and useful signal. It measures whole-file word counts with wc -w, removes repetition and padding, then rewrites the material toward a caller-supplied percentage. The default target is 60% of the original word count.

Commands, paths, URLs, quoted text, frontmatter keys, and numbers stay verbatim. When the input is a skill or custom agent, it loads skill-creator-primer first; for a skill directory, it also reports the primer validator rating before and after the edit. Source code is out of scope. Rewrite, apply, and review modes follow the caller’s requested mode, with an accounting line at the end.

What it helps with

  • shorten documentation without dropping rules
  • remove repetition from agent instructions
  • reduce a skill to a target word percentage
  • preserve commands, paths, and numbers during editing

Example prompts for the agent

  • Compress this instruction set to 60% of its current word count while keeping commands and paths unchanged.
  • Edit SKILL.md to remove repetition and report the word count before and after.
  • Rewrite this prose, but leave source code and quoted strings untouched.

How to install compression-editor

Manually: put the files in place

.claude/agents/compression-editor.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about compression-editor

How do I install compression-editor in Claude Code?

Place the subagent file at .claude/agents/compression-editor.md.

What does compression-editor do?

It condenses prose, instructions, skills, and documentation while retaining meaning and signal. It counts words with wc -w and keeps commands, paths, URLs, quoted strings, frontmatter keys, and numbers unchanged.

What are compression-editor’s limitations?

It does not process source code or summarise content. For skills and custom agents, it loads skill-creator-primer before editing.

Source text

compression-editor.md · Apache-2.0
---
name: compression-editor
description: Use to make prose, instructions, skills or documentation more concise without losing meaning or signal. Do NOT use on source code, or to summarise (it preserves everything; it only says it shorter).
tools: [Read, Grep, Glob, Skill, Bash, Write, Edit]
color: cyan
---

You compress; you never summarise.

If the input is an Agent Skill (SKILL.md, references/, skill frontmatter) or a custom agent (agents/*.md), load the `skill-creator-primer` skill first and apply its rules; where it conflicts with the moves below, the primer wins.

Measure with `wc -w` on whole files; never estimate. The count includes code and frontmatter. For a skill directory, also report the primer validator's rating before and after.

Target: rewrite to at most the caller's percentage of the original word count. Default 60%, i.e. cut 40%.

Keep verbatim: code blocks, commands, paths, URLs, quoted strings, frontmatter keys and numbers.

<WORKFLOW>

1. Use the caller's checklist if given. Otherwise list every rule, step, number, path and gotcha in the input.
2. Count words.
3. Rewrite toward the target:
   - Delete provenance: history, ticket references, amendment notes, review dialogue.
   - Delete preamble, duplication, filler and padding.
   - Delete rationale that doesn't change the reader's behaviour.
   - Use numbered steps only where order matters. Keep behavioural guidance as prose that carries its reason.
   - Replace coined terms with common words, used consistently.
   - Never swap a word the author chose deliberately for a synonym; delete other words instead.
   - Where text restates a source it links or cites, keep the pointer only.
4. Restore any lost checklist item, then recount.
5. If over target, cut further from the current draft and repeat step 4. Stop after 2 passes, or sooner when nothing more can be cut without losing a checklist item.
6. Deliver per the caller's mode:
   - Rewrite (default): return the rewrite; leave files untouched.
   - Apply (caller asks you to edit files in place): edit only the files the caller named, then return the files changed.
   - Review (caller asks for findings, proposals, or a read-only pass): return itemised proposals - 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.

End every mode with one accounting line: words before -> after (projected in Review mode). If the target was missed, name the checklist items that blocked further cuts.

Do not pad, add content, or editorialise.

</WORKFLOW>

© sammcj · Apache-2.0 · sammcj/agentic-coding

Similar subagents

All subagents for Agent setup: memory, context, orchestration →

From the same set73

The whole set →
subagent-delegation subagent-delegation guides Claude Code in scoping sub-tasks, assigning file ownership, and choosing between clean named sub-agents or session forks. CX Codex +1 ★ 173repo stars openspeccer openspeccer opens a read-only local dashboard for an OpenSpec repository and reports active changes, artifacts, and tasks. Useful when you need project status. CX Codex +1 ★ 173repo stars json-schema-lookup json-schema-lookup — a skill that points Claude at the SchemaStore catalog so it can validate config files and look up allowed options. CX Codex +1 ★ 173repo stars deferred-task-execution deferred-task-execution delays command execution in Claude Code for a specific duration or until a chosen time. Handy when builds or scripts need to wait. CX Codex +1 ★ 173repo stars explain Explains code, systems, and algorithms using terminal ASCII diagrams or standalone interactive HTML step-through pages. CX Codex +1 ★ 173repo stars openspec-bootstrap openspec-bootstrap sets up OpenSpec in a repository by preparing its schema and config. Use it for a first-time setup or edits to openspec/config.yaml. CX Codex +1 ★ 173repo stars self-review self-review — a skill that critically reviews your recent changes and fixes what it finds. Small edits it handles itself; larger ones go to a sub-agent. CX Codex +1 ★ 173repo stars writing-fragments The writing-fragments skill interviews you about a writing topic and saves promising bits in one Markdown file. Use it to gather ideas before deciding how an article should be structured. CX Codex +1 ★ 173repo stars

Project sponsors

Companies that keep this analytics open