Compressor — AI skill for Claude Code
Reduce token usage in AI coding agents (Claude Code, Copilot, Cursor) with mode-switchable instruction packs and tool-output compression hooks — with a benchmark harness that measures the savings.
How to install Compressor
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anvanster/compressor and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Compressor does
Reduce token usage in AI coding agents (Claude Code, Copilot, Cursor) with mode-switchable instruction packs and tool-output compression hooks — with a benchmark harness that measures the savings. Every optimization is measured or it doesn't ship.
Alternatives in AI
- Repomix — 📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file 22.7k ★
- Graymatter — 30 sec to give your AI agents persistent memory 460 ★
- SkillEvaluator — Multi-tier framework for evaluating AI agent skills with quality gates, semantic overlap detection, synthetic 327 ★
README
compressor
Token optimization for AI coding agents. Two parts you install: **mode-switchable instruction packs** (full / optimized / slim) for Claude Code, GitHub Copilot, Cursor, OpenCode, and AGENTS.md-reading agents, and **tool-output compression hooks** that shrink file reads and command output before they enter the model's context. Every optimization is benchmarked against real agent sessions before it ships — current measured numbers, methodology, and the project's mistakes live in [docs/BENCHMARKING.md](docs/BENCHMARKING.md).
Install
Requires Node **>= 20**.
One-line install from GitHub (builds from source, puts `compressor` on your PATH):
# macOS / Linux / WSL
curl -fsSL https://raw.githubusercontent.com/anvanster/compressor/main/install.sh | bash
# Windows (PowerShell)
irm https://raw.githubusercontent.com/anvanster/compressor/main/install.ps1 | iex
Pin a tag/branch/commit with `COMPRESSOR_REF` (env var `$env:COMPRESSOR_REF` on Windows), e.g. `COMPRESSOR_REF=v0.3.0`.
Install the CLI globally (recommended — also enables relocatable hook commands):
npm install -g @astudioplus/compressor
Or install from source:
git clone https://github.com/anvanster/compressor.git
cd compressor
npm install
npm run build # compiles the CLI and bundles the hook entries
npm link # optional: puts `compressor` on your PATH
Without `npm link`, substitute `node /path/to/compressor/dist/cli/index.js` for `compressor` below. Note that source-checkout installs embed the absolute path of the clone in hook commands — don't move the directory after running `init` (re-run `init` if you do).
Quickstart
Claude Code
cd your-project
compressor init # claude-code, mode optimized, project scope
compressor status
compressor set-mode slim # switch modes
compressor set-mode full # removes everything — a true baseline
`init`, `set-mode`, and `uninstall` mod
Related Skills
Squeez
Hook-based token compressor for 5 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI). Up
Scrooge Mode
Same answer, fewer tokens — KO-first LLM output-compression skill for Claude Code & Codex. A Korean-native cav
Model Escalator
Claude Code mod that runs cheap models in parallel and escalates to a stronger one only when an agent gets stu
Kompact
LLM context compression proxy — 40-70% token savings, zero code changes
Dsh Output Styles
Claude Code outputStyles for DeepSeek Harness - session-scoped, durable, runtime-switchable model output style
Distil
Measure what context compression actually costs an LLM agent: where a session's tokens go, and whether a rewri
Related Agents
Agentic Auditor
PYA specialist spawned by the /pya orchestrator. Audits AI agent and LLM surfaces in an untrusted repository:
Benchmark Agent
Use this agent for competitive intelligence and platform benchmarking — it obsessively tracks where Cursor, De
AI Cost Optimizer
Audits an LLM application or AI agent for token cost and rate-limit risk, using its usage logs and code, and r