output-compression
Installation
SKILL.md
CLI Output Compression for LLMs
Build, test, and git output can consume 20-40% of context in a typical session. Output compression tools intercept CLI commands and emit only the signal, reducing noise by 60-99%.
Two tools serve this purpose with different trade-offs:
| RTK | tokf | |
|---|---|---|
| Philosophy | Zero-config, batteries-included | Config-driven, per-project customization |
| Install | brew install rtk |
brew install mpecan/tokf/tokf |
| Setup | rtk init --global |
tokf hook install |
| Custom filters | Built-in only (30+ commands) | TOML per-project + Lua scripting (61+ built-in) |
| Per-repo config | No | .tokf/filters/ committed with repo |
| Multi-tool support | Claude Code, Cursor, Gemini, Codex, Copilot, etc. | Claude Code hook + CLI filter (tokf filter < input) |
| Best for | Global baseline across all repos | Surgical filtering when defaults aren't enough |
Use RTK as the global baseline. Add tokf when RTK's defaults don't handle a specific output pattern (e.g., test coverage tables overflowing Bash limits).