#3434·rtk

`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

Author: HetCreepCreated Aug 4, 2026Updated Sep 16, 2026
Labelsbugpriority:higharea:cliplatform:windows

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)

  1. 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.
  2. On Windows, either detect that the resolved tree is tree.com (its output and flags are distinct) and fall back to rtk's own walker, or skip the external tool entirely there. tool_exists matching an unrelated same-named program is worth checking for other commands too — find and sort have 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.