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 ★
- Part 4 — Generate AGENTS.md And AI Agent Configuration Files — I'll help you create the instruction files that will guide your AI coding assistant to build your MVP 2.1k ★
- Paritok 4b V1 — Non-destructive compression gateway for AI coding agents 1.4k ★
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
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
Smart Dispatch Report
Show smart-dispatch routing stats — model distribution, estimated savings, and budget-mode downgrades.
AI AI Workflows
This document provides prompt patterns for using AI to assist with AI Engineering tasks — designing prompts, b
Related Agents
Benchmark Agent
Use this agent for competitive intelligence and platform benchmarking — it obsessively tracks where Cursor, De
Sync Coordinator
Use this agent to synchronize instruction files between Claude Code and GitHub Copilot platforms, plus create
Usage Analyst
AI spending analyst that proactively monitors and reports on Cursor Enterprise team usage patterns, spending a