Skip to content

[Resource]: tokf #807

@mpecan

Description

@mpecan

Display Name

tokf

Category

Tooling

Sub-Category

General

Primary Link

https://github.com/mpecan/tokf

Author Name

mpecan

Author Link

https://github.com/mpecan

License

MIT

Other License

No response

Description

Config-driven CLI that intercepts command output before it reaches Claude Code's context window and compresses it via TOML-defined filters. Ships with 20+ built-in filters for git, cargo, docker, npm, go, kubectl, pytest, tsc, and more — typically reducing output by 60–90%. Installs as a PreToolUse hook with tokf hook install --global and tracks cumulative savings with tokf gain.

Validate Claims

Install tokf (e.g. brew install mpecan/tokf/tokf or cargo install tokf), run tokf hook install --global to register the Claude Code hook, then start a Claude Code session in any Rust project. Ask Claude to run cargo test. Without tokf, Claude receives 50–80 lines of compiler progress and test output. With tokf, it receives a single summary line like ✓ 47 passed (2.31s).

To see the raw difference without the hook: tokf run cargo test vs cargo test.

Specific Task(s)

Ask Claude to run a standard build/test command in a project (cargo test, git push, npm install, docker build) and observe that the output Claude receives is a short summary rather than the full verbose output.

Specific Prompt(s)

"Run cargo test in the current directory and show me the results."

After the run, check tokf gain to see cumulative byte savings.

Additional Comments

tokf ships a Claude Code skill (.claude/skills/tokf-filter/) that teaches Claude to write new TOML filters in natural language. It also supports Luau scripting for complex filter logic, has a tokf verify test runner for filter suites, and produces token savings telemetry via tokf gain --by-filter. Homepage: https://tokf.net

Recommendation Checklist

  • I have checked that this resource hasn't already been submitted
  • My resource provides genuine value to Claude Code users, and any risks are clearly stated
  • All provided links are working and publicly accessible
  • I am submitting only ONE resource in this issue
  • I understand that low-quality or duplicate submissions may be rejected

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-templateIssue is a resource recommendation that did not use the issue template

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions