Hook-based token compressor for 7 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI, Pi, Hermes). Up to 95% bash compression, signature-mode for code reads, cross-call dedup, MCP server, self-teaching protocol. Zero runtime deps.
# Add to your Claude Code skills
git clone https://github.com/claudioemmanuel/squeezGuides for using mcp servers skills like squeez.
squeez is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by claudioemmanuel. Hook-based token compressor for 7 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI, Pi, Hermes). Up to 95% bash compression, signature-mode for code reads, cross-call dedup, MCP server, self-teaching protocol. Zero runtime deps. It has 250 GitHub stars.
squeez's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/claudioemmanuel/squeez" and add it to your Claude Code skills directory (see the Installation section above).
squeez is primarily written in Rust. It is open-source under claudioemmanuel on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh squeez against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
squeez decides what tool output reaches your AI coding agent's context — and shows you what that saved.
It sits in the hooks of seven agent CLIs (Claude Code, GitHub Copilot CLI, OpenCode, Gemini CLI, OpenAI Codex CLI, Pi, Hermes) and compresses command output, re-reads, screenshots and repeated results before the model reads them. Compression is reversible (anything dropped is one squeez_retrieve away), refuses net-loss rewrites, and fails open. One static Rust binary, zero runtime dependencies.
$ squeez receipt
squeez receipt — last 7 day(s)
sessions 27 (9951 min)
tokens avoided 323,964 (squeez chars/4 estimate)
cost avoided ≥ $1.30 at claude-opus-5-5 input $4.00/MTok (floor: cache re-reads not counted)
context avoided 0.3 × 1000K-token windows
curl -fsSL https://raw.githubusercontent.com/claudioemmanuel/squeez/main/install.sh | sh # recommended
npm install -g squeez # or: npx squeez — pre-built binary, Node ≥ 16
cargo install squeez # build from source, Rust stable
Each puts the binary at ~/.claude/squeez/bin/squeez and runs squeez setup, which registers the hooks in every host CLI it detects. Restart your CLI afterwards. Windows needs Git Bash.
squeez setup --host=claude-code,codex # register only these hosts (or SQUEEZ_HOSTS=…)
squeez uninstall [--host=<slug>] # remove hooks; sessions and config.ini are kept
squeez update [--check] # self-update, SHA256-verified
squeez doctor # health check: hooks, registration, config, host contract
| Host | Bash | Read/Grep limits | Session memory | Notes |
|---|---|---|---|---|
| Claude Code | ✅ wrap | ✅ hard | ✅ | Output rewrite for Read/Grep/MCP, sub-agent metering, compaction recovery |
| Copilot CLI | ✅ wrap | ✅ hard | ✅ | Memory in ~/.copilot/copilot-instructions.md |
| OpenCode | ✅ wrap | ✅ hard | ✅ | Plugin ~/.config/opencode/plugins/squeez.js; MCP calls skip hooks (sst/opencode#2319) |
| Gemini CLI | ✅ wrap | 🟡 soft (GEMINI.md) | ✅ | Rewrite schema pending (gemini-cli#25629) |
| Codex CLI | ✅ wrap | 🟡 soft (AGENTS.md) | ✅ | read_file/grep hooks pending (codex#18491) |
| Pi | ✅ wrap | ✅ hard | ✅ via skill | Extension ~/.pi/agent/extensions/squeez/ |
| Hermes | ✅ output hook | ❌ | ✅ | Opt-in: hermes plugins enable squeez-fallback |
Compresses what the agent reads
squeez wrap: a handler for 60+ programs (git, cargo, npm, pytest, jest, tsc, kubectl, terraform, …), 41 shipped filter rules, then smart-filter → dedup → log-template → relevance truncation. Risky commands (rm -rf, git push --force, …) run unwrapped under the host's own permission rules.identical to Read #N; read again after a small edit, it comes back as one diff hunk against the earlier read.sips/ImageMagick (image tokens scale with pixel area); the full-size file is kept and named.Never loses what matters
squeez_retrieve expands it, squeez_stash_search finds it by meaning.[squeez: host payload changed …], squeez doctor) instead of failing silently.Watches the budget
Shows the result
squeez receipt — tokens avoided, priced at the model the session ran on, as text or a shareable table.squeez export — content-free metrics as JSON or OTLP for a team's own backend.squeez receipt [--days N] [--model ID] [--format md] # what squeez saved, in tokens, dollars and windows
squeez export [--format json|otlp] [--days N] [--out F] [--endpoint http://…/v1/metrics] [--no-handlers]
squeez discover # programs squeez compresses poorly, by tokens emitted
squeez discover --suggest "<cmd>" [-] [--apply] # propose a filter rule from that program's real output
squeez filters add <dir|file.ini|git-url> | list | remove <name> # install shareable rule packs
squeez filter-test # run every filter rule's inline tests
squeez gateway-sim [--days N] [transcript.jsonl…] # what an API-level gateway would add (read-only)
squeez doctor | prune | calibrate # health check · clean the stash · tune config
squeez config get|set|list|reset|path # or /squeez in natural language inside the session
squeez wrap <cmd> · squeez filter <hint> # compress a command / stdin by hand
squeez compress-md [--ultra] [--lang pt] <file> # compress CLAUDE.md / AGENTS.md prose
squeez benchmark [--json] [--efficiency-proof] # reproduce the numbers below
squeez mcp # MCP server: 18 tools over stdio
Prefix a command with --no-squeez to run it untouched.
A wrapped command prints one header line:
# squeez [git log] 2692→289 tokens (-89%) 0.2ms [adaptive: Full]
The DSL covers what no handler does. Layers, most specific first: ./.squeez/filters.ini (project) > ~/.claude/squeez/filters.ini (user) > installed packs (filters.d/) > the shipped pack. Every rule carries test_input/test_expect; a pack installs only when all its tests pass.
[filter "mix compile"]
strip_lines_containing = "Compiling "
test_input = "Compiling 3 files (.ex)\nerror: undefined function foo/0"
test_expect = "error: undefined function foo/0"
squeez discover --suggest "bazel test" writes such a rule for you from stashed output (or bazel test 2>&1 | squeez discover --suggest "bazel test" -), measured on the samples and appended only with --apply.
claude mcp add squeez -- ~/.claude/squeez/bin/squeez mcp exposes 18 read-only tools: squeez_retrieve and squeez_stash_search (expand or find a stashed original), session memory (squeez_recent_calls, squeez_seen_files, squeez_seen_errors, squeez_seen_error_details, squeez_prior_summaries, squeez_search_history, squeez_file_history, squeez_session_detail), accounting (squeez_session_summary, squeez_session_stats, squeez_session_efficiency, squeez_context_pressure, squeez_agent_costs, squeez_handler_stats, squeez_enterprise_savings) and squeez_protocol, which teaches the model squeez's markers.
~/.claude/squeez/config.ini (other hosts: their own squeez dir; squeez config path prints it; SQUEEZ_DIR overrides). Every key is optional.
# Compression
max_lines = 200 # generic truncation limit
bypass = docker exec, psql, mysql, ssh # never wrapped
wrap_bash = true
builtin_filters = true # the 41-rule shipped pack
image_max_edge = 1024 # downscale MCP images above this long edge (0 = off)
read_diff_enabled = true # re-read after a small edit → one diff hunk
retrieve_soften_rate = 0.2 # retrieves per call that make a program compress lighter (0 = off)
# Context and budget
adaptive_intensity = true # Full < 80% of the window, Ultra above
context_window_tokens = 0 # 0 = detect from the transcript
budget_advice_pct = 0.7 # advise before expensive calls above this share used (0 = off)
budget_advice_min_tokens = 1500
# Output and memory
persona = ultra # off | lite | full | ultra — terse prompt persona
focus = off # off | adhd — action-first output structure
auto_compress_md = true
buddy = true # the status-line companion
lang