git diff HEAD~5
via git-filter · python
68,821 B
→
929 B
−98.6%
a utility · ancient greek · mit license
θ θλίβω — to press, crush, compress.
thlibo sits between Claude Code / Codex and the shell.
It rewrites git diff, npm install, cargo test
and other verbose commands so the model sees the summary, not the
noise. Deterministic Python filters handle the usual suspects; a
local Gemma 4 model compresses everything else. Nothing leaves
your machine.
$curl -fsSL https://raw.githubusercontent.com/3rg0n/thlibo/main/scripts/install.sh | bash
PS>irm https://raw.githubusercontent.com/3rg0n/thlibo/main/scripts/install.ps1 | iex
go test ./internal/middleware/... -run TokenSavings.
Raw bytes measured before the thlibo exec wrapper touches them; compressed bytes after the Python filter returns.
thlibo installs a Claude Code PreToolUse hook.
Before the Bash tool runs, the hook asks thlibo rewrite
whether to wrap the command. If yes, it swaps
git status for thlibo exec -- git status.
Codex uses the symmetric PostToolUse path — decision:block
with the compressed result as the reason. Same engine underneath.
git-filter, npm-filter, cargo-filter.
Short Python scripts with tight regex rules. They collapse
diff hunks, strip dep-tree chatter, keep the failing tests.
Nothing a model could do better, faster, or more reliably.
Add your own in ~/.thlibo/processors/<name>/ — a
processor.yaml descriptor and a script. It picks
up on next invocation.
When no deterministic filter matches, thlibo asks a local Gemma 4 E4B — quantised, ~5 GB on disk, CPU-runnable via llamafile — which processor (if any) to route to. Prompt processors summarise stack traces, error logs, and arbitrary output.
One warm model per daemon. Single-instance lock. Unix socket or named pipe, ACL'd to your user.
If any step fails — daemon down, model missing, script crashes — the original bytes pass through unchanged. The model sees what it would have seen without thlibo. The compressor never breaks the client.
thlibo runs as your user. The daemon binds a Unix domain socket (or Windows named pipe) with an ACL that grants only your SID access. Nothing listens on the network.
No telemetry. No opt-in-to-ship-anonymised-usage-data. No HuggingFace token required — the model pull is a plain anonymous HTTPS GET against a public Apache-licensed repack, SHA-256 pinned at build time.
If your repo has a clause against uploading source, thlibo does not violate it. If your model is air-gapped, it works offline.
# IPC endpoints, by platform linux /run/thlibo/infer.sock darwin /var/run/thlibo/infer.sock windows \\.\pipe\thlibo-infer # permissions infer 0660 group thlibo-users admin 0600 owner only # single-instance lock /run/thlibo/thlibod.lock # model, on disk ~/.thlibo/models/gemma-4-e4b-ud-q4-k-xl.gguf 5,126,304,928 bytes · sha256 pinned