Squeez
Hook-based token compressor for 5 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI). Up to 95% bash compression, signature-mode for code reads, cross-call dedup, MCP server, self-teaching protocol. Zero runtime deps.
What is Squeez?
Squeez is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to hook-based token compressor for 5 ai cli hosts (claude code, copilot cli, opencode, gemini cli, codex cli). up to 95% bash compression, signature-mode for code reads, cross-call dedup, mcp server, sel...
Hook-based token compressor for 5 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI). Up to 95% bash compression, signature-mode for code reads, cross-call dedup, MCP server, self-teaching protocol. Zero runtime deps.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Hook-based token compressor for 5 AI CLI hosts (Claude Code,
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx squeezConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Squeez
Squeez is a hook-based token compressor written in Rust that integrates transparently with five AI CLI hosts — Claude Code, Copilot CLI, OpenCode, Gemini CLI, and Codex CLI — to reduce the number of tokens consumed by bash output and file reads by up to 95%. It works by intercepting PreToolUse and PostToolUse hooks to compress command output before it enters the context window, using a four-stage pipeline of ANSI stripping, deduplication, grouping, and truncation with zero runtime dependencies. The companion MCP server exposes 13 read-only introspection tools that let the AI itself query session history, compression ratios, error fingerprints, and token accounting without consuming additional context.
Prerequisites
- Unix-based OS (macOS or Linux); Windows requires Git Bash — PowerShell is not supported
- Node.js 16+ (if installing via npm/npx) or Rust stable (if building from source)
- Claude Code, Copilot CLI, OpenCode, Gemini CLI, or Codex CLI already installed
- No Python, PyTorch, or external LLM server required — all compression is pure Rust
Install Squeez
Choose one of three installation methods. The curl method is recommended for the fastest setup and auto-registers hooks into all detected AI CLI hosts.
# Recommended: curl installer
curl -fsSL https://raw.githubusercontent.com/claudioemmanuel/squeez/main/install.sh | sh
# Or via npm:
npm install -g squeez
# Or via cargo:
cargo install squeezRegister hooks into your AI CLI hosts
Run squeez setup to auto-detect installed hosts and register the PreToolUse/PostToolUse hooks. Use --host to target a specific host.
squeez setup
# Or for a specific host:
squeez setup --host=claude-codeRestart your AI CLI host
Hooks take effect only after the host is restarted. Quit and reopen Claude Code (or your chosen host) to activate compression.
Optional: tune configuration
Edit the config file to adjust compression intensity, set bypass commands, or change the persona level. For Claude Code the config lives at ~/.claude/squeez/config.ini.
# ~/.claude/squeez/config.ini example overrides:
[compression]
max_lines = 200
dedup_min = 3
bypass = docker exec, psql, mysql, ssh
persona = ultra
[context_engine]
adaptive_intensity = true
summarize_threshold_lines = 500Add the MCP server for session introspection (optional)
To give your AI assistant visibility into compression stats and session history, add the Squeez MCP server to your client configuration.
Run a benchmark to verify savings
Run the built-in benchmark suite across 28 scenarios to confirm compression is working and measure your actual token reduction.
squeez benchmark
# Or save detailed results to JSON:
squeez benchmark --json --output results.jsonSqueez Examples
MCP server client configuration
Add this to your claude_desktop_config.json to expose the 13 Squeez introspection tools to Claude Code.
{
"mcpServers": {
"squeez": {
"command": "squeez",
"args": ["mcp"]
}
}
}Prompts to try
Once the MCP server is running, Claude can query its own compression metrics and session data.
- "Show me the squeez session summary with token savings so far"
- "What errors have been seen in this session according to squeez?"
- "List the files I've read and written in this session"
- "What is the current compression efficiency ratio?"
- "Search session history for any occurrences of 'database connection'"Troubleshooting Squeez
Hooks are not active after running squeez setup
Hooks require the AI CLI host to be restarted. Quit Claude Code completely and reopen it. If hooks still don't appear, run 'squeez setup --host=claude-code' explicitly and check for error output. Verify that ~/.claude/CLAUDE.md contains the squeez hook entries.
Commands that should not be compressed are being truncated
Add the command to the bypass list in ~/.claude/squeez/config.ini under [compression] bypass = your-command. Alternatively, prefix any one-off command with '--no-squeez' to skip compression for that invocation.
squeez: command not found after npm install
The npm global bin directory may not be in PATH. Run 'npm bin -g' to find the directory and add it to PATH in your shell profile (~/.zshrc or ~/.bashrc). Alternatively use npx squeez or use the curl installer which places the binary in ~/.claude/squeez/bin/ and updates PATH automatically.
Frequently Asked Questions about Squeez
What is Squeez?
Squeez is a Model Context Protocol (MCP) server that hook-based token compressor for 5 ai cli hosts (claude code, copilot cli, opencode, gemini cli, codex cli). up to 95% bash compression, signature-mode for code reads, cross-call dedup, mcp server, self-teaching protocol. zero runtime deps. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Squeez?
Follow the installation instructions on the Squeez GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Squeez?
Squeez works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Squeez free to use?
Yes, Squeez is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.
Squeez Alternatives — Similar Developer Tools Servers
Looking for alternatives to Squeez? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Squeez in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Squeez?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.