Bug
rtk discover classifies /usr/bin/grep as an unhandled command instead of mapping it to rtk grep.
Reproduce
Run rtk discover on a session where Claude Code used /usr/bin/grep (full path). It appears in "TOP UNHANDLED COMMANDS" instead of "MISSED SAVINGS" with rtk grep as equivalent.
Real example
/usr/bin/grep 7 /usr/bin/grep -rni "twitch" /Users/chr..
Should be classified as:
/usr/bin/grep 7 rtk grep existing ~XXX tokens
Root cause
The discover classifier in src/discover/ likely matches on the command name only (grep), not on absolute paths (/usr/bin/grep, /bin/grep).
Fix
Normalize absolute binary paths before classification. Strip leading path components for well-known binaries:
/usr/bin/grep → grep
/bin/ls → ls
/usr/local/bin/git → git
This affects any command called via full path in Claude Code bash tool calls.
Impact
7 occurrences missed in one session. Likely affects any user on macOS where Claude Code sometimes resolves to full paths.
Bug
rtk discoverclassifies/usr/bin/grepas an unhandled command instead of mapping it tortk grep.Reproduce
Run
rtk discoveron a session where Claude Code used/usr/bin/grep(full path). It appears in "TOP UNHANDLED COMMANDS" instead of "MISSED SAVINGS" withrtk grepas equivalent.Real example
Should be classified as:
Root cause
The discover classifier in
src/discover/likely matches on the command name only (grep), not on absolute paths (/usr/bin/grep,/bin/grep).Fix
Normalize absolute binary paths before classification. Strip leading path components for well-known binaries:
/usr/bin/grep→grep/bin/ls→ls/usr/local/bin/git→gitThis affects any command called via full path in Claude Code bash tool calls.
Impact
7 occurrences missed in one session. Likely affects any user on macOS where Claude Code sometimes resolves to full paths.