Repository navigation
Description
Two findings from comparing rtk against the real tools.
Provenance: AI-assisted source audit, human-directed, at v0.44.2 (700bdde). Both reproduced on Windows with the shipped binary; outputs verbatim.
1. rtk ls hides directories without saying so
A directory containing build coverage dist node_modules normaldir target venv:
$ ls
build coverage dist node_modules normaldir target venv
$ rtk ls
normaldir/
Six of seven directories are gone. No count, no +N more, nothing.
They do exist, and rtk knows it:
$ rtk ls -a
build/ coverage/ dist/ node_modules/ normaldir/ target/ venv/
$ rtk ls dist
out.js 2B
src/cmds/system/ls.rs:266 filters against NOISE_DIRS (src/core/constants.rs:1-27).
Suppressing node_modules from a listing is a reasonable default. Doing it with no marker is the problem — a reader concludes the build has not run, the venv was never created, or dist/ does not exist. That conclusion is wrong and nothing in the output hints at it.
Contrast rtk's own behaviour elsewhere: the result cap in rtk find prints +450 more, and rtk read prints [N more lines]. The convention exists; this path just does not use it.
A single line — (6 build/tooling directories hidden; -a to show) — would preserve the compression and remove the false impression.
2. rtk tree on Windows invokes tree.com with Unix flags
$ rtk tree
Too many parameters - node_modules|.git|target|__pycache__|.next|dist|build|.cache|…
exit=0
src/cmds/system/tree.rs:15 checks tool_exists("tree"), which matches Windows' built-in tree.com — an unrelated program that takes no -I flag. :25-32 then passes the ignore pattern, and tree.com rejects the whole invocation.
With -a, the same review observed Invalid path - …\-A followed by No subfolders exist in a directory that has eight — an affirmatively wrong statement, also at exit 0.
Both cases exit 0, so a caller sees a successful command that produced an error message as its "output".
.claude/rules/cli-testing.md lists Windows as a supported platform, and the release workflow ships a Windows binary.
Suggested directions (untested — no programmer has reviewed these)
- Emit a one-line notice when entries are suppressed, and mention
-a. Alternatively suppress only inside a project root where those names are unambiguous, and list them normally elsewhere. - On Windows, either detect that the resolved
treeistree.com(its output and flags are distinct) and fall back to rtk's own walker, or skip the external tool entirely there.tool_existsmatching an unrelated same-named program is worth checking for other commands too —findandsorthave Windows built-ins of the same name.
Related
The rtk ls shape here is the same family as #3432's hidden-path filtering in rtk find: a default exclusion that is invisible in the output. They are different code paths (NOISE_DIRS vs the walker's .hidden()), which is why I am filing them separately, but a single convention for "we excluded things, here is how many" would cover both.
Activity
pszymkowiak commentedon Aug 4, 2026
🔍 Automated Triage
bughighSummary
rtk ls silently drops NOISE_DIRS entries with no count/marker, and on Windows rtk tree resolves to the built-in tree.com (which rejects Unix flags like -I/-a) yet still exits 0 while printing an error or a false 'No subfolders exist' — needs a suppression notice in ls and Windows-aware tool detection/fallback in tree.
📁 Relevant files
src/cmds/system/ls.rssrc/core/constants.rssrc/cmds/system/tree.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
HetCreep commentedon Sep 16, 2026
Re-checked this against
developat5e0f92c(confirmed current tip via a freshgit fetchagainst origin). The verdict is now split — one claim is fixed, the other is not.Claim 1 (
rtk lssilently hides noise dirs) — fixed. Thanks for this.src/cmds/system/ls.rs:316-319still filters onNOISE_DIRSmembership (a generic membership check, not hardcoded to the specific names in the original report):but it's no longer silent.
run()now feeds the result intohidden_hint()(ls.rs:117-120), which unconditionally appends a"... (N filtered)"note (ls.rs:154) plus a tee-backed recovery command whenever anything was dropped.git log --oneline 0de9610..5e0f92c -- src/cmds/system/ls.rsshows 5 commits against this file, including67a3576("cap listing with tee tail hint and standard dotfile semantics") anda7e7329("record dot noise dirs under -A and track real args") —git merge-base --is-ancestorputs both strictly after the0de9610checkpoint our prior read of this issue used, so this is a genuine fix landed since, not something missed earlier. The original concern — a reader has no way to tell anything was hidden — no longer applies. Fine to treat this half as closed.Claim 2 (
rtk treefeeds Unix-I/-ato Windows'tree.com) — still open. Please don't close this issue.src/cmds/system/tree.rshas zero commits in the same range (git log --oneline 0de9610..5e0f92c -- src/cmds/system/tree.rsis empty), and the mechanism is unchanged from the original report:tree.rs:15gates ontool_exists("tree"), which iswhich::which(name).is_ok()(core/utils.rs:602) and is documented in its own comment as "PATHEXT-aware on Windows" — on Windows that resolves to the OS's built-intree.com, not GNU tree.tree.rs:27-33unconditionally appends-I <NOISE_DIRS joined with |>unless the caller already passed-a/--all/-I/--ignore=.tree.rsnorrunner::run_filtered(src/core/runner.rs, which has no Windows-specific branch anywhere in it) checks the target OS or inspects the child's stdout before trusting its exit code.tree.comdoesn't recognize-I/-a— the flags this code always injects reach a binary that can't parse them, and nothing in the pipeline catches that. The exit-0-with-wrong-output behavior described in the original report is still live on this exact code path.Also correcting our own citation while we're here: the original report pointed to
NOISE_DIRSatsrc/core/constants.rs:1-27. That was wrong at the time it was written, not something that changed since —NOISE_DIRShas always lived atsrc/cmds/system/constants.rs:1(a single definition, confirmed by grep).src/core/constants.rsholds unrelated constants (RTK_DATA_DIR,HISTORY_DB, etc.). Flagging it since claim 2 above cites the same constant.This pass is based on reading the code and commit history at
5e0f92c, not on building or running the binary.HetCreep commentedon Oct 14, 2026
Re-checked on v1.0.0 (stable, 2026-10-13): the official release binary plus the v1.0.0 source. Provenance: AI-assisted check, human-directed. "ran" = executed against
rtk 1.0.0with a control; "read" = verified from source only.Fixed (ran): the
lshalf.rtk lsin a directory withbuild coverage dist node_modules target venvnow printsnormaldir/,... (6 filtered)and[+6 hidden: rtk recall ...], so the omission is no longer silent. Thanks.Still live (ran on Windows):
rtk treefeeds Unix flags toC:\Windows\System32\tree.com:rtk treeexits 0 withToo many parameters - node_modules|.git|target|...,rtk tree -aexits 0 withInvalid path - ...\-A/No subfolders exist,rtk tree -L 1the same. Control:tree /Flists the directory fine.src/cmds/system/tree.rs:16still usestool_exists("tree")(which::which) with notree.comguard, and-Iis still pushed at:27-31.PranjalAgarwal01 commentedon Oct 28, 2026
Confirming on Windows 11 + PowerShell 7 with RTK 1.1.0:
rtk ls→Failed to resolve 'ls' via PATH ... Binary 'ls' not found on PATHrtk psandrtk wc→ the same “binary not found” failurertk tree→ Windowstree.com:Too many parameters - node_modules|.git|target|...This is especially visible through the OpenCode plugin: it rewrites
ls/ps/wc/treebefore execution, so a working PowerShell alias becomes a failed command.Local workaround:
[hooks] exclude_commands = ["ls", "tree", "wc", "ps", "wget", "diff"].The native Windows/PowerShell routing PRs (#2875, #3301, #2728) would address this. Please also make the rewrite host-aware so aliases without native binaries are left untouched on Windows.
KuSh commentedon Oct 31, 2026
Re-checked on v1.1.0 and develop:
lshalf is fixed since v1.0.0, as confirmed in the 10-14 comment: hidden noise directories are counted (... (6 filtered)) with a recall hint. On develop, after fix(ls): hold a bare listing to what ls prints, not to the long listing rtk asks for #4833 (not in a release yet),rtk lslists all seven directories of the original example.treehalf is unchanged:src/cmds/system/tree.rsstill gates ontool_exists("tree"), which resolves totree.comon Windows, and still appends-I <noise dirs>. This is read from the code (no Windows host here); the 10-28 comment shows the sameToo many parameterson 1.1.0.ls,psandwc"binary not found" failures in the 10-28 comment are a different defect (PowerShell aliases with no executable onPATH), covered by [BUG] RTK Windows PowerShell Compatibility Gaps #1248.Narrowing this issue to the
treehalf would match what is left, for example "rtk treeon Windows passes Unix flags to tree.com and reports its errors as success".[-]`rtk ls` silently omits build/dist/target/coverage/venv/node_modules — no count, no marker — and `rtk tree` feeds Unix flags to Windows' `tree.com`, reporting "No subfolders exist" as success[/-][+]`rtk tree` on Windows passes Unix flags to tree.com and reports its errors as success[/+]