Repository navigation
Description
Summary
rtk find <dir> -iname "<pattern>" silently drops a real, matching result when the match lives inside a directory listed in .gitignore — even when that specific file is force-tracked by git (git add -f) and genuinely matches the -iname pattern. The dropped result is replaced with a (N filtered) line pointing at a ~/Library/Application Support/rtk/tee/<ts>_find-hidden.log file, and that log does not contain the missing match — it just contains the ignored directory name, so there is no way to recover the real result from it.
rtk proxy find ... (raw passthrough) returns the correct, complete result in the same repo.
Environment
rtk --version:rtk 0.50.0- Installed via Homebrew (
brew info rtk→stable 0.50.0 (bottled)) - macOS (Darwin 25.6.0)
Minimal repro
mkdir repro && cd repro
git init -q
printf 'node_modules/\n*.log\n' > .gitignore
mkdir -p src && echo "x = 1" > src/target.py
git add -A && git commit -q -m init
# a file inside a gitignored dir, but force-tracked (a common real-world
# pattern: gitignore a whole data/ dir wholesale, then force-add specific
# files that should be tracked)
mkdir -p data/subdir && echo "y = 2" > data/subdir/target.py
echo 'data/' >> .gitignore
git add -f data/subdir/target.py
git add .gitignore
git commit -q -m "add gitignored-but-forced file"
echo "=== rtk find (direct) ==="
rtk find . -iname "target*"
echo
echo "=== rtk proxy find (control) ==="
rtk proxy find . -iname "target*"Actual output
=== rtk find (direct) ===
src/target.py
... (1 filtered)
[see remaining: tail -n +1 "$HOME/Library/Application Support/rtk/tee/<ts>_find-hidden.log"]
=== rtk proxy find (control) ===
./data/subdir/target.py
./src/target.py
cat of the referenced find-hidden.log contains only:
data/
— not the actual matched path, so the "see remaining" pointer doesn't let the caller recover the dropped result at all.
Expected output
rtk find should return the same two matches rtk proxy find returns (or, at minimum, if suppressing gitignored-directory matches is intentional filtering behavior, the "filtered" pointer should show what was filtered, not an unrelated directory-name log with no path in it).
Impact
This is silent data loss for an explicit, deterministic query (-iname with a specific pattern) — not a generic "too much output, let me summarize" heuristic. It's especially dangerous in the pattern shown above (gitignore a directory wholesale, then force-track specific files inside it for governance/audit reasons), where the whole point of the force-add is that those files are supposed to be discoverable and it silently looks like they don't exist.
Workaround: rtk proxy <command> for raw passthrough.
Additional context
This is a recurring bug class, not a one-off: a similarly garbled result (same find-hidden.log artifact, unrelated content) was also observed on grep -rn in an earlier rtk version, well before 0.50.0. Confirmed the find -iname case still reproduces identically on the current 0.50.0 release, so the underlying issue predates this version and the update didn't fix it.
Activity
rtk-wshm-sync-bot commentedon Sep 25, 2026
🔍 Automated Triage
bughighSummary
rtk find silently drops a valid match inside a gitignored-but-force-tracked directory, with a misleading/unrecoverable filtered-log pointer; rtk proxy find works correctly.
📁 Relevant files
src/discover/find.rssrc/filter/find.rsSuggested Actions
rtk proxy rgsilently corrupts matched text: replaces "cypress" with "n" #4212 andgrep/rgpiped intohead -N/tail -Nreturn the wrong lines after the #3343 safe-consumer rewrite #4207 — part of a recurring class of silent/corrupted output-filtering bugsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(find): include force-tracked files under gitignored directories
KuSh commentedon Sep 26, 2026
Closing as a duplicate of #2995, which tracks
rtk findpruning gitignored paths under native find flags, including files that git still tracks inside an ignored directory. Your observation that the recall log names only the ignored directory, not the dropped match, is useful for that fix, so please add it on #2995 and follow up there.