tool-fd
When To Use
- Locate files by name pattern, extension, or type.
- Replace verbose find commands for common file discovery tasks.
- Feed clean path lists into tools like fzf, xargs, and sd.
Trusted Commands
fd "pattern"
fd -e py
fd -g "pyproject.toml"
fd --hidden "pattern"
fd -t f "pattern"
fd -t d "pattern"
fd -e md -x wc -l {}
Safe Defaults
- Use
-t for-t dto constrain result type. - Use
-gfor glob semantics and plain expectations. - Prefer
fdand fallback tofdfindon Debian/Ubuntu.
Common Pitfalls
- fd uses regex by default, not shell glob patterns.
- Ignored files are skipped unless explicitly included.
- Distro binary naming differences (
fdvsfdfind) can break scripts.
Output Interpretation
- One path per line, relative to the search root.
- Empty output with exit 0 can be valid for narrow patterns.
Why It Matters For Agents
-xenables safe per-file batch actions without manual loops.- It is a high-signal way to enumerate candidate files quickly.
Repo Conventions
- Prefer fd over recursive listing for path discovery.
- Respect ignore rules unless task scope says otherwise.
Trigger Examples
- Should trigger: "Find all markdown files under docs quickly."
- Should trigger: "List only directories matching
testrecursively." - Should not trigger: "Transform JSON output from an API."