tokf-filter

Create TOML filter files for the tokf CLI tool.

192|19|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/mpecan/tokf --skill tokf-filter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tokf-filter
Source: https://github.com/mpecan/tokf/tree/main/crates/tokf-cli/skills/tokf-filter
Command: npx skills add https://github.com/mpecan/tokf --skill tokf-filter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users create and understand tokf filter files, which are essential for compressing command-line output to reduce LLM token consumption.

Core Features & Use Cases

  • Filter Creation: Generates TOML filter files based on user requirements for specific commands.
  • Step Explanation: Clarifies the purpose and usage of various tokf filter steps (e.g., skip, [[replace]], [[section]], [json]).
  • Use Case: A user needs to filter the verbose output of cargo test. They can ask this Skill to create a tokf filter that only shows the final test summary, significantly reducing token usage for their AI agent.

Quick Start

Use the tokf-filter skill to create a filter for the 'git status' command.

Frequently Asked Questions about tokf-filter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress command-line output to reduce LLM token consumption?

TOML filter files define transformation rules for the tokf CLI tool to compress command-line output. They use step types like skip, replace, and section to extract only the relevant output, significantly reducing token consumption for AI agents.

How do I create a TOML filter for a specific command like cargo test or git status?

To create a TOML filter, define your command and use step types like [[section]] and [[replace]] to isolate specific output segments. This allows you to extract only the final summary from commands like cargo test or git status for LLM context.

What do the different tokf filter steps like skip, replace, and section do?

Filter steps like skip, replace, and section define specific transformation actions for command-line output. Skip omits lines, replace modifies text patterns, and section extracts specific blocks, allowing precise control over what enters the LLM context window.

Can I use a TOML filter to parse and compress JSON output from a CLI command?

Yes, TOML filters support a [json] step type to parse and transform command-line JSON output. This allows you to extract specific fields or restructure the data before passing it as context to an LLM, reducing token waste.

What is the best way to explain complex filter logic for command-line output compression?

The best way to explain complex filter logic is to clarify the purpose of each TOML step type and how they interact to transform output. Understanding this structure helps ensure your filter accurately captures the necessary command-line data for LLM context.

When should I use output compression filters for LLM context?

You should use output compression filters when a command generates verbose output that exceeds LLM token limits or adds unnecessary cost. Filters isolate essential information like test summaries, ensuring efficient and focused context delivery to the AI agent.