Usage

Once tetris is installed and wired into an assistant, there is nothing to start, nothing to keep open, nothing to remember. This page covers the small set of commands you actually use day to day.

1. The five commands you’ll use

CommandWhen
tetris doctorFirst thing if anything looks wrong. Inspects binary, license, heartbeat, every assistant’s hook wiring. One-pass diagnostic.
tetris statsLifetime + month-to-date savings, top strategies, per-assistant breakdown. Reads the local ledger; no network.
tetris dashboardSame data, but live in your browser at http://localhost:8787. Updates in real time as your assistant fires tool calls.
tetris loginOne-time after install (the onboarding wizard runs this for you). Re-run if your license expires or after 72h offline.
tetris install <assistant>Add a hook to a new assistant. Idempotent — safe to re-run after the assistant updates and clobbers its config.

2. What happens when your assistant calls a tool

  1. Your assistant (Claude Code, Codex, Gemini, …) is about to send a tool call to the model.
  2. The pre-tool hook fires, piping the tool call (JSON) into tetris compress.
  3. Tetris extracts the large prose / file-body fields, runs them through the compression pipeline (eight stages, picks what helps), reassembles the JSON, and prints the compressed version on stdout.
  4. The assistant sends the compressed version to the model. The model sees less context. You pay for fewer tokens.
  5. Tetris records the savings to the ledger at ~/.tetris/ledger.jsonl.

Total wall-clock overhead: tens of milliseconds for typical inputs. Large file pastes (10 KB+) might add up to ~150 ms; everything else is dominated by the network round-trip you were already paying.

3. Verify compression is firing

The simplest test — ask your assistant to read a long file. Then:

tetris stats --json

You should see "compressions": N increase by 1 after each tool call. If "available": false persists after invoking a tool, the hook isn’t firing — see troubleshooting.

4. Read your stats

tetris stats

Default human view. Three sections:

For machine-readable output: tetris stats --json.

5. Live dashboard

tetris dashboard

Spawns a local web server at http://localhost:8787 that streams live ledger updates. Useful for watching a long agent run in real time. Ctrl+C to stop. Nothing leaves your machine; the server binds to 127.0.0.1 only.

6. Update tetris

curl -fsSL https://get.tetris.codes | sh

The same one-liner that installed tetris also updates it. The installer downloads the latest release, verifies the SHA-256 against releases.tetris.codes/latest.json, replaces the binary, and re-runs the hook installer for every assistant whose config it can find. Safe to re-run on the same machine repeatedly.

To pin a specific version (avoid auto-updating in CI): TETRIS_VERSION=v0.0.27 curl -fsSL https://get.tetris.codes | sh.

7. Add a new assistant after the fact

You installed Codex last month, then added Cursor. Wire it in:

tetris install cursor

Or wire every assistant on the machine in one pass:

tetris install

This is also the right command after an assistant updates and silently rewrites its config — if tetris doctor shows a yellow line for an assistant that used to be green, run the install command for that assistant to re-add the hook.

8. Manage the license

tetris license

Shows plan, device count, monthly cap, renewal date, status. To switch accounts:

tetris logout
tetris login

To list devices currently consuming a slot under your license (Pro / Team / Enterprise):

tetris devices

9. Where things live on disk

PathWhat
~/.local/bin/tetrisThe binary (Unix). Windows: %LOCALAPPDATA%\tetris\tetris.exe.
~/.tetris/ledger.jsonlAppend-only session log. One JSON line per compression. tetris stats reads this.
~/.tetris/licenseYour signed JWT. Contains plan, device limit, expiry. Generated by tetris login.
~/.tetris/heartbeatTimestamp of the last successful contact with our license server. Used by the 72h offline grace gate.
~/.tetris/last_heartbeat.txtThe 6h rate limiter for outbound heartbeats. Distinct file from the grace timestamp; same stamp is written to both on success.
~/.tetris/install_idA pseudonymous UUID we use to count distinct devices for the community stats and your license’s device cap. Never tied to your email.
~/.tetris/backups/<assistant>/Timestamped backups of each assistant’s settings file before the hook was added. Used by tetris uninstall to restore.

To use a different data directory entirely (CI runners, isolated profiles), set TETRIS_DATA_DIR before running anything.

10. Patterns that catch people out

11. Going deeper