Patterns
Squeezr ships with 30+ built-in patterns that recognize common tool outputs and apply domain-specific compression. Each pattern knows what information is critical (errors, changed lines, actionable data) and what can be safely removed (boilerplate, verbose formatting, repetition).
Git patterns
git diff
Compresses diff output by keeping only changed lines (+/-) with minimal context. File headers and unchanged context lines are trimmed. Binary file diffs are replaced with a one-line summary.
# Before: 200 lines of diff with full context
# After: 45 lines with just changes and 1 line of contextgit log
Collapses verbose log output into a compact format: hash (short), author, date, and first line of message. Full commit bodies and signatures are removed.
git status
Groups files by status (modified, added, deleted, untracked) and removes verbose help text. The branch/tracking info line is preserved.
git blame
Deduplicates repeated author/date prefixes and collapses contiguous blocks by the same author.
Test runner patterns
Vitest / Jest
Replaces full test output with a pass/fail summary. Only failed tests are preserved in full with their error messages and stack traces. Pass counts, durations, and suite names are kept as a summary line.
Pytest
Compresses pytest output similarly: the summary line (X passed, Y failed) is kept, and only failure details are preserved. Verbose collection output and fixture setup are removed.
Cargo test (Rust)
Handles Rust test output format. Passing tests are collapsed; failing tests with their panic messages and backtraces are preserved.
Go test
Compresses go test output. PASS lines are collapsed; FAIL lines with their output are preserved. Build errors are always kept in full.
Playwright
E2E test output is compressed by keeping the test name and result (pass/fail). For failures, the error message, expected/received values, and screenshot paths are preserved.
Build tool patterns
TypeScript (tsc)
Compresses TypeScript compiler output. Error messages with file/line references are preserved. "Found N errors" summary is kept. Verbose declaration output is removed.
ESLint
Groups ESLint output by rule. Error-level issues are preserved in full. Warning-level issues are collapsed into a count per rule. The summary line with totals is kept.
Next.js build
Compresses Next.js build output by removing the route manifest table (replaced with a count), keeping error/warning messages, and preserving the build timing summary.
Infrastructure patterns
Docker
Compresses docker build, docker compose, and docker ps output. Build step progress and layer caching messages are collapsed. Error output is preserved.
Kubernetes (kubectl)
Compresses kubectl get, kubectl describe, and kubectl logs output. Pod lists are collapsed; only non-Running pods are shown in full. Describe output keeps events and conditions.
Terraform
Compresses terraform plan and terraform apply output. The resource change summary is kept. Individual resource details are collapsed unless they contain errors.
Package manager patterns
npm, yarn, pnpm, pip, cargo, and go module output is compressed by collapsing the dependency tree and keeping only version conflicts, security warnings, and error messages.
HTTP patterns
curl / wget
HTTP response output is compressed by keeping the status code, key headers (content-type, content-length), and truncating large response bodies. JSON responses are pretty-printed then truncated with a size indicator.
GitHub CLI (gh)
Output from gh pr, gh issue, and gh api is compressed by keeping structured data (title, status, author) and removing verbose formatting and help text.
Stack trace deduplication
When tool output contains stack traces (JavaScript, Python, Java, Rust, Go), Squeezr deduplicates common framework frames, keeping only:
- The error message and type
- Frames in user code (non-node_modules, non-stdlib)
- The first and last framework frames for context
File read patterns
Large file reads are compressed using a combination of strategies:
- Cross-turn dedup — Files read before are replaced with a reference.
- Line number stripping — Cat-style line number prefixes are removed (the model can infer line numbers from context).
- Blank line collapsing — Multiple consecutive blank lines are collapsed to one.
- Comment density — In high-comment files, doc comments are trimmed to their first line.
Pattern summary table
| Category | Patterns | Typical savings |
|---|---|---|
| Git | diff, log, status, blame | 40–70% |
| Test runners | vitest, jest, pytest, cargo, go, playwright | 50–85% |
| Build tools | tsc, eslint, next build, webpack | 40–70% |
| Infrastructure | docker, kubectl, terraform | 50–75% |
| Package managers | npm, yarn, pnpm, pip, cargo, go mod | 60–80% |
| HTTP | curl, wget, gh cli | 40–70% |
| Stack traces | JS, Python, Java, Rust, Go | 50–70% |
| File reads | Cross-turn dedup, comment trim | 30–90% |