rtk-ai/rtk

rewrite: add fd (find) and sd (sed) to rewrite registry

Open

#1,759 opened on May 7, 2026

View on GitHub
 (1 comment) (2 reactions) (0 assignees)Rust (2,914 forks)batch import
area:clienhancementhelp wantedpriority:medium

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (Avg merge 11d 1h) (45 merged PRs in 30d)

Description

Summary

fd and sd are vastly superior alternatives to find and sed for AI agents:

  • Agents frequently write broken find commands (complex flag escaping, -not -path vs ! -path portability)
  • Agents frequently write broken sed commands (POSIX regex escaping, -i portability between GNU/BSD)
  • fd has simpler syntax, respects .gitignore by default, parallel traversal
  • sd uses standard regex (no POSIX escape hell), simpler syntax

Proposed rewrite rules

find . -name "*.ts"                          → fd -e ts
find . -name "*.ts" -not -path "*/node_modules/*"  → fd -e ts --exclude node_modules
sed -i "s/foo/bar/g" file.txt               → sd foo bar file.txt
sed "s/foo/bar/g" file.txt                  → sd foo bar file.txt

Notes

  • rtk find already exists as a compact-output wrapper for native find — this would be a separate rewrite rule (like how rtk git wraps git but rg rewrites grep)
  • Both tools are widely available: brew install fd sd / apt install fd-find sd
  • Guards needed: only rewrite when fd/sd are in PATH

Context

Discovered while setting up RTK across Claude Code, Codex, Gemini CLI, and opencode. The find and sed rewrite gap is the most common agent error class not currently covered by RTK.

Contributor guide