# lowfat (CLI)
lowfat is an open-source CLI tool written in [[Rust]] that strips noise from shell command output before it reaches an [[How Coding Agents Work|AI coding agent]], cutting the [[AI Tokenization|tokens]] spent on verbose tool output. Same category as [[RTK]]: it reshapes the *inputs* an agent reads instead of touching the prompt or the model.
> Slim your command output. Strips noise, saves tokens.
The premise is the same insight [[RTK]] is built on; most tokens burned in an AI coding session come from boilerplate command output, not reasoning. A `git log`, `git status`, or `docker ps` floods the [[Context Window]] with formatting and redundancy the model never needs. lowfat filters that at the source.
## How it works
A small single binary with a UNIX-style, composable pipeline architecture; built-in filters chain together like pipes, and you can drop your own in. Three compression levels let you dial how aggressive it gets:
- `lite` ; light trimming
- `full` ; default
- `ultra` ; maximum reduction
It's **local-first** with no telemetry ; data stays on your machine.
## Reported savings
Reduction depends on the command and level:
- `git log`: 53–91%
- `git status`: 62–74%
- `docker ps`: 38–85%
- `ls -la`: 2–87%
As with [[RTK]], the payoff scales with how verbose the underlying tool is ; near-useless on already-short output, large on noisy commands inside long agent loops.
## Extensibility
Custom filters can be written three ways:
- a dedicated `.lf` DSL
- plain shell scripts
- [[Python]] (PEP 723 / `uv` inline-dependency scripts)
## Integrations
Hooks into [[Claude Code]] via `.claude/settings.json` (transparent output filtering before the agent sees anything), plus [[OpenCode]], generic shell environments, and the Pi agent.
## Observability
- `lowfat history` ; frequently-run commands and their potential token savings
- `lowfat level <lite|full|ultra>` ; set the active compression level
## Install
```bash
cargo install lowfat
brew install zdk/tools/lowfat
```
Pre-built binaries are also published via GitHub Releases. Apache-2.0 licensed.
## lowfat vs rtk
Both are Rust CLIs that compress command output before it hits an agent's context, both hook into [[Claude Code]] transparently, and both report similar savings on verbose commands. Differences in emphasis:
- **lowfat** leans on a composable UNIX-pipe model and an explicit plugin story (`.lf` DSL, shell, [[Python]]), with three named levels
- **[[RTK]]** ships per-command optimization logic and richer adoption observability (`rtk gain`, `rtk discover`, `rtk session`) across 13+ clients and 100+ commands
They occupy the same niche; the choice comes down to whether you prefer lowfat's composable-filter philosophy or rtk's broader out-of-the-box command coverage.
## References
- GitHub: https://github.com/zdk/lowfat
## Related
- [[RTK]]
- [[Claude Code]]
- [[Claude Code Hooks]]
- [[Context Window]]
- [[AI Tokenization]]
- [[How Coding Agents Work]]
- [[OpenCode]]
- [[Rust]]
- [[Python]]