Repository navigation
v2.0.0
sqz 2.0.0 is a security and correctness release. Upgrade if you use sqz's Claude Code, Copilot CLI, Cursor or OpenCode hook: up to 1.9.0 these hooks answered every rewrite with an approval, so a rewritten command could run without the approval prompt your settings would have shown. In 2.0.0 the hooks leave that decision to the client. It is a major version because sqz-engine's public API changed (CollapseArraysConfig has a new public field, max_chars, which breaks code that builds it with a struct literal, and process_hook_cursor now always returns Err) and some CLI behaviour changed, such as sqz uninstall and sqz reset now refusing to run without --yes when stdin is not a terminal.
Upgrade
Install 2.0.0 the way you installed sqz:
# Cargo
cargo install sqz-cli sqz-mcp
# Homebrew
brew upgrade ojuschugh1/sqz/sqz
# npm
npm install -g sqz-cli
# PyPI
pipx reinstall sqz
# Install script, macOS and Linux
curl -fsSL https://raw.githubusercontent.com/ojuschugh1/sqz/main/install.sh | sh
# Install script, Windows (PowerShell)
irm https://raw.githubusercontent.com/ojuschugh1/sqz/main/install.ps1 | iex
Then run sqz doctor --fix, after upgrading and never before, since the repairs come from the 2.0.0 doctor. sqz doctor --fix and sqz uninstall treat the current directory as the project and can delete files there that hold only sqz content, so run them from the directory you mean.
sqz doctor --fix
If doctor prints <file> runs <path>, not this sqz binary, that hook still runs the other copy, so upgrade that copy too. Then restart or reconnect your MCP clients so they start the new sqz-mcp.
Changelog
Security
- sqz no longer approves commands on your behalf. The Claude Code hook returned
permissionDecision: "allow"with every rewrite, and in Claude Code an allow skips the permission prompt, so a command likegit push --forceorrm -rf buildran without the prompt your settings would have shown (deny and ask rules still applied). Copilot CLI 1.0.66 and later treat itsallowthe same way. The Claude Code and Copilot CLI hooks now return only the rewritten input and leave the decision to the client. Checked against Claude Code 2.1.286: a command that needed approval before still needs it after the rewrite, and one your rules allow still runs without a prompt. sqz hook cursorandsqz hook opencodeno longer approve commands. From 0.7.0 through 1.9.0 the Cursor hook answered every rewrite with"permission": "allow", which lets Cursor run the command without its own approval, and from 0.6.0 through 1.9.0 the OpenCode hook answered with"decision": "approve".sqz init0.4.0 through 0.7.0 wrote.cursor/hooks.jsonrunning<sqz path> hook cursor(0.4.0 to 0.6.0 in Claude Code's hook format), and later versions left the file in place, so in a project set up with 0.7.0 every command the hook rewrote was approved. Cursor reads any answer to a permission hook as a decision and takes a new command only together with one, sosqz hook cursornow prints nothing, writes one line to stderr and exits 1, which Cursor treats as a failed hook: its normal approval applies and the command runs as written, uncompressed.sqz doctorreports such a hook in.cursor/hooks.jsonor~/.cursor/hooks.json, andsqz doctor --fixandsqz uninstallremove it, keeping any other hooks and deleting the file when nothing else is left. The OpenCode hook now returns only the rewritten command;sqz inithas never installed it, since OpenCode gets the plugin.
Added
- Claude Code commands keep your permission rules when rewritten. Claude Code checks its rules against the rewritten command and treats a grouped
{ ...; } | sqzcommand as too complex to match any of them, so the hook now gives each command its own pipe instead:set -o pipefail; cd sub && cargo test 2>&1 | sqz compress --cmd 'cargo test'.pipefailkeeps each command's exit status and the&&/||logic, andcd,exportandsourcestay outside the pipes, so lists that change shell state are compressed too.sqz initadds two allow rules for the parts the rewrite adds,Bash(set -o pipefail)andBash(sqz compress --cmd *); neither runs anything. Until they are there the hook leaves commands alone, andsqz doctorflags an older install (--fixadds them and keeps the hook's sqz binary while it resolves, a baresqzonPATHincluded). Pipelines, loops and heredocs are left as written, except in bypass mode where nothing is checked. A list is also left as written, in every mode, when one of its piped commands could stop the shell on a failed expansion (${DEST:?},$((1/0)), and unless$SHELLis bash an unquoted glob that matches nothing,=cmdor~user) and another command follows after;, a newline or||: piped on its own the failing command would stop only its pipe, and the rest would run.&&is fine, sincepipefailstops the list there. On 12,676 real agent commands, 56.3% are rewritten in default mode with zsh as$SHELL(56.4% with bash; 1.9.0 rewrote 26.7%, and approved all of them) and 95.4% in bypass mode; 4,261 of the rest contain a pipe, where the agent is usually filtering the output already. - Claude Code PostToolUse hook. When a command the PreToolUse hook left alone exits 0,
sqz hook claude-postcompresses its stdout and stderr in place throughupdatedToolOutput, which keeps the Bash result's shape. Output Claude Code has already cut to a preview (BASH_MAX_OUTPUT_LENGTH, 30,000 characters by default), images and interrupted commands are left as they are. It always answers with the compressed text, never a§refto earlier output, so a second copy of the hook can't point the model at output it never saw; the original is still stored forsqz expand. A repeated output shows insqz statsandsqz gainas an ordinary compression, not a dedup hit or a quick re-run. sqz-mcp --version. It printed nothing and started the stdio server, which then waited on stdin; it now printssqz-mcp <version>and exits, like--help. Flags it doesn't know still start the server, as before. 1.9.0 and earlier started the server.
Changed
-
sqz adds fewer tokens to every model request. The sqz-mcp tool and parameter descriptions went from 4,907 to 1,871 characters, so
tools/listdropped from 8,705 to 5,779 bytes (about 2,177 to 1,445 tokens by doctor's estimate), and§ref:HASH§is explained once, onexpand. The guidancesqz initwrites for Kiro, Codex, Zed, Cursor, Windsurf and Cline is one shared text of under 1 KB; the files it goes into went from 13,337 to 5,282 bytes together. It keeps the pipe with the absolute binary path, what not to pipe, which MCP tools to prefer, how to read and expand§reftokens and«A1»symbols, and the opt-out variables, and drops the rest, including every percentage. Codex and Zed share oneAGENTS.mdblock (sqz-guidance) instead of writing one each. -
Older sqz guidance is upgraded in place.
sqz doctorflagsAGENTS.mdand.rulesblocks, Kiro steering, and Cursor, Windsurf and Cline rules written by an older sqz;--fixrewrites them keeping the binary path they point at, andsqz initrewrites them with its own. The oldsqz-agents-guidanceandsqz-zed-guidanceblocks become one block where the first of them was. Text outside the sqz markers stays as it is, but anything you added inside an old block, or inside the text an older sqz wrote at the top of.clinerules, is replaced, so move it below first. Cline's rules are now the same marked block, so your own rules in.clinerulessurvive later upgrades andsqz uninstall, and the old text in.windsurfrulesis removed without the rules that follow it. Files sqz did not write are never touched, and a current copy saved with CRLF line endings counts as current. Doctor's overhead report counts the shared block once, on a line for each file Codex and Zed read. -
sqz doctorshows the integration tier of every client. Transparent clients (Claude Code, Copilot CLI, Gemini CLI, OpenCode) have a hook that routes shell commands through sqz on its own. Advisory clients (Kiro, Cursor, Windsurf, Cline, Codex, Zed) can't let sqz rewrite tool calls, so sqz saves tokens there only when the agent chooses to pipe output throughsqz compressor call the sqz MCP tools; their built-in shell and file tools bypass it. Before this, doctor showed both as "configured", which is how "sqz saves nothing in my Kiro sessions" looked like a bug instead of a limit. -
Doctor reports what sqz adds to every model request: the size of the installed sqz-mcp tool definitions and every copy of sqz guidance Kiro loads (user and project steering, AGENTS.md blocks).
-
sqz initno longer writes project-level Kiro steering when the user-level copy exists. Kiro applies~/.kiro/steeringto every workspace, so the project copy was the same guidance sent twice. -
The MCP read tools cap what they return.
sqz_read_filereturned up to 4 MB (about a million tokens) by default; it now stops at 256 KB, cuts on a line boundary, and putscontinue_with_offsetin the header. The cap applies afteroffset/limit, so a ranged read deep into a big file still works, and files over 64 MB are refused instead of loaded.sqz_grepclips a match line over 400 chars to a window around the hit (one minified bundle used to return its whole line) and stops at 100 KB of output.sqz_list_dirstops at 1000 entries. Every cap is a tool parameter (max_bytes,max_line_chars,max_entries; 0 lifts it) and the header says when one cut the output. -
sqz discover --replayestimates what sqz can actually reach. 1.9.0 ran every tool output through the full lossy pipeline, so web fetches (which sqz can't intercept) and built-in file reads (which the sqz read tools return losslessly) made up almost all of its estimate, including the README example. Replay now handles each output the way sqz could have reached it on that client: shell output through the hook path (on Claude Code, split into commands the hooks compress and ones they skip), file reads dedup-only, other MCP servers exactly whatsqz-mcp proxydoes, and web fetches, edits and sub-agent results counted as out of reach. The report gives two totals, saved with no help from the agent and saved if the agent uses every route, and says how much of the second is the proxy's lossy first pass. Kiro IDE sessions (~/.kiro/sessions/<workspace>/<session>/, sub-agent runs included) are new, and Kiro CLI shell and MCP results, which the 1.9.0 parser skipped because they are JSON items, are read. -
The shell hook rewrites pipes, lists, loops and heredocs. It skipped any command containing
|,&&,;,>or<<, which left 73% of one machine's 12,676 real agent commands uncompressed. A quote-aware scanner now pipes the whole command through sqz as one group (Gemini CLI, Copilot CLI, and Claude Code in bypass mode; other Claude Code sessions get the per-command form above), keeps a leadingcd dir &&outside it so the directory change sticks, and leaves alone anything that changes shell state (export,source,set, a latercd, a variable set in a loop orifbody), backgrounds a job, follows output (tail -f,docker logs -f,kubectl get -w), runs a server (npm run dev,rails s,docker compose upwithout-d), already runs sqz (a Windows path tosqz.exeincluded) or nests more than 64 levels deep. It also leaves a command alone when the group could run different commands than the original: when a leadingcd dir &&is followed by;,||or another line, all of which a failedcdwould skip along with the group, and, with bash as$SHELL, when more lines follow one with an arithmetic expansion or a${...}such as${VAR:?}or${VAR^^}, since bash goes on to the next line after some failed expansions. On those commands the share rewritten went from 26.7% to 94.9%, and every rewrite parses in bash and zsh wherever the original did. Lists and pipelines skip the per-command formatters, since their output is partial or comes from several commands.pythonandnoderunning a script,-ccode or-mmodule are rewritten too; bare REPLs,-iand dev servers still aren't. -
sqz compressis faster on large and error-heavy output. The checks that make sure no error line is lost searched the whole output once per error line, so a 1 MB log where every line is an error took 1.5 s; they now find every line in one pass, and that log takes 0.38 s. The tokenizer also ran over the same text up to five times per call and now counts each text once. At 1 MB an app log went from 604 to 404 ms and akubectl gettable piped in from 580 to 401 ms. Output that now keeps all its data still costs more than in 1.9.0: 1 MB of JSON 378 to 490 ms,cargo testwith failures 404 to 531 ms, andkubectl getthrough the shell hook 65 to 397 ms. Calls under 10 KB are unchanged at about 40-45 ms. -
Safe mode is decided by structure, not by words. A whole output went to safe mode if it mentioned a panic, a password, an api key or legal text anywhere, so a
git logwhose commit messages mention a panic, a README with apassword: &strexample or an HTML page with a privacy policy footer was cut and never stored, and nothing dropped from it could be expanded. Safe mode now needs a trace header followed by frames (Rust, Python, JVM, JavaScript, Go), DDL at the start of a line, a PEM block, or a credential line with a real value; everything else gets the normal pipeline, stored and expandable. Python tracebacks now pass through whole like the others. Output that looks like it holds a secret is still never stored, on every path including the MCPcompresstool. -
The docs say what sqz measures and does. The integration tables list Cursor, Windsurf, Cline and Kiro as advisory instead of hooked, the benchmark tables, quality benchmark and white paper come from fresh runs, and the latency claim (p99 under 5 ms up to 100 KB, never measured) is replaced by measured numbers: about 40 ms per
sqz compresscall up to 10 KB, most of it process start and building the tokenizer, 76-86 ms at 100 KB and 330-525 ms at 1 MB, on an Apple M4 Pro. -
The docs site, extension guides and npm README are corrected. Links on the docs site that led nowhere now resolve, the Chrome and Firefox guides describe the
wasm-pack --target no-modulesbuild thatbackground.jsloads (Firefox 140 or later), and the npm README lists the same clients and commands as the main one. -
Large outputs can need more memory than in 1.9.0. Output that now keeps most of its data also feeds more text to the n-gram abbreviation pass. Piped into
sqz compresswithout--cmd, a 10 MBcargo testlog peaks at about 1.05 GB and an error-heavy log at 1.1 GB, against 353 and 731 MB in 1.9.0. With the command as the label, as the hooks pass it for a single command, thecargo testlog peaks at 128 MB against 122 MB in 1.9.0, and the error log, labelledkubectl logs api, at 1.1 GB against 132 MB, since the 1.9.0kubectl logsformatter cut it to 4 KB.SQZ_NO_ABBREV=1brings the unlabelledcargo testrun down to 250 MB and the labelled error log to 274 MB. -
sqz initleaves Claude Code hooks to the user-level settings. When~/.claude/settings.jsonalready has the sqz hooks,sqz initat project scope no longer adds them to.claude/settings.local.jsonand says why.sqz doctorflags hooks installed at both scopes, and--fixremoves the project copy, keeping its permissions; the file is deleted only if nothing else is left. -
sqz doctorchecks which sqz binary each hook runs. It reports hook and plugin files whose sqz binary no longer exists (Claude Code, Gemini CLI, Copilot CLI, OpenCode), and--fixpoints them at the running binary; it never writes a hook whose binary does not exist. It also notes hooks that run a different sqz binary than the one running doctor, so after an upgrade reinstall sqz first, then runsqz doctor --fix. -
sqz uninstallandsqz resetneed an answer. Without--yes, an empty answer counted as yes, so with stdin closed or piped from nothing they went ahead. When stdin is not a terminal and gives no answer they now stop with a message;yoryeson a pipe still works, and a terminal keeps the[Y/n]default. 1.9.0 and earlier went ahead.
Fixed
- Gemini CLI commands kept only their
commandargument. Gemini's scheduler replaces a call's arguments with the hook'stool_inputrather than merging it, so a rewritten command lostdir_pathand ran in the project root. The hook now sends every original argument. - A command's own stderr redirect lost to the hook's. The one-line rewrite put
2>&1after the command, socargo build 2> errors.logsent its errors into the pipe and lefterrors.logempty, and2>/dev/nullstopped hiding anything. The redirect now sits on the group, where the command's own wins. sqz uninstalldeleted a project's whole.claude/settings.local.json. Claude Code saves your "don't ask again" answers in that file, so they went too. It now removes only sqz's hooks and rules, and the file only if nothing else is left.- A trailing
# commentbroke the rewritten command. The comment ran on over the closing}of the group, so the shell hit end of file instead of running the command. - Background tool calls are no longer piped through sqz. Claude Code's
run_in_background, Gemini'sis_backgroundand async calls stream their output while they run; through sqz nothing showed until the command exited, so a server started in the background looked dead. sqz compresspasses binary output through. Input that wasn't UTF-8 made it print a read error and exit 1, losing the output. It now writes the bytes back unchanged and exits with the command's status.- The OpenCode plugin keeps the command's exit status. Its rewrite,
cmd 2>&1 | sqz compress, exits with sqz's status, so a failing command reported success. Outside Windows it now uses the exit-status trailer the other hooks use; Windows keeps the old form because PowerShell and cmd.exe can't run it. sqz_list_dirlisted two levels by default. Its schema saysmax_depth1 means the immediate children; it now does.- The
compressMCP tool cut its input to 500 characters. It compressed the serialized{"text": …}request instead of the text, so the pipeline saw one long JSON string and returned its first 500 characters asTOON:{text:"…"}. It now compresses thetextfield. - Entropy truncation no longer drops error lines. A log without blank lines is scored in 10-line windows, and a window holding an
ERRORline could fall below the median entropy and be dropped with the routine ones. A segment that mentions an error, panic, traceback, failure or exception is now always kept. sqz-mcp proxysays how to recover every lossy result. On first pass the pipeline can cut long JSON strings and large arrays, but only entropy-truncated results carried thesqz_expandhint, so an agent shown... and 5 more itemshad no ref to ask for. Every first-pass compression now ends with the hint, and the net-win gate counts it.- JSON output keeps every record and field. Arrays over five elements were cut to five unless every element had the same keys, so a mixed search result (issues next to pull requests, Slack messages with and without threads) showed half its entries, and arrays that did share keys became a text table that printed nested objects as
{6 keys}(every Jira summary and status) and cut strings at 50 characters. JSON projection stripped any key starting with_,debug,internal,traceorx_(an Elasticsearch hit's_source, HAL's_embedded, atraceback), summarized anything five levels down (Notion page titles), droppedcursorand_links(the next page), and kept one timestamp per day, soclosed_atwent when an issue closed the day it opened. Arrays are now cut only past 32,000 characters of compact JSON (max_charsin a preset'scollapse_arrays; 0 restores the count-only cap), projection removes only__v,etagand request or correlation ids, and an array of objects is written as a lossless TOON table: one header row of keys, one line per object, an empty cell for a missing key. On seven MCP payloads (GitHub, Jira, Notion, Elasticsearch, MongoDB, Slack) the proxy now keeps every id and title, against about half before, and saves 36% instead of 67%; most of the 67% was the dropped data. The proxy and thecompressMCP tool also get the verifier's safe-mode fallback thatsqz compressalready had. The browser extension's WASM source has the same array fix; its bundled build predates it. - TOON keeps non-ASCII text as-is.
éwas written as\u00e9and an emoji as a 12-character surrogate pair, which costs more tokens than the character itself. Control characters are still escaped. - Failed commands no longer come back as "ok". Several per-command formatters answered "ok" whenever they didn't find their success line, so a failed
npm install(ERESOLVE) orpip installshowed the agent "ok",git pushrejected or without an upstream showed "ok" or "ok ! [rejected]", agit pullthat stopped on a merge conflict showed "ok",kubectl applyreduced its output to "applied: 1 configured" and dropped theError from serverline, and gradle, dotnet and xcodebuild fell back to the last line of the output. Every formatter result is now checked: if a line that reports a failure (error:,fatal:,npm error,Error from server,CONFLICT,panicked at,! [rejected]and similar, as whole words) is missing, the formatter isn't used and the output goes through the generic pipeline, which keeps error lines. Lines that only restate the failure (Build FAILED.,could not compile) may go when the output still says it failed. Push and pull now drop only transfer progress, so pull request links fromremote:survive. - Formatters no longer replace the data an agent asked for with a summary.
kubectl get -o jsonbecameList: 2500 items (showing 30)with no items,-o yamllost its indentation,kubectl logsdropped the middle of long logs;gh pr view --json body,commentskept only number, title, state and author, andgh pr diff,gh pr viewandgh run viewwere cut at 30 lines; an aws or gcloud object holding an array of more than 30 items became a one-line summary with none of them;lsshowed five file names,findprinteddir/ (40 files)without the names, andgrepkept three matches per file.git log -pand--statkept only commit subjects,git diff --statand--name-onlykept their first line,git show rev:pathstripped the file's indentation,git branchshowed three branches, andgit diffdropped rename, mode and binary lines.terraform plandropped every attribute change (# forces replacementincluded) andterraform applykept onlyApply complete!, losing the outputs. kubectl get and logs, gh, aws, gcloud, ls and find now go through the generic pipeline; grep output is written in ripgrep's heading layout, each path once with every match under it; terraform drops only refresh and progress lines; git log keeps commit bodies and passes anything else through; curl drops only its progress meter, not blank lines or lines starting with%; tree keeps every entry outsidenode_modules-style directories. - Lists under 16,000 characters are no longer entropy-truncated. Entropy truncation drops the segments below the median, about half of any long output, so 60 grep matches came back as 30 and a
findof 80 files as 40. Output where most lines are records (path:line:matches, bare paths,ls -lentries,git log --oneline, aligned tables) keeps every line up to that size. - Prose pruning no longer removes words that carry meaning. The built-in trigram table pruned the only completion it knew for a pair, so "there are no failing tests" became "there are failing tests", "does not exist" became "does not", and "at the same time" became "at the time". Those entries are gone.
- Formatter savings are judged in real tokens. The formatter path counted chars/4 while the pipeline counted BPE tokens, and collapsing column padding shrinks chars/4 a lot but tokens hardly at all, so whitespace-only reformatting passed the net-win gate and was logged as savings. Both paths now use the same token counter.
sqz doctor --fixrepairs log rows written by the pre-1.8.0 token estimator. sqz-mcp before 1.8.0 counted a read tool's input with chars/4 and its output with the BPE tokenizer, so verbatimsqz_read_file/sqz_grep/sqz_list_dirresults logged as larger than their input; on one machine this pushed the all-time total negative, whichsqz statsrendered as "0 tokens saved".--fixnow raises the input count to the real output count, recording those calls as saving nothing, instead of deleting them (the version of this fix that never shipped deleted the rows, which also dropped their real volume from the totals). The database is backed up first withVACUUM INTO, which includes writes still in the WAL.- Doctor and
--fixhandle stale and duplicate Kiro steering. Steering written by an older sqz is refreshed in place, keeping the binary path it points at; a project copy next to the user-level one is removed. Files without the sqz marker are never touched. - The shell block no longer overrides your own
preexecor DEBUG trap. The zsh block defined apreexec()function and the bash block installedtrap … DEBUG; both only exported a variable nothing read, and both replaced any hook of the same kind defined earlier in the rc file.sqz initandsqz doctor --fixrewrite the sqz block in place, touching only the lines between its markers. - Doctor no longer reports a missing shell block as lost savings. The block only defines the optional
sqz_runhelper and compresses nothing on its own. test_init_exits_zeroransqz initagainst the real HOME and this repository, which rewrote the developer's shell rc duringcargo test. It now runs in a throwaway HOME and project.- The same input gives the same output. The
§dict§header listed equal-length patterns in hash-map order, and abbreviations with tied savings were picked and numbered («A1»,«A2») in hash-map order, so the same output could come back different from one run to the next. Ties are now broken on the text itself. - The opt-out examples in the guidance never reached sqz. They put the variable before the first command,
SQZ_NO_DEDUP=1 git log | sqz compress, which sets it forgit logonly. The guidance and theCLAUDE.mdblock now put it right beforesqz compress. - Stack traces, migrations and keys come through whole. sqz routes them to safe mode and said they pass through unchanged, but past about 500 characters the pipeline still cut them, and since safe-mode output is never stored the cut lines could not be expanded: in 1.9.0 a 40-frame Rust panic lost 40 lines, a SQL migration 26, and a key file its
-----END RSA PRIVATE KEY-----line. The per-command formatters ran before the check, so./gradlew testturned a 22-line JUnit trace into 81 bytes and a build-script panic undercargo buildlost 42 of its 55 lines. Safe-mode output now comes back unchanged apart from ANSI codes, and a formatter's summary is used only when every line of each paragraph holding a trace, migration, key or credential line is still in it. - Counts are exact after repeated lines are merged. Ten identical lines came back as one line marked
[×3], a folded diff reported 11 unchanged lines for 18, andcargo buildafter downloading crates reportedok (5 crates compiled)for 30, because the step that merges identical lines ran first. The same step shortened pretty-printed JSON arrays ([0,0,0,0,0,0,1]came back as[0,0,0,1]in safe mode). Counts now come from the original lines, and that step leaves JSON and diffs alone. sqz discoverno longer prints reduction figures nobody measured. Its suggestions gave a reduction range per command, none of them measured, includingkubectl get, which no longer has a formatter. It now names the commands without numbers.- The exit status survives an expansion error. A rewritten
{ cmd; printf trailer; } | sqzprinted no trailer whencmdstopped the shell on an expansion error, such as${X:?}, a zsh=cmdthat isn't found or a zshforloop over a glob that matches nothing, so sqz exited 0 and the agent saw success. The command now runs in a subshell inside the group, so the trailer always reports its status. Gemini CLI, Copilot CLI, Windsurf, the OpenCode plugin and Claude Code in bypass mode use this form; it shipped for single commands in 1.6.1 through 1.9.0. - Negative and wide exit codes in the trailer. PowerShell reports a crashed native command as a negative
$LASTEXITCODEsuch as -1073741819, and the trailer parser took only digits, so the marker stayed in the output and sqz exited 0; a code of 256 also came out as 0. sqz now exits with the low byte on Unix (1 when that byte is 0) and the full code on Windows. Shipped in 1.6.1 through 1.9.0. - Copilot CLI's
toolArgsas a JSON string. GitHub documentstoolArgsas a string of JSON, and the hook read only an object, so it rewrote nothing for that form. It now parses the string and still answers with amodifiedArgsobject. Shipped in 1.5.0 through 1.9.0. sqz hook opencodekeeps the command's exit status. It piped the command straight into sqz, so a failing command reported success. Outside Windows it now uses the same trailer as the other hooks, as the OpenCode plugin already does. Shipped in 0.6.0 through 1.9.0.- Large non-ASCII output no longer crashes
sqz compress. The verifier cut its scan at byte 1,048,576, and when that byte fell inside a multibyte character sqz panicked and the command's whole output was lost. It now cuts on a character boundary. 1.9.0 had the same bug. git logandgit showno longer crash on a non-ASCIIcommitline. Their formatters cut the hash by bytes. 1.9.0 had the same bug.- Long runs of one character no longer stall or crash token counting. tiktoken-rs is quadratic on a long run of one character class and overflows its stack at about 1 MiB, so 256 KB of
=took about 14 s and 1 MiB crashed sqz on every path. Runs over 2,048 bytes are now counted in slices, which can be off by about 1% plus 4 tokens, and counts for other text are unchanged. 1.9.0 had the same problem. - A panic during compression no longer loses the output.
sqz compressprints its input unchanged, keeps the command's exit status and prints one line on stderr, andsqz hook claude-postleaves the result as it was. WithRUST_BACKTRACEset (and not0), the stderr line names the file, line and column of the panic. In 1.9.0 and earlier a panic lost the output. - Token pruning no longer rewrites whole lines. Once it removed one filler word anywhere, it rebuilt every prose-looking line with single spaces. That collapsed indentation in unlabeled diffs and markdown, turned CRLF into LF and dropped words from error lines. It now rewrites only lines that lose a word, keeps their spacing, and leaves diff lines, indented lines, lines starting with
-and error lines alone. 1.9.0 had the same bug. - Colored traces, DDL, PEM blocks and credential lines are protected like plain ones. The router read raw lines, so ANSI color codes hid them: a colored 40-frame backtrace kept 50 of 83 lines and was cached. Routing, never-store and protected-line checks now strip ANSI first. 1.9.0 had the same bug.
sqz statscounts what was printed. The stats line and the session database logged the compressed size from before the abbreviation legend and expand hint were added, so savings were overstated by a median of 19 tokens per affected command. 1.9.0 had the same bug.sqz compress --cmd -jworks. A label starting with-was parsed as a flag, so sqz exited 2 with no output. 1.9.0 had the same bug.- A panic in one request no longer stops sqz-mcp. A panic while handling a request ended the server, and in
sqz-mcp proxyit left a lock poisoned, so the next message ended the proxy too; the tokenizer overflowing its stack on a long run of one character was one way to get there. Each request is now caught:compressreturns its input unchanged, other tools answer with JSON-RPC error -32603, the proxy passes the upstream result on as it came, and the next request is served as usual. 1.9.0 had the same crash. - A line that is not UTF-8 no longer ends an MCP session. One invalid byte made sqz-mcp exit. In
sqz-mcp proxya bad line from the client ended the proxy without an answer, and one from the upstream lost that response and every later one. The server now answers such a line with -32700 and a null id and keeps reading; the proxy forwards it with the bad bytes replaced. 1.9.0 had the same bug. - sqz-mcp answers
ping. MCP expects an empty result; it returned -32601 method not found. 1.9.0 had the same bug. sqz-mcp proxystops an upstream that ignores end of input. After the client closed stdin, the proxy waited for the upstream to close its stdout, so an upstream that kept running kept the proxy running, and a later SIGTERM to the proxy left it orphaned. The proxy now closes the upstream's stdin, waits up to 2.5 seconds for it to exit, then kills it and waits up to another 2.5 seconds while it finishes passing on a result it had already read. A response the upstream had not sent by then is lost; MCP clients keep stdin open while they wait, so this mostly affects scripted one-shot use. A SIGTERM to the proxy itself still leaves such an upstream running. 1.9.0 had the same bug.- Deltas number lines from 1 and account for every line. The position of removed lines was 0-based, and the unchanged lines next to each change were neither shown nor counted. A delta now shows one unchanged line on each side of a change, and its skip counts add up to the whole file. This applies to every delta sqz-mcp returns:
sqz_read_file,sqz_list_dir,sqz_grep,compressand the proxy. The context lines make a delta longer, so a re-read with edits spread through the file now comes back in full. 1.9.0 had the same bug. - No reference where it costs more than the content. Empty and tiny results (13 tokens or fewer, such as an empty file or a search with no matches) came back as a 13-token
§ref:HASH§, and a rangedsqz_read_fileof an unchanged file could come back as a delta against the previous range. Both are now sent in full and still stored, soexpandandsqz_recallfind them. A ranged re-read of a file read in full is still a line-range reference. 1.9.0 had the same bug. - The
compresstool says how to get dropped segments back. When it dropped low-information segments from text it stores, nothing in the output said how to recover them. The output now ends with[full output: call expand with prefix "<16 hex>"], and the tool'ssqz:transformslist names the step. 1.9.0 gave no hint either. sqz-mcp proxy --no-cacheno longer offerssqz_expand. Nothing is stored with--no-cache, so every call to it failed. The tool is left out, and the instructions note no longer mentions§ref:HASH§. 1.9.0 had the same bug.sqz uninstallno longer deletes a.gemini/settings.jsonsqz didn't write. It removes only sqz's hook and deletes the file only when nothing else is left. 1.9.0 and earlier deleted the whole file.sqz initadds its Gemini CLI hook to an existing.gemini/settings.json. It skipped the file when it existed, and doctor's suggested fix then had nothing to do. A file with comments, or one that doesn't parse, is left alone, andsqz initandsqz doctorgive the entry to add by hand. 1.9.0 and earlier skipped the file silently.- User hooks that look like sqz's survive. sqz recognised its own Claude Code hooks by substring (
resume,hook precompact,hook claude), sosqz init,sqz doctor --fixandsqz uninstalldeleted user hooks such as/usr/local/bin/on-resume.shor~/bin/save-notes --hook precompact, and replaced ones that wrap sqz, such as/usr/bin/time /opt/sqz hook claude. An entry is now sqz's only when its command issqzorsqz.exe, bare or as a path, quoted or not, followed by exactly the arguments sqz writes. Since an unquoted path may contain spaces, a wrapper that runs sqz by a relative path, such as/usr/bin/time ./sqz hook claude, still counts as sqz's. 1.9.0 and earlier deleted and replaced them. sqz uninstallremoves theCLAUDE.mdguidance block and themcpServers.sqzentry in~/.claude.json. 1.9.0 and earlier left both.- An outdated
CLAUDE.mdguidance block is replaced. Once written, the block was never refreshed, so it still described the 1.9.0 rewrite and theSQZ_NO_DEDUP=1 git log | sqz compressplacement that never reached sqz.sqz doctornow reports an old block, andsqz initandsqz doctor --fixreplace it in place, keeping the binary path it names while that resolves and every byte outside the markers; a current block saved with CRLF line endings counts as current. 1.9.0 and earlier never refreshed it. - Removing the shell rc block keeps every other byte. Uninstall collapsed every run of blank lines in the whole file and dropped its final newline. It now removes exactly the sqz block and the blank line install added before it. 1.9.0 and earlier had the same bug.
- JSON configs sqz edits keep their final newline and file mode. 1.9.0 and earlier dropped the final newline, gave
opencode.jsonone it didn't have, and left Claude Code settings at 0600. Key order still changes. - Hook files older sqz versions wrote are cleaned up.
sqz doctorreports them, andsqz doctor --fixandsqz uninstallremove sqz's entries from.windsurf/hooks.json,.cline/hooks.jsonand Cursor'shooks.jsonand the old.clinerules/hooks/PreToolUsescript, deleting a file when nothing else is left in it. Uninstall ends by listing the files it keeps, such as the preset and shell completions. 1.9.0 and earlier left them all. - The uninstall plan lists only files that hold sqz entries, so a second
sqz uninstallsays there is nothing to uninstall; 1.9.0 and earlier listed every existing config file. The plan also names the user-level Kiro steering and~/.kiro/settings/mcp.json(when it hasmcpServers.sqz), which uninstall changed without listing them, and when they are the only sqz files left uninstall removes them instead of saying there is nothing to uninstall. cargo testno longer writes to your home directory. Several tests wrote the Copilot CLI hook, the Codex and Zed configs and the session database under the real home directory; they now use temporary directories. In 1.9.0,test_reinit_is_idempotent_at_project_scopealready wrote the Copilot CLI hook there whenever~/.copilotexisted, pointing it at/usr/bin/sqz.pipx install sqzfetches the right release. The PyPI wrapper downloaded the 0.1.0 binaries whatever its own version, asked for a.tar.gzon Windows, where releases ship a.zip, and used a type hint that fails on Python 3.8. It now takes its version from the installed package and the archive each release target ships. 1.9.0 and earlier had all three bugs.- The npm package declares its licence as
Elastic-2.0and shipsLICENSE.package.jsonsaidELv2, which is not an SPDX id, and the publish jobs did not copyLICENSEinto the package. 1.9.0 and earlier had both. sqz proxy, its help and its guide say what it does.sqz --helpcalled the command "[Coming soon]"; it now says the local endpoint compresses an OpenAI, Anthropic or Google AI request body and sends it back without forwarding it. When it started, the endpoint told you to setOPENAI_BASE_URLorANTHROPIC_BASE_URLto its address, which hands your client the compressed request instead of a model response; it now says what it does and shows acurlexample, and a body it cannot compress is reported as sent back rather than forwarded. The API proxy guide described forwarding, aproxy.tomlsqz never reads and two options that do not exist,--upstreamand--dry-run; it now describes the endpoint and its one option,--port. 1.9.0 and earlier had the same help text and, from 0.5.0, printed the base URL advice.
Full changelog: https://github.com/ojuschugh1/sqz/blob/main/CHANGELOG.md