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+)
| Category | Commands | Savings |
|---|---|---|
| Git | git status/log/diff/branch, gh pr/issue/run | 50β90% |
| JavaScript | npm, pnpm, yarn, bun, tsc, eslint, biome | 70β95% |
| Angular/Nx | ng, nx build/test | 70β90% |
| .NET | dotnet build/test | 70β90% |
| Go | go test/build/vet | 75β90% |
| Python | pytest, pip, uv, mypy, ruff | 70β90% |
| Containers | docker, docker compose | 60β85% |
| Kubernetes | kubectl, helm | 60β85% |
| Infrastructure | terraform plan/apply/init | 70β90% |
| Cloud | aws, az, gcloud | 60β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
- Written in Go β fast, single binary, no runtime dependencies
- Installs to
~/bin/or a custom directory - Cross-platform: Linux, macOS, Windows (amd64 / arm64)
- Configuration via
~/.config/chop/config.yml - Local SQLite token tracking
π¬ Read more about the motivation behind chop in the blog post.