tokf - LLM Context Compressor
Overview
tokf is a config-driven CLI tool that compresses command output before it reaches an LLM context. Reduces token usage for AI tools.
Quick Start
Run command with filtering
sc tokf run command <command>
Passthrough to tokf CLI
sc tokf _ <tokf-args>
Key Features
- Context Compression: Reduce LLM token usage
- Config-Driven: TOML configuration
- Filter Library: Built-in filter library
- Task Runner Integration: Works with make, just
- Error Extraction: Extract errors from output
- Test Failure Extraction: Extract test failures
Installation
cargo install tokf
Also available via:
- Homebrew
- Build from source
Usage Examples
Run command with filtering
tokf make test
Apply filter to fixture
tokf --filter error-filter fixture.txt
Verify filter test suites
tokf test
Explore available filters
tokf discover
Notes
- Run
tokf --helpto see all available options