Agent skill
tokf-discover
Find missed token savings in Claude Code sessions and create filters for unfiltered commands
Install this agent skill to your Project
npx add-skill https://github.com/mpecan/tokf/tree/main/crates/tokf-cli/skills/tokf-discover
SKILL.md
tokf discover — Find Missed Token Savings
Use this skill to analyze Claude Code sessions and find commands that are running without tokf filtering, wasting tokens on verbose output.
Quick Start
Run tokf discover in the project directory to scan recent sessions:
tokf discover
Options
--all— scan all projects, not just the current one--since 7d— only scan sessions from the last 7 days (also24h,30m)--limit 0— show all results (default: top 20)--json— output as JSON for programmatic use--session <path>— scan a specific session file--project <path>— scan sessions for a specific project path
Interpreting Results
The output shows:
- COMMAND — the shell command pattern being run without filtering
- FILTER — the tokf filter that would handle it
- RUNS — how many times it appeared in sessions
- TOKENS — estimated token count of unfiltered output
- SAVINGS — estimated tokens that filtering would save
Workflow
- Run
tokf discoverto identify top savings opportunities - For commands with existing filters: run
tokf hook installto set up automatic filtering - For commands without filters: use
/tokf-filterskill to create a custom filter - Re-run
tokf discoverafter changes to verify improvement
Creating Filters for Unfiltered Commands
If tokf discover shows commands with no matching filter, create one:
# See what a filter would look like
tokf which "the-command --args"
# Use the tokf-filter skill to create a proper filter
# /tokf-filter
JSON Output
Use --json for integration with other tools:
tokf discover --json | jq '.results[] | select(.estimated_savings > 1000)'
The JSON schema includes:
sessions_scanned— number of JSONL files processedtotal_commands— all Bash commands foundalready_filtered— commands already using tokffilterable_commands— commands with available filtersno_filter_commands— commands with no matching filterestimated_total_savings— total estimated token savingsresults[]— per-command breakdown sorted by savings
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
tokf-filter
This 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.
tokf-discover
Find missed token savings by scanning AI coding session files for commands that ran without tokf filtering.
tokf-run
Compress verbose CLI output with tokf before returning results. Activates for git, cargo, npm, docker, go, gradle, kubectl, and other supported commands.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
gguf-quantization
GGUF format and llama.cpp quantization for efficient CPU/GPU inference. Use when deploying models on consumer hardware, Apple Silicon, or when needing flexible quantization from 2-8 bit without GPU requirements.
Didn't find tool you were looking for?