Squeeze out
the noise.

tokf intercepts command output, runs it through a TOML filter, and hands your LLM only what matters. What goes in noisy comes out tight.

brew install mpecan/tokf/tokf
$ cargo test
command output
1.7 KB
filtered output
35 B · 98% smaller

Set it up once. It handles the rest.

Git hooks, make targets, CI commands — tokf intercepts output at the source so your LLM only sees what matters.

Automatic git hooks

Install once, forget forever. tokf sets up git hooks so every commit, push, and pull runs through your filters automatically — no manual wrapping.

Task runner substitution

tokf transparently wraps make, just, and mise targets. Your task files stay clean while every target's output is filtered before it reaches the model.

TOML filter files

Plain TOML tells tokf what to keep, skip, or replace. Drop a file in `.tokf/filters/` and it activates instantly — version-controlled and reviewable.

AI agent support

Use `tokf skill install` to let AI agents (Claude Code) author and install filters for you. Includes a `PreToolUse` hook for real-time filtering.

Lua escape hatch

Need conditional logic TOML can't express? Embed sandboxed Luau scripts for numeric math, multi-line lookahead, and complex branching.

20+ built-in filters

Ships with filters for git, cargo, docker, npm, pnpm, go, GitHub CLI, kubectl, Next.js, TypeScript, pytest, and more — ready out of the box.


100% local by default. Cloud only if you say so.

tokf runs entirely on your machine. Nothing leaves. No telemetry, no phone-home, no account required.

Default

Fully local

  • All filtering happens on your machine
  • Token stats stored in local SQLite
  • No network requests, ever
  • No account or API key needed
  • Works offline, air-gapped, anywhere
Explicit opt-in

Optional cloud sync

  • Share filter stats across your team
  • Sync custom filters between machines
  • Completely blocked until you explicitly run tokf auth login
  • No data is collected or sent without your explicit action
  • Log out anytime with tokf auth logout
The cloud component is completely inert until you log in. No background syncing, no silent opt-ins, no surprises.

Filters for the tools you already use

61 command patterns ship with tokf. Override any of them locally, or add your own in plain TOML.

Cargo / Rust cargo/*
  • $ cargo build
  • $ cargo check
  • $ cargo clippy
  • $ cargo fmt
  • $ cargo install *
  • $ cargo nextest
  • $ cargo test
Docker docker/*
  • $ docker build
  • $ docker buildx build
  • $ docker compose
  • $ docker images
  • $ docker ps
  • $ docker-compose
Eslint eslint/*
  • $ eslint
Firebase firebase/*
  • $ firebase deploy
  • $ npx firebase deploy
General *
  • $ ls
  • $ npx playwright test
  • $ npx vue-tsc
  • $ playwright test
  • $ pytest
  • $ tsc
  • $ vue-tsc
Git git/*
  • $ git add
  • $ git commit
  • $ git diff
  • $ git log
  • $ git push
  • $ git show
  • $ git status
GitHub CLI gh/*
  • $ gh issue list
  • $ gh issue view *
  • $ gh pr checks *
  • $ gh pr list
  • $ gh pr view *
Go go/*
  • $ go build
  • $ go test
  • $ go vet
Gradle gradle/*
  • $ ./gradlew build
  • $ ./gradlew dependencies
  • $ ./gradlew test
  • $ gradle build
  • $ gradle dependencies
  • $ gradle test
Kubernetes kubectl/*
  • $ kubectl get po
  • $ kubectl get pod
  • $ kubectl get pods
Next.js next/*
  • $ next build
npm npm/*
  • $ jest
  • $ npm run *
  • $ npm test
  • $ pnpm test
  • $ vitest
  • $ yarn test
pnpm pnpm/*
  • $ pnpm add *
  • $ pnpm install
Prettier prettier/*
  • $ prettier --check
Prisma prisma/*
  • $ prisma generate
Ruff ruff/*
  • $ ruff check
  • $ ruff format
Vite vite/*
  • $ vite build

Need a filter that doesn't exist yet?


Big input. Tiny output.

Three steps. Every time. Like a zip file for terminal noise.

1

Run with tokf

Prefix any command with tokf run. tokf spawns the process, captures stdout and stderr.

tokf run cargo test
2

Filter is matched

tokf looks up a TOML filter for cargo test from your local, user, or built-in library. First match wins.

tokf which "cargo test"
→ built-in: cargo/test.toml
3

Clean output emitted

The filter pipeline runs: skip/keep, replace, dedup, on_success/on_failure. Only the signal reaches your model.

tests 12 passed, 0 failed

Start using tokf today

One command. Instant results. Your LLM context will thank you.

brew install mpecan/tokf/tokf