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
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 --globaland tracks cumulative savings withtokf gain.Validate Claims
Install tokf (e.g.
brew install mpecan/tokf/tokforcargo install tokf), runtokf hook install --globalto register the Claude Code hook, then start a Claude Code session in any Rust project. Ask Claude to runcargo 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 testvscargo 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 testin the current directory and show me the results."After the run, check
tokf gainto 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 atokf verifytest runner for filter suites, and produces token savings telemetry viatokf gain --by-filter. Homepage: https://tokf.netRecommendation Checklist