Search AI Tools

Agent skill

tokf-discover

Find missed token savings in Claude Code sessions and create filters for unfiltered commands

Stars 147
Forks 14

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:

bash
tokf discover

Options

  • --all — scan all projects, not just the current one
  • --since 7d — only scan sessions from the last 7 days (also 24h, 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

  1. Run tokf discover to identify top savings opportunities
  2. For commands with existing filters: run tokf hook install to set up automatic filtering
  3. For commands without filters: use /tokf-filter skill to create a custom filter
  4. Re-run tokf discover after changes to verify improvement

Creating Filters for Unfiltered Commands

If tokf discover shows commands with no matching filter, create one:

bash
# 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:

bash
tokf discover --json | jq '.results[] | select(.estimated_savings > 1000)'

The JSON schema includes:

  • sessions_scanned — number of JSONL files processed
  • total_commands — all Bash commands found
  • already_filtered — commands already using tokf
  • filterable_commands — commands with available filters
  • no_filter_commands — commands with no matching filter
  • estimated_total_savings — total estimated token savings
  • results[] — per-command breakdown sorted by savings

Expand your agent's capabilities with these related and highly-rated skills.

davila7/claude-code-templates

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.

23,776 2,298
Explore
davila7/claude-code-templates

plotly

Interactive scientific and statistical data visualization library for Python. Use when creating charts, plots, or visualizations including scatter plots, line charts, bar charts, heatmaps, 3D plots, geographic maps, statistical distributions, financial charts, and dashboards. Supports both quick visualizations (Plotly Express) and fine-grained customization (graph objects). Outputs interactive HTML or static images (PNG, PDF, SVG).

23,776 2,298
Explore
sickn33/antigravity-awesome-skills

sales-enablement

Create sales collateral such as decks, one-pagers, objection docs, demo scripts, playbooks, and proposal templates. Use when a sales team needs assets that help reps move deals forward and close.

28,421 4,766
Explore
sickn33/antigravity-awesome-skills

jq

Expert jq usage for JSON querying, filtering, transformation, and pipeline integration. Practical patterns for real shell workflows.

28,421 4,766
Explore
sickn33/antigravity-awesome-skills

design-spells

28,421 4,766
Explore
sickn33/antigravity-awesome-skills

ai-analyzer

AI驱动的综合健康分析系统,整合多维度健康数据、识别异常模式、预测健康风险、提供个性化建议。支持智能问答和AI健康报告生成。

28,421 4,766
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results