-
Notifications
You must be signed in to change notification settings - Fork 361
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working