szr is a Go-native CLI proxy that reduces noisy terminal output before it reaches an LLM context.
It keeps the useful signal, preserves the wrapped command's exit code, and helps you spend fewer tokens on logs, diffs, and test output.
- wraps the commands you already run
- rewrites supported tools into more compact machine-friendly output when possible
- summarizes noisy output without hiding the important anchors
- records local history so you can inspect token savings over time
Install the CLI with Go:
go install github.com/devr-tools/szr/cmd/szr@latest
szr self doctorOr build from a local checkout:
make build
./bin/szr self install
szr self doctorHomebrew install via tap:
brew install devr-tools/tap/szr
szr self doctorRun your normal commands through szr:
szr git status
szr git diff
szr go test ./...AI bootstrap targets:
| Tool | Install command | Uninstall command | Description |
|---|---|---|---|
| Codex | szr install codex |
szr uninstall codex |
Writes ~/.codex/szr.md (or $CODEX_HOME/szr.md) and patches the repo AGENTS.md to reference it. |
| Claude Code | szr install claude-code |
szr uninstall claude-code |
Installs ~/.claude/szr.md, a Claude hook script, and a settings.json hook registration. |
| Cursor | szr install cursor |
szr uninstall cursor |
Installs ~/.cursor/hooks.json plus a preToolUse hook script under ~/.cursor/hooks/. |
| Gemini | szr install gemini |
szr uninstall gemini |
Installs ~/.gemini/settings.json BeforeTool registration plus a hook script under ~/.gemini/hooks/. |
- stronger command recommendations based on real usage history and low-savings hotspots
- better repository-aware noise filtering for generated files, vendor trees, and build output
- more stable agent-facing output for long-running automated workflows
- broader reducer coverage and better fallback handling for noisy real-world commands
| Command | Description |
|---|---|
szr git status |
Run common Git commands through szr with reduced output. |
szr go test ./... |
Compress noisy test output while preserving failures and anchors. |
szr spread |
Show token savings, usage patterns, and hotspot summaries. |
szr spread --history |
Inspect savings history across recent commands. |
szr doctor [--json] |
Check runtime diagnostics and local history health. |
szr self doctor [--json] |
Check install state, PATH, config, cache, and version details. |
szr tee --latest |
Inspect the latest preserved full-output artifact. |
szr explain go test ./... |
Show the matched profile, budget, and rewrite decisions for a command. |
szr commands |
Show the full command catalog for power users and agents. |
szr profiles |
List built-in reducer profiles. |
- Interactive shells:
szrcan print update notices onstderrwhen update checks are enabled. - Agent or non-interactive tool runs: inline update notices are suppressed to keep tool output stable.
- Hosts can poll
szr doctor --jsonorszr self doctor --jsonand render their own user-facing notification with the returnedupdateobject. - Opt-in auto update is available for recognized Homebrew or
go installinstalls:
{
"update_check": {
"enabled": true,
"interval_hours": 24,
"auto_update": true
}
}