tokf-filter
FeaturedThis skill should be used when the user asks to "create a filter", "write a tokf filter", "add a filter for <tool>", "how do I filter output", or needs guidance on tokf filter step types, templates, pipes, or placement conventions.
AI & Automation 192 stars
19 forks Updated yesterday MIT
Install
Quality Score: 91/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# tokf Filter Authoring
You are an expert at writing tokf filter files. tokf is a config-driven CLI that compresses command output before it reaches an LLM context. Filters are TOML files that define how to process a command's output.
When the user asks you to create or modify a filter, follow this guide exactly. Produce valid, idiomatic TOML that matches the schema described below.
---
## Section 1 — What a Filter File Is
A filter file is a TOML file that describes:
- Which command(s) it applies to (`command`)
- How to transform the raw output (steps, applied in a fixed order)
- What to emit on success vs. failure
Filters live in three places, searched in priority order:
1. `.tokf/filters/` — project-local (repo-level overrides)
2. `~/.config/tokf/filters/` — user-level overrides
3. Built-in library (embedded in the tokf binary)
First match wins. Use `tokf which "cargo test"` to see which filter would activate for a given command.
---
## Section 2 — Processing Order
Steps execute in this fixed order — **do not rearrange them**:
1. **`match_output`** — whole-output substring checks; if matched, short-circuits the entire pipeline and emits immediately
2. **`[[replace]]`** — per-line regex transforms applied to every line, in array order
3. **`strip_ansi` / `trim_lines`** — per-line cleanup (ANSI stripping, whitespace trimming)
4. **`skip` / `keep`** — line-level filtering (drop or retain lines by regex)
5. **`dedup` / `dedup_window`** — collapse duplicate consecuti...
Details
- Author
- mpecan
- Repository
- mpecan/tokf
- Created
- 5 months ago
- Last Updated
- yesterday
- Language
- Rust
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
tokf-run
Compress verbose CLI output with tokf before returning results. Activates for git, cargo, npm, docker, go, gradle, kubectl, and other supported commands.
192 Updated yesterday
mpecan AI & Automation Solid
tokf-discover
Find missed token savings by scanning AI coding session files for commands that ran without tokf filtering.
192 Updated yesterday
mpecan AI & Automation Listed
tool-fzf
Use fzf for interactive fuzzy selection from files, branches, and command output. Trigger when a human-in-the-loop selection step is needed inside terminal workflows.
1 Updated today
niksavis