zdk/lowfat
lowfat - slim your command output. strips noise, saves tokens.
What it solves
lowfat is designed to reduce AI token costs and context window usage by filtering out noise from CLI output and file contents before they are sent to an AI agent. It prevents agents from being overwhelmed by verbose logs, redundant git status messages, or massive lock files, ensuring the agent receives only the essential signal.
How it works
It operates as a lightweight CLI tool that can be integrated into an agent's environment via shell hooks, plugins, or direct command prefixing. It uses a pipeline of filters to process output from common commands (like git, docker, ls, and find) and can compress file contents during read operations.
Filtering levels are adjustable via the LOWFAT_LEVEL environment variable (lite, full, ultra), allowing users to choose the balance between data loss and token savings.
Who it’s for
Developers using AI agents (such as Claude Code, OpenCode, or Pi) who want to lower their API costs and improve agent performance by optimizing the context provided to the LLM.
Highlights
- Token Reduction: Significantly reduces output size for common commands like
git diffandgit log(up to 90%+ in some cases). - File Compression: The
post-readhook strips comments, normalizes blanks, and summarizes lock files or collapses function bodies in source code. - Extensible: Supports custom filters via a dedicated
.lfDSL, shell scripts, or Python (PEP 723/uv). - Local-first: No telemetry and operates entirely locally to ensure data privacy.
- Integration: Ready-made hooks for Claude Code, OpenCode, and Pi agent environments.