About Tokf
tokf is an open source, config driven command line tool that compresses command output before it reaches an LLM's context. It intercepts the output of commands such as git, make, cargo and docker, runs it through a TOML filter, and passes along only what matters. The site shows an example where 1.7 KB of test output becomes a 35 byte result. The tool is written in Rust and installs through Homebrew or Cargo.
Filters are plain TOML files that say what to keep, skip or replace. A file placed in the .tokf/filters directory activates immediately and can be version controlled and reviewed. For logic that TOML cannot express, users can embed sandboxed Luau scripts. The tool ships with more than 20 built in filters and 63 command patterns covering git, cargo, docker, npm, pnpm, go, the GitHub CLI, kubectl, Next.js, TypeScript, pytest and more, all of which can be overridden locally.
Integration is automatic where possible. It installs git hooks so commits, pushes and pulls run through filters, and wraps make, just and mise targets transparently. A tokf skill install command lets agents such as Claude Code author and install filters, and a PreToolUse hook enables real time filtering.
It is fully local by default, with no telemetry, no account and no network requests. Optional cloud sync of filters and token stats stays inert until the user runs tokf auth login. The software is free and open source.