anvanster

Compressor — AI skill for Claude Code

AI community

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

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