chop logo

chop

Active Β· v1.0.1


🧩 About this project

chop is a CLI output compressor designed specifically for Claude Code.

Claude Code wastes 50–90% of its context window on verbose CLI output β€” build logs, test results, container listings, git diffs. chop compresses that output before Claude sees it, saving tokens and keeping conversations focused.

It works as a transparent wrapper: prefix any command with chop, or install a global hook that intercepts every Bash command Claude runs automatically.


βš™οΈ How to use it

Install:

curl -fsSL https://raw.githubusercontent.com/AgusRdz/chop/main/install.sh | sh

Use manually:

chop git status
chop docker ps
chop npm test
chop kubectl get pods
chop terraform plan

Or install the automatic Claude Code hook:

chop init --global   # install
chop init --status   # verify
chop init --uninstall

πŸ“¦ Supported commands (52+)

CategoryCommandsSavings
Gitgit status/log/diff/branch, gh pr/issue/run50–90%
JavaScriptnpm, pnpm, yarn, bun, tsc, eslint, biome70–95%
Angular/Nxng, nx build/test70–90%
.NETdotnet build/test70–90%
Gogo test/build/vet75–90%
Pythonpytest, pip, uv, mypy, ruff70–90%
Containersdocker, docker compose60–85%
Kuberneteskubectl, helm60–85%
Infrastructureterraform plan/apply/init70–90%
Cloudaws, az, gcloud60–85%

Any command not listed is auto-detected and compressed via structural pattern matching (JSON, CSV, tables, log lines).


πŸ“Š Token tracking

chop gain              # overall stats
chop gain --history    # last 20 commands
chop gain --summary    # per-command breakdown

Every run is tracked in a local SQLite database. No data leaves your machine.


πŸ”§ Technical details


πŸ’¬ Read more about the motivation behind chop in the blog post.