You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(discover): a tab between command and subcommand classifies as Supported but never rewrites #4100
Same class as #3995 (absolute-path arm, fixed 2026-09-13): classify_command and the rewrite
disagree about what separates a command from its subcommand.
the rule patterns match \s+ — ^pnpm\s+(exec|i|install|…), ^cargo\s+(build|test|…), …
strip_word_prefix (src/discover/registry.rs:1930) accepts only a literal ASCII space:
So a tab-separated command is classified Supported and then returned unchanged by the hook. rtk discover and rtk session count it as covered; the command streams raw.
Verified on develop (5e0f92cd) with rtk rewrite, tab written as \t:
command
rewrite
git status
rtk git status
git\tstatus
(nothing)
cargo\tbuild
(nothing)
npm\trun build
(nothing)
pnpm\tinstall
(nothing)
Not tool-specific — it is every rule that goes through strip_word_prefix.
A tab really is a valid separator here, so the classify side is the one that is right:
the shell grammar treats space and tab as blanks when tokenising a command line, independent
of IFS. bash -xc $'git\t--version' traces as + git --version and prints git version 2.53.0.
And it reaches the hook. Feeding a PreToolUse payload to rtk hook claude — the tab
survives JSON transport as \t:
tool_input.command
updatedInput.command returned
git status
rtk git status
git\tstatus
(none — unchanged)
pnpm\tinstall
(none — unchanged)
Frequency: low. An agent writing shell almost always uses a single space, so this is a
correctness gap rather than a material source of lost savings — worth closing for the
consistency of the two sides, not urgent.
Found while reviewing #3275 with a differential fuzz asserting classify == Supported(rtk pnpm) ⇒ rewrite fires. Over 6528 generated pnpm spellings it trips
64 times, all tab-separated, and the count is identical on develop and on that PR's head —
so this is pre-existing and #3275 neither adds to it nor fixes it.
A fix should make the two sides share one notion of the boundary rather than widening strip_word_prefix alone: widening only the classify side is what #3275 round 1 had to close,
and widening only the rewrite side would rewrite forms classify still calls Unsupported.
classify_command treats tab as a valid command/subcommand separator but strip_word_prefix (registry.rs:1930) only matches a literal space, so tab-separated commands are classified Supported yet never rewritten — unify the boundary logic used by both sides.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/discover/registry.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
The TOML-filter branch of the rewrite has the same tab problem, through strip_absolute_path: it finds the first word with find(' '), so when the words are separated by tabs the whole command is taken as one word, and a / anywhere in it makes the basename after the last / the thing matched.
hook input
rtk rewrite
jj log src/a.py
rtk jj log src/a.py
jj<TAB>log<TAB>src/a.py
none
make -C src/x
rtk make -C src/x
make<TAB>-C<TAB>src/x
none
Without a / the tab form is rewritten (jj<TAB>log -r @ → rtk jj<TAB>log -r @). Same result on develop 8bb6096 and on #5134's head.
Activity
rtk-wshm-sync-bot commentedon Sep 17, 2026
🔍 Automated Triage
buglowSummary
classify_command treats tab as a valid command/subcommand separator but strip_word_prefix (registry.rs:1930) only matches a literal space, so tab-separated commands are classified Supported yet never rewritten — unify the boundary logic used by both sides.
📁 Relevant files
src/discover/registry.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(discover): split words the way bash does, and pin the rule table (#…
fix(discover): split words the way bash does, and pin the rule table (#…
fix(discover): split words the way bash does, and pin the rule table (#…
fix(discover): split words the way bash does, and pin the rule table (#…
KuSh commentedon Nov 28, 2026
The TOML-filter branch of the rewrite has the same tab problem, through
strip_absolute_path: it finds the first word withfind(' '), so when the words are separated by tabs the whole command is taken as one word, and a/anywhere in it makes the basename after the last/the thing matched.rtk rewritejj log src/a.pyrtk jj log src/a.pyjj<TAB>log<TAB>src/a.pymake -C src/xrtk make -C src/xmake<TAB>-C<TAB>src/xWithout a
/the tab form is rewritten (jj<TAB>log -r @→rtk jj<TAB>log -r @). Same result on develop 8bb6096 and on #5134's head.