CLI output eats your AI context window. ContextZip compresses it 40-97% (61% avg across 102 tests).
npx contextzip
🌐 Languages
한국어 • 日本語 • 中文 • Español • Português • हिन्दी • Français • Deutsch • Русский • Türkçe • Tiếng Việt
npx contextzipRestart Claude Code. Every command is now compressed. Zero config. macOS · Linux · Windows
Tip
Need raw output? Use contextzip proxy <command> to bypass all filters.
Missing jq? Install it: brew install jq (macOS) or apt install jq (Linux). Required for the Claude Code hook.
Other install methods
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/jee599/contextzip/main/install.sh | bash
brew install jee599/tap/contextzip
# Windows (PowerShell)
npx contextzip
# Rust developers
cargo install --git https://github.com/jee599/contextzip|
❌ Before |
✅ After |
|
❌ Before |
✅ After |
|
❌ Before |
✅ After |
Note
Currently supports legacy Docker builder output (Step N/M format). Docker BuildKit format passes through uncompressed.
|
❌ Before |
✅ After |
More examples: Rust panic, Python, Web page, ANSI, Docker failure, Java/Go
🐍 Python Traceback (72% saved) — Framework frames (flask, importlib) hidden, your code + error message kept.
🦀 Rust Panic (2-7% saved) — std::panicking, tokio::runtime frames hidden, your crate frames kept.
🌐 Web Page (73% saved) — Nav, footer, sidebar, cookie banner, social links stripped. <main>/<article> content kept.
🎨 ANSI/Spinners (83% saved) — Escape codes, spinner frames, intermediate progress bars removed. Final states kept.
🐳 Docker failure — Failed step + 2 prior steps + error message + exit code always preserved.
☕ Java — Removes java.lang.reflect, sun.reflect, org.springframework, org.apache frames.
🐹 Go — Removes runtime/, runtime.gopanic, runtime.main frames.
102 real-world tests. No cherry-picking.
| Category | Tests | Avg Savings | 🏆 Best | 💀 Worst |
|---|---|---|---|---|
| 🐳 Docker build | 10 | 88% | 97% | 77% |
| 🎨 ANSI/spinners | 15 | 83% | 98% | 0% |
| 💥 Error traces | 20 | 59% | 97% | -12% |
| 🔨 Build errors | 15 | 56% | 90% | -10% |
| 🌐 Web pages | 15 | 43% | 64% | 5% |
| 💻 CLI commands | 12 | 42% | 99% | -56% |
| 📦 Package install | 15 | 39% | 99% | 2% |
Weighted total: 61% savings → 326K chars in, 127K chars out
Note
Negative = output grew. Happens on tiny inputs. We put the worst numbers in the table because hiding them would be dishonest. Full benchmark →
Built on RTK (28k⭐). All 34 RTK commands included. Plus:
| RTK | ContextZip | |
|---|---|---|
| CLI compression (git, test, ls) | ✅ | ✅ |
| Error stacktraces (Node/Python/Rust/Go/Java) | ❌ | ✅ |
| Web page content extraction | ❌ | ✅ |
| ANSI / spinner / decoration removal | 🟡 | ✅ |
| Build error grouping (tsc/eslint/cargo) | 🟡 | ✅ |
| Package install noise (npm/pip/cargo) | ❌ | ✅ |
| Docker build compression | 🟡 | ✅ |
| Per-command savings display | ❌ | ✅ |
| 🔴 Error messages | ALWAYS preserved |
| 📍 File:line in build errors | NEVER removed |
| 🔒 Security warnings (CVE, GHSA) | ALWAYS kept |
| 🐳 Docker failure context | ALWAYS preserved |
| ⏎ Exit codes | ALWAYS propagated |
Important
ContextZip only removes confirmed noise. When in doubt → passthrough.
🏎️ How It Works
┌─────────────────────────────────────────────┐
│ Claude Code runs: git status │
│ ↓ │
│ Hook rewrites → contextzip git status │
│ ↓ │
│ ┌──────────────────────────────────────┐ │
│ │ [1] ANSI preprocessor strip junk │ │
│ │ [2] Command router 40+ filters │ │
│ │ [3] Error post-proc compress stack │ │
│ │ [4] SQLite tracker record savings │ │
│ └──────────────────────────────────────┘ │
│ ↓ │
│ Compressed output → Claude's context │
│ 💾 contextzip: 200 → 40 tokens (80%) │
└─────────────────────────────────────────────┘
🔧 Commands
# Automatic (hook rewrites — no prefix needed):
git status npm install cargo test docker build .
# Manual:
contextzip web https://docs.example.com # page → content only
contextzip err node server.js # error-focused output
# Analytics:
contextzip gain # dashboard
contextzip gain --by-feature # per-filter stats
contextzip gain --graph # daily chart
# Manage:
contextzip init --show contextzip update contextzip uninstall📈 Track Everything
$ contextzip gain
📊 ContextZip Token Savings
════════════════════════════════════════
Total commands: 2,927
Tokens saved: 10.3M (89.2%)
$ contextzip gain --by-feature
Feature Commands Saved Avg%
cli (RTK) 2,100 6.8M 78%
error 89 1.2M 93%
web 43 0.9M 73%
build 112 0.4M 81%git clone https://github.com/jee599/contextzip.git && cd contextzip
cargo test # 1,056 tests
cargo clippy # lintContextZip collects anonymous usage statistics (command count, savings percentage) to improve the tool. No personal data or command content is transmitted.
Disable: export CONTEXTZIP_TELEMETRY_DISABLED=1
MIT — Fork of RTK by rtk-ai.
⚡ Less noise. More code. Ship faster.
