Squeez

v1.0.0Developer Toolsstable

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.

ai-clibash-hookclaude-codecodex-clicontext-engineering
Share:
126
Stars
0
Downloads
0
Weekly
0/5

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

AI CLI token compression up to 95%
Context window optimization
Cross-call deduplication
claudioemmanuel

Maintainer

LicenseApache-2.0
Languagerust
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx squeez

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 squeez
2

Register 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-code
3

Restart 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.

4

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 = 500
5

Add 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.

6

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.json

Squeez 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.

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.

Quick Config Preview

{ "mcpServers": { "squeez": { "command": "npx", "args": ["-y", "squeez"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides