Skip to content

Route rg --files to find#1903

Open
LK4D4 wants to merge 1 commit into
rtk-ai:developfrom
LK4D4:codex/fix-rg-files-rewrite
Open

Route rg --files to find#1903
LK4D4 wants to merge 1 commit into
rtk-ai:developfrom
LK4D4:codex/fix-rg-files-rewrite

Conversation

@LK4D4
Copy link
Copy Markdown

@LK4D4 LK4D4 commented May 16, 2026

Summary

  • Rewrite simple rg --files hook invocations to RTK find syntax with explicit --max 50 and --file-type f.
  • Preserve native behavior for unsupported shapes: pipes, extra flags, and multiple roots stay raw.
  • Add regression coverage for simple roots, quoted paths, redirects, transparent prefixes, and conservative skip cases.

Why

rg --files is a common agent command for listing repository files. Right now, rtk rewrite rg --files returns rtk grep --files which doesn't work and only wastes execution.

I opted out for RTK syntax instead of find syntax to give hints to the agent about --max which works really bad with native syntax parser. We also should probably update rtk find --help to explain this stuff more.

Fix #2060

@LK4D4 LK4D4 changed the title fix(rewrite): route rg --files to find Route rg --files to find May 16, 2026
@LK4D4 LK4D4 marked this pull request as ready for review May 16, 2026 11:29
@LK4D4 LK4D4 force-pushed the codex/fix-rg-files-rewrite branch 2 times, most recently from 79d6e49 to 5e6e101 Compare May 23, 2026 16:57
@LK4D4 LK4D4 force-pushed the codex/fix-rg-files-rewrite branch 2 times, most recently from d3c1381 to 02c39ff Compare May 25, 2026 10:13
@LK4D4 LK4D4 force-pushed the codex/fix-rg-files-rewrite branch from 02c39ff to 1abac94 Compare May 30, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rg --files is rewritten to rtk grep --files

1 participant