sqz
Compresses tool output before it enters the agent's context: saves tokens and leaves source code and traces untouched
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Installs hooks into client settings and intercepts the agent's tool output
- Processes output content, although it passes source code and secrets through untouched
Install
Manual install
npm install -g sqz-cliInstalls the sqz binary. Homebrew, cargo and an install script are also available.
This is third-party code. Review the repository files before installing.
What it does
sqz is a Rust utility that compresses tool output before it reaches the agent's context window. Per-command formatters keep what the agent acts on, such as a failing test or an error line, and drop the rest. What the model already saw in context comes back as a short reference instead of repeated content. Source code, stack traces and secrets pass through untouched. The sqz init command wires hooks and an MCP server into the clients it finds, and any compressed result can be expanded back byte for byte via sqz expand. Everything runs locally and with no model calls.
Who it is for. For developers who run coding agents and want to cut token spend on tool output.
Good fit when
- The agent spends many tokens on build logs, tests and repeated file reads
- You want to shrink context without losing key facts from the output
- You need deterministic output handling with no model calls
Not a fit when
- Your client has no hook support and the MCP integration alone is not enough
- Token spend is not a concern and an extra processing layer is unwanted
Example request
Set up tool output compression so failing tests and logs do not flood the contextLimitations
Hooks are written into client settings, globally in ~/.claude/settings.json or locally per project, and sqz merges its entries rather than overwriting existing ones. Building from source via cargo needs a C toolchain, but there are prebuilt binaries and install via npm, Homebrew or a script. Part of the gain depends on which commands the agent calls most.
How to disable. Remove the sqz hooks from client settings and uninstall the binary, for example via npm uninstall -g sqz-cli or your package manager's tools.
Security check
- Installs hooks into client settings and intercepts the agent's tool output
- Processes output content, although it passes source code and secrets through untouched
README in short
The README presents sqz as context compression for coding agents: tool output is compressed before it enters context and repeats come back as short references. It states that source code, traces and secrets pass through untouched and any result can be expanded back. It is a single Rust binary, deterministic, with no model calls, and has an sqz init command to wire hooks and an MCP server into various clients. Installation goes through prebuilt binaries, npm, Homebrew, cargo or a script. Claude Code, Cursor, Codex and other clients are supported.
FAQ
Can compressed output be restored?
Yes, any result expands back byte for byte with sqz expand, and source code and secrets are not compressed at all.
Does it need model calls?
No, sqz is deterministic, works offline and makes no calls to a language model.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything