rtk-ai/rtk

feat(hook): add fd rewrite rule to compact output

Open

#1.668 geöffnet am 1. Mai 2026

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clieffort-mediumenhancementhelp wantedpriority:low

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)

Beschreibung

Problem

fd is commonly used as a find replacement in Claude Code sessions (via CLAUDE.md rules). RTK rewrites find to rtk find (compact tree output), but fd passes through unmodified.

Real-world example:

  • fd '\.py$' /path -> 433 lines raw output
  • rtk find /path -name '*.py' -> 17 lines (compact tree)

That's a 96% reduction that fd users miss entirely.

Proposed solution

Option A: Add rtk fd subcommand that wraps fd and compacts the output (same tree format as rtk find).

Option B: Add a hook rewrite rule mapping fd -> rtk find with argument translation (fd 'pattern' -> rtk find . -name 'pattern').

Option A is cleaner since fd and find have different argument syntax.

Context

rtk hook check "fd '*.py'" returns "No rewrite" today. The [hooks] config section only has exclude_commands, no custom rewrite mappings.

Contributor Guide