rtk v0.37.2, macOS (Apple Silicon, homebrew)
Custom TOML filters — defined in the global filters.toml or a rtk trust'd project-local .rtk/filters.toml — parse and pass rtk verify, but are never applied by the Claude Code hook. Only compiled-in/bundled filters get rewritten.
Repro
Add a custom filter (global or trusted project-local):
[filters.zzprobe]
description = "probe"
match_command = '^zzprobe\b'
max_lines = 5
$ rtk trust # registers .rtk/filters.toml (confirmed in `rtk trust --list`)
$ rtk verify --filter zzprobe # found, parses (No inline tests)
$ rtk rewrite 'zzprobe --foo' # -> EMPTY (no rewrite)
$ rtk rewrite 'liquibase update' # -> "rtk liquibase update" (bundled filter works)
$ rtk rewrite 'df -h' # -> "rtk df -h" (works)
RTK_NO_TOML is unset. A real custom filter (match_command='iconv.*UTF-16' + a replace rule) likewise never fires on iconv ... commands, while it's trivially correct when applied manually.
Also (related, may be by-design)
rtk discover scans the CC transcript (the raw pre-hook command string) and lists e.g. grep -n as "missed -> rtk grep (existing)". But the hook already rewrites those at exec time, so discover's "missed M tokens" / "adoption %" double-counts already-captured savings (verified: raw cat/grep increment the rtk read/rtk grep counters 1:1). Consider netting out hook-captured commands using history.db so "missed" reflects only genuinely-unhandled commands.
Expected
Trusted/global custom filters should be applied by the hook like bundled ones (or rtk pipe -f <customname> should accept custom filter names — it currently rejects anything not built-in). Without this, user-defined filters are non-functional for their primary purpose.
rtk v0.37.2, macOS (Apple Silicon, homebrew)
Custom TOML filters — defined in the global
filters.tomlor artk trust'd project-local.rtk/filters.toml— parse and passrtk verify, but are never applied by the Claude Code hook. Only compiled-in/bundled filters get rewritten.Repro
Add a custom filter (global or trusted project-local):
RTK_NO_TOMLis unset. A real custom filter (match_command='iconv.*UTF-16'+ areplacerule) likewise never fires oniconv ...commands, while it's trivially correct when applied manually.Also (related, may be by-design)
rtk discoverscans the CC transcript (the raw pre-hook command string) and lists e.g.grep -nas "missed -> rtk grep (existing)". But the hook already rewrites those at exec time, sodiscover's "missed M tokens" / "adoption %" double-counts already-captured savings (verified: rawcat/grepincrement thertk read/rtk grepcounters 1:1). Consider netting out hook-captured commands using history.db so "missed" reflects only genuinely-unhandled commands.Expected
Trusted/global custom filters should be applied by the hook like bundled ones (or
rtk pipe -f <customname>should accept custom filter names — it currently rejects anything not built-in). Without this, user-defined filters are non-functional for their primary purpose.