Power your agent
Yayıncıdan kurulum. PlugMCP uç noktası değildir.
Host a copy with our keys and logs.
Registry'de henüz paketlenmiş bir sürüm yok. Deponun README dosyasını izleyin.
Uzak URL mi, yoksa makinenizde bir komut mu? İki kurulum arasındaki fark
PlugMCP’de çalıştır
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
BaşlatEnd-to-end token optimizer for seven AI CLI hosts — Claude Code, GitHub Copilot CLI, OpenCode, Gemini CLI, OpenAI Codex CLI, Pi, and Hermes. Compresses bash output up to 95%, collapses redundant calls, preserves exact identifiers through every summary, refuses net-loss compressions, and injects a terse prompt persona — automatically, with zero new runtime dependencies.
Latest first. Full history in CHANGELOG.md.
git statusThe filter DSL could always cover the long tail GenericHandler can't compress — it just shipped empty, so every user started from a blank filters.ini. This release fills it, adds a native git status path, and makes two guards that were only ever measured in benchmarks run for real.
assets/filters_builtin.ini) — pip/uv/poetry, bundle/composer/rubocop/phpstan, dotnet/swift/gcc, mypy/basedpyright/golangci-lint, shellcheck/hadolint/yamllint/markdownlint/pre-commit, systemctl/journalctl/rsync/ping/ansible-playbook and more. Every rule ships an inline self-test that CI gates on. Project and user rules still shadow any built-in; builtin_filters = false turns the pack off.git status reads as porcelain — re-run as git status --porcelain=v1 -b and rendered as a working-tree summary. Exact paths are never collapsed to counts, raw porcelain codes never reach the model, and in-progress rebase/merge/bisect (which porcelain omits) is read from .git/ markers instead of a second git status.economy::preservation used to execute only in benchmark. It now scores anchor survival at wrap time on ≥90%-reduction calls; below the floor the verbatim original is stashed and the header carries [anchors: N%].TF_LOG=debug terraform plan and npx terraform plan reach the terraform branch; wrappers peel in a loop (sudo npx vitest); a pipeline ending in a transforming stage (cargo build | grep error) dispatches on that stage.Three methods — all produce the same result (binary at ~/.claude/squeez/bin/squeez, hooks registered).
curl -fsSL https://raw.githubusercontent.com/claudioemmanuel/squeez/main/install.sh | sh
Windows: requires Git Bash. Run the command above inside Git Bash — PowerShell/CMD are not supported.
# Install globally
npm install -g squeez
# Or run once without installing
npx squeez
Downloads the correct pre-built binary for your platform (macOS universal, Linux x86_64/aarch64, Windows x86_64). Requires Node ≥ 16.
cargo install squeez
Builds from crates.io. Requires Rust stable. On Windows you also need MSVC C++ Build Tools.
squeez setup auto-detects every CLI present on disk and registers the hooks. squeez uninstall removes them. Session data and config.ini are preserved so reinstall is lossless.
squeez setup # register into every detected host
squeez setup --host=<slug> # register into one host
squeez uninstall # remove squeez entries from every detected host
squeez uninstall --host=<slug>
Slugs: claude-code / copilot / opencode / gemini / codex / pi / hermes.
After install, restart the CLI you use to pick up the new hooks.
squeez uninstall # preserves session data + config.ini
bash ~/.claude/squeez/uninstall.sh # (legacy) full wipe, if the script exists
squeez update # download latest binary + verify SHA256
squeez update --check # check for update without installing
squeez update --insecure # skip checksum (not recommended)
There are now several token-reduction tools targeting AI coding CLIs. They make different bets — the right one depends on what you care about: zero deps, lossless filtering, structural reformatting, or task-conditioned ML.
If you want a CLI hook that just works, never needs a Python runtime, and never silently inflates your output tokens, squeez is the safe default. If you can run an LLM next to your shell and want task-aware filtering, KRLabsOrg/squeez is worth a look as a complement. The two squeez projects share a name but are independent.
squeez optimizes what it can reach — the surfaces exposed by each host's hook API. It cannot fix token leaks outside those surfaces.
Agent/Task returned output. No hook API surface exists to rewrite an Agent's return value. PostToolUse updatedToolOutput (Claude Code v2.1.119+) covers built-in tools (Read, Grep, Glob, Monitor) but not the Agent/Task result. Workaround: keep agent prompts compact (squeez compresses at dispatch time via PreToolUse), and use squeez_agent_costs MCP tool to monitor spawn overhead.
Skills & slash-command files. Claude Code loads these into the system prompt before any hook fires. squeez has no visibility into session-start system prompt construction.
User's top-level prompt. squeez runs per tool call, not on user turns.
Tools whose host doesn't expose PreToolUse / BeforeTool. E.g. Codex apply_patch hooks landed in 0.123.0, but updatedInput is explicitly unsupported and read_file/grep still have no hook surface (openai/codex#18491) — so Read/Grep caps for Codex are soft hints in AGENTS.md, not hard injections.
[squeez: identical to Skill #N]. Keyed by body hash in a session-long store (not the 16-call window), so it fires even when injections recur far apart[budget: ~N calls left] nudges so the user changes behavior before context pressure spikessqueez cannot automate these, but you can:
squeez_agent_costs to track, then refactor tasks to batch worksqueez compress-md --ultra to drop abbreviations and fillerMeasured on macOS (Apple Silicon). Token count = chars / 4 (matches Claude's ~4 chars/token). Run squeez benchmark to reproduce.
The table above uses chars / 4 for reproducibility (no vocab, no deps). A fair
objection: "that's a made-up unit — show me the reduction under a real byte-pair
tokenizer." So bench/verify_tokens.py re-tokenizes every fixture — the raw
output and the squeez-compressed output — with cl100k_base (the real GPT-4
family BPE tokenizer, via tiktoken) and compares against chars/4:
Reduction ratios are near model-invariant, so a real tokenizer confirms the claim rather than inflating it. Reproduce end-to-end:
cargo build --release
pip install tiktoken
python3 bench/verify_tokens.py # human-readable table
python3 bench/verify_tokens.py --json # machine-readable (see bench/verify_tokens.json)
Nothing is cherry-picked: fixtures that squeez can't help (e.g. kubectl_pods,
a 61-line output below the truncation threshold) stay in the aggregate at 0%.
squeez wrap <cmd> # compress a command's output end-to-end
squeez filter <hint> # compress stdin (piped usage)
squeez config <get|set|list|reset|path> # inspect/change config.ini (also via the /squeez skill)
squeez compress-md [--ultra] [--dry-run] [--all] <file>... # compress markdown files
squeez benchmark [--json] [--output <file>] [--scenario <name>] [--iterations <n>]
squeez mcp # JSON-RPC 2.0 MCP server over stdin/stdout
squeez protocol # print the auto-teach payload (markers + protocol)
squeez update [--check] [--insecure] # self-update
squeez init [--copilot] # session-start hook (called by hook, not manually)
squeez calibrate # auto-tune config from benchmarks
squeez budget-params <tool> # output JSON budget patch for tool
squeez compact-summary [--session-start] # re-inject session state after /compact (called by SessionStart hook)
squeez --version
--no-squeez git log --all --graph
Prefix any command with --no-squeez to run it raw without squeez touching it.
squeez wrapRuns a command, compresses its output, and prints a savings header:
# squeez [git log] 2692→289 tokens (-89%) 0.2ms [adaptive: Ultra]
wrap re-executes the command through a shell: sh -c on Unix, and on
Windows bash -c, then sh -c, when one of them resolves on PATH — every
agent host writes its terminal commands for bash there, so re-running them
under cmd.exe corrupts quoting, $(…), backticks and ;. cmd /C remains
the fallback when no POSIX shell is present, and is also retried automatically
if the preferred shell cannot be spawned. %SystemRoot%\System32\bash.exe is
skipped: that is the WSL launcher, which would run the command inside a Linux
distro rather than against the host filesystem. CLAUDE_CODE_GIT_BASH_PATH is
honoured when set. Set SQUEEZ_SHELL to force a specific shell:
SQUEEZ_SHELL="C:/Program Files/Git/bin/bash.exe" squeez wrap 'ls -la'
squeez filterReads from stdin. Use for manual pipelines:
git log --oneline | squeez filter git
docker logs mycontainer 2>&1 | squeez filter docker
squeez compress-mdPure-Rust, zero-LLM compressor for markdown files. Preserves code blocks, inline code, URLs, headings, file paths, and tables. Compresses prose only. Always writes a backup at <stem>.original.md.
squeez compress-md CLAUDE.md # Full mode (English default)
squeez compress-md --ultra CLAUDE.md # + abbreviations (with→w/, fn, cfg, etc.)
squeez compress-md --lang pt CLAUDE.md # pt-BR locale (articles, fillers, phrases)
squeez compress-md --dry-run CLAUDE.md # preview, no write
squeez compress-md --all # compress all known locations automatically
When auto_compress_md = true (default), squeez init runs --all silently on every session start.
squeez benchmarkReproducible measurement of token reduction, cost, latency, and quality across 19 scenarios:
squeez benchmark # human-readable report
squeez benchmark --json # JSON to stdout
squeez benchmark --output report.json # save JSON report
squeez benchmark --scenario git # run only git scenarios
squeez benchmark --iterations 5 # more iterations per scenario
squeez benchmark --list # list all scenarios
Quality is scored by checking that signal terms (words from error/warning/failed lines in the baseline) survive compression. 19/19 pass at ≥ 50% threshold.
squeez benchmark --efficiency-proof additionally reports cache-aware effective costs: list-price ratios (input ×1.0, cache write ×1.25, cache read ×0.1, output ×5) applied identically to both sides of every row under the same cache state — so the provider's caching discount is never miscounted as compression savings. Negative savings are representable, never floored; JSON output is schema_version: 2. Savings are reported per compressed slice; end-to-end depends on workload.
squeez mcpRuns a Model Context Protocol JSON-RPC 2.0 server over stdin/stdout. Hand-rolled, no mcp.server / fastmcp dependency — keeps the libc-only constraint intact. Wire it into Claude Code:
claude mcp add squeez -- /path/to/squeez mcp
Eighteen read-only tools become available to the LLM:
All read-only. Backed by SessionContext::load(), memory::read_last_n(), and memory::search_history(). No side effects.
squeez protocolPrints the auto-teach payload — a 2.4 KB self-describing block covering:
[squeez: ...] markers, when to call the MCP tools)# squeez [...], [squeez: identical to ...], [squeez: ~95% similar to ...], squeez:summary, # squeez hint:)Same content the MCP squeez_protocol tool returns. Pipe it into a system prompt or paste it into a one-shot session that doesn't have the MCP server connected.
Optional config file — all fields have defaults, none are required.
# ── Compression ────────────────────────────────────────────────
max_lines = 200 # generic truncation limit
dedup_min = 3 # collapse lines appearing ≥N times
git_log_max_commits = 20
git_diff_max_lines = 150
docker_logs_max_lines = 100
find_max_results = 50
bypass = docker exec, psql, mysql, ssh # never compress these
# ── Context engine ─────────────────────────────────────────────
adaptive_intensity = true # truly adaptive: Full <80% budget, Ultra ≥80%
context_cache_enabled = true # track seen files/errors across calls
redundancy_cache_enabled = true # collapse identical OR fuzzy-similar recent outputs
read_dedup_session_long = true # also collapse a re-read of an unchanged file past the 16-call window
summarize_threshold_lines = 500 # outputs above this trigger summarize fallback (×2 if benign)
compact_threshold_tokens = 120000 # session token budget — drives adaptive intensity
# ── Session memory ─────────────────────────────────────────────
memory_retention_days = 30
# ── Output / persona ───────────────────────────────────────────
persona = ultra # off | lite | full | ultra
focus = off # off | adhd — output *structure*, orthogonal to persona
auto_compress_md = true # run compress-md on every session start
lang = en # compress-md locale: en | pt (pt-BR) — more languages extensible
# ── Advanced tuning (rarely needed) ───────────────────────────
max_call_log = 32 # rolling call log depth (also caps redundancy window)
recent_window = 16 # how many recent calls are eligible for redundancy lookup
similarity_threshold = 0.85 # Jaccard threshold for fuzzy dedup (0.0–1.0)
ultra_trigger_pct = 0.80 # fraction of context budget at which Full → Ultra
class_density = true # content-class token estimate: dense chars/2.0, prose chars/3.7 (false = legacy flat path)
net_win_min_tokens = 24 # skip compression + header when it saves less than this (0 = gate off)
mcp_prior_summaries_default = 5 # default n for squeez_prior_summaries
mcp_recent_calls_default = 10 # default n for squeez_recent_calls
# ── Token economy ─────────────────────────────────────────────
agent_warn_threshold_pct = 0.50 # warn when agent cost > 50% of budget
burn_rate_warn_calls = 20 # warn when < 20 calls remaining
agent_spawn_cost = 200000 # estimated tokens per Agent/Task spawn
read_max_lines = 0 # max lines injected into Read tool_input (0 = off)
grep_max_results = 0 # max results injected into Grep tool_input (0 = off)
# ── Auto-curation nudges ──────────────────────────────────────
nudge_enabled = true # emit [squeez: hint ...] markers on recurring patterns
nudge_error_threshold = 3 # fingerprint repeats before a nudge fires
nudge_file_mod_threshold = 5 # writes/creates to same path before nudge fires
nudge_cmd_repeat_threshold = 4 # expensive-command repeats before nudge fires
# ── Continuous handler calibration ────────────────────────────
handler_stats_enabled = true # accumulate per-handler savings across sessions
When adaptive_intensity = true (default), squeez actually adapts to session pressure rather than always running Ultra:
Floors are enforced so we never reduce to zero: max_lines ≥ 20, git_diff_max_lines ≥ 20, dedup_min ≥ 2, summarize_threshold_lines ≥ 50.
The active level is shown in every bash header: [adaptive: Full] or [adaptive: Ultra].
Pre-0.3 squeez was effectively always-Ultra. The new behavior preserves more verbatim text in the common case (empty / mid-session) and only graduates to aggressive compression when the context budget is genuinely under pressure.
Three intensity levels (lite, full, ultra) and off. Default is ultra. The persona prompt is injected into:
SessionStart)… block in ~/.copilot/copilot-instructions.md for Copilot CLIfocus = adhd is a second, independent axis. Persona decides how terse the
prose is; focus decides how it is ordered. They stack — persona = ultra plus
focus = adhd keeps maximum compression while forcing action-first structure.
Turning it on changes three surfaces:
lang) rides
alongside the persona block: lead with the next action, number multi-step
work, restate state in one line, concrete time estimates, cap lists at 5, no
preamble or closing pleasantries.[squeez: …] bursts are capped at 5 per command
with an honest +N more advisories suppressed tail, and squeez doctor
sorts failures first and ends with one command to run.squeez config set focus adhd # then `squeez init` to rewrite the memory block
squeez config set focus off # back to the default ordering
The ruleset is adapted from the MIT-licensed i-have-adhd skill by ayghri.
Each bash command passes through four strategies in order:
dedup_min times are collapsed to one entry annotated [×N]dir/ N modified [squeez grouped]Head (keep first N) or Tail (keep last N) depending on handler; truncated portion notedSix hooks work together automatically after install on Claude Code (three on Copilot CLI):
PreToolUse — rewrites safe Bash calls: git status → squeez wrap git status (risky/bypassed commands pass through to native permission rules); injects Read/Grep/Glob limits; compresses Agent/Task promptsSessionStart — runs squeez init: finalizes previous session into a memory summary, injects the persona promptPostToolUse — tracks every tool result; rewrites Read/Grep/Glob/Monitor output via updatedToolOutput when content is redundant or oversized (Claude Code v2.1.119+)SubagentStop (Claude Code only) — feeds last_assistant_message into SessionContext so the parent agent can dedup against what the sub-agent sawPreCompact (Claude Code only) — logs compaction events for session efficiency metrics; allows compaction to proceedPostCompact (Claude Code only) — logs the compaction. Session state (files, errors, git refs, retrievable blob ids) is re-injected by SessionStart with source: compact (squeez compact-summary --session-start), since Claude Code does not deliver PostCompact output to the modelTwo-path dedup across the last 16 calls:
Exact match — FNV-1a hash of the compressed output. When a subsequent call produces the same bytes, it collapses to:
[squeez: identical to 515ba5b2 at bash#35 — re-run with --no-squeez]
Fuzzy match — bottom-k MinHash over whitespace-token trigrams (k=96, Jaccard ≥ 0.85, length-ratio guard ≥ 0.80). Survives timestamp changes, added/removed blank lines, and single-line edits. Collapses to:
[squeez: ~92% similar to 515ba5b2 at bash#35 — re-run with --no-squeez]
Minimum 6 lines to attempt fuzzy match (below that, exact-only).
When raw output exceeds summarize_threshold_lines (default 500), the full pipeline is bypassed and replaced with a ≤40-line dense summary:
squeez:summary cmd=docker logs app
total_lines=5003
top_errors:
- error: connection refused on tcp://10.0.0.1:5432
top_files:
- /var/log/app/error.log
test_summary=FAILED: 3 of 248
ids_preserved:
- 3f2ec81ea3e4ce24
- 550e8400-e29b-41d4-a716-446655440000
- PROJ-1482
tail_preserved=20
[last 20 lines verbatim...]
Identifier factsheet: the ids_preserved: block carries exact identifiers found in the region the summary drops — git SHAs / hex ids (≥7 chars with a digit), UUIDs, ticket codes, versions, and large integers — so the most dangerous failure mode of lossy summarization (a silently lost hash) can't happen. Extraction is deterministic and budget-capped at 16 facts / 256 chars; bulk generated sequences (hundreds of version strings in a build log) are recognized as noise and dropped wholesale while opaque ids survive. The Structured summary shape carries the same list as "ids":[...].
Benign-aware threshold: before summarizing, squeez scans for error markers (error:, panic, traceback, FAILED, EXCEPTION, Fatal). If none are found, the threshold is doubled (1,000 lines default) so successful builds, clean test runs, and uneventful logs stay verbatim unless they are genuinely huge.
Plugin installed at ~/.config/opencode/plugins/squeez.js. OpenCode auto-loads plugins on startup. All Bash commands are automatically compressed via squeez wrap.
Directory plugin installed at $HERMES_HOME/plugins/squeez-fallback/ —
~/.hermes/plugins/ when HERMES_HOME is unset (a leading ~ is expanded).
Set HERMES_HOME if Hermes lives elsewhere (e.g. %LOCALAPPDATA%\hermes on
Windows), otherwise
squeez setup --host=hermes will not detect it. Directory plugins are opt-in;
enable it once with hermes plugins enable squeez-fallback.
Hooks registered in ~/.copilot/settings.json. Session memory written to ~/.copilot/copilot-instructions.md (Copilot CLI reads this automatically). State stored separately at ~/.copilot/squeez/.
Refresh memory manually:
SQUEEZ_DIR=~/.copilot/squeez ~/.claude/squeez/bin/squeez init --copilot
TypeScript extension installed at ~/.pi/agent/extensions/squeez/index.ts. Pi auto-discovers extensions from that directory — no settings patching needed. Session memory is injected via a skill at ~/.pi/agent/skills/squeez/SKILL.md; Pi includes the skill description in every system prompt and loads full instructions on demand. Unlike other hosts, Pi achieves BUDGET_HARD output compression via the tool_result event (return-patch API), not just soft hints.
Requires Rust stable. Windows requires Git Bash.
git clone https://github.com/claudioemmanuel/squeez.git
cd squeez
cargo test # run all tests (356 tests, 37 suites)
cargo build --release # build release binary
bash bench/run.sh # filter-mode benchmark (14 fixtures)
bash bench/run_context.sh # context-engine benchmark (3 wrap scenarios)
./target/release/squeez benchmark # full 19-scenario benchmark suite
bash build.sh # build + install to ~/.claude/squeez/bin/
git checkout -b feature/your-change
cargo test
cargo build --release
bash bench/run.sh
git push -u origin feature/your-change
gh pr create --base main --title "Short title" --body "Description"
CI runs cargo test, bench/run.sh, bench/run_context.sh, and squeez benchmark on every push and pull request.
See CONTRIBUTING.md for coding standards.
There is an unrelated project with the same name at KRLabsOrg/squeez. This project (claudioemmanuel/squeez) is a hook-based token compressor for AI coding CLIs.
Contributions require a DCO sign-off (git commit -s …) rather than a CLA. You keep copyright on what you contribute; sign-off is a lightweight affirmation that you have the right to submit it under Apache 2.0. See CONTRIBUTING.md for details.
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
Genel bakış
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.
Araçlar
Henüz araç listesi yok. Uzak sunucular ilk sağlık kontrolünden sonra bir liste alır.
SSS
Bu sayfadan Cursor, Claude Desktop, Claude Code veya VS Code için stdio yapılandırmasını kopyalayın. PlugMCP proxy'sini değil, yayıncının kurulumunu kullanır.
Bu kayıtta gerekli bir ortam değişkeni listelenmiyor.
Squeez yerel olarak stdio üzerinden çalışır.
Son kontrol: 2026-11-13. 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.