# sqz

sqz shrinks command output before it reaches the agent's context and swaps repeats for short references. Useful when build logs and repeated file reads eat your tokens.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 679 repo stars
- Author: ojuschugh1
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ojuschugh1/sqz
- Updated: 2026-10-22
- Security check: automated, 2026-11-16 (text) — warning: a command downloads a script from raw.githubusercontent.com and runs it right away; a PowerShell command downloads a script from raw.githubusercontent.com and runs it right away. Do not run such commands without an explicit yes from the human.
- HTML: https://affpapa.org/en/nevibecode/mcp/sqz

## What it does

sqz sits between your agent and its tool output. Each command gets its own formatter: a failed `cargo test` run shrinks to the failure and its `file:line`, and the rest is cut. When the model has already seen the same output, or the same line range of a file, it gets a short reference in place of the text.

It is a single Rust binary. No LLM calls, no telemetry, no network needed, and the output is deterministic. `sqz init` writes hooks, the MCP server and agent guidance for each client it detects. `sqz gain` shows a week of savings, and `sqz expand` restores any compressed result byte for byte.

Source code, stack traces, migrations and credential lines go through untouched, so the first read of a file costs the same tokens as before. Output containing credentials, a stack trace or a migration is never cached either.

## Requirements
- Needs: a prebuilt binary from the repository releases

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- cut `cargo test` output down to the failure and its `file:line`
- stop re-sending an unchanged `git status` on every turn
- replace a repeated read of the same file lines with a short reference
- check with `sqz gain` how many tokens a week of sessions saved

## Example prompts
- Install sqz with `cargo install sqz-cli sqz-mcp`, then run `sqz init`
- Run `sqz gain` and tell me how many tokens sqz saved this week
- Restore the full output of that compressed result with `sqz expand`

## Similar
- [learn-codebase](https://affpapa.org/en/nevibecode/skills/learn-codebase.md) — skill · 5800 installs
- [ctx-stats](https://affpapa.org/en/nevibecode/skills/ctx-stats.md) — skill · 1900 installs
- [wiki-context-pack](https://affpapa.org/en/nevibecode/skills/wiki-context-pack.md) — skill · 1700 installs
- [caveman](https://affpapa.org/en/nevibecode/skills/shawnchee-caveman.md) — skill · 1100 installs
- [context-optimization](https://affpapa.org/en/nevibecode/skills/context-optimization.md) — skill · 532 installs
- [context-compressor](https://affpapa.org/en/nevibecode/skills/context-compressor.md) — skill · 274 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
