Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

bfs

$ bfs Community Med Risk
Tavian Barnes · Files & Search · 0BSD · macos / linux

bfs is a fast breadth-first drop-in replacement for UNIX find that discovers top-level files before descending into deep subdirectories. It adds -exclude, -limit N, -nocolor, -printf, and NO_COLOR support while staying compatible with POSIX/GNU find expressions.

FCRS-1.0 Score
83 /100
Good
Medium Confidence
Zero-Friction Install
brew install bfs
CLI vs MCP Decision CLI Only

Fast local breadth-first directory discovery (bfs); direct execution avoids MCP overhead.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Non-interactive with -nocolor / NO_COLOR, -limit, -exclude, and -printf custom formatting, though it has no --json output.

  • Supports -nocolor, -limit N, -exclude, and -printf
  • Plain-text path output; no --json flag
Trust & Safety 22 / 25

Read-only traversal by default, though find-compatible -delete and -exec flags can delete files or run commands if invoked.

  • Read-only unless -delete or -exec is explicitly passed
Setup & Portability 13 / 15

Fast C binary available via brew install bfs and Linux distro packages; targets POSIX/Unix hosts (no native Win32 build).

  • Packaged on Homebrew and major Linux/BSD distros
Utility & Efficiency 13 / 15

Breadth-first traversal + -exclude + -limit locates shallow config/manifest files dramatically faster than depth-first find.

  • Multi-threaded/async I/O breadth-first search (-S bfs)
Maintenance & Lineage 9 / 10

Actively maintained by Tavian Barnes under the permissive 0BSD license.

  • Active tavianator/bfs repository
Docs & Verifiability 8 / 10

Detailed bfs(1) man page and project documentation covering all find extensions.

  • Comprehensive man page and tavianator.com docs

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; local filesystem traversal utility.

Side Effects
Read-Only Local Write Destructive
Cost & Quotas

100% free, offline, and open-source (0BSD).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# bfs Agent Rules
- Always pass `-nocolor` (or `NO_COLOR=1`) and `-exclude -name .git -exclude -name node_modules`.
- Do NOT pass `-delete` or `-exec` without explicit user approval; use `-limit <N>` to bound large searches.

Agent-Ready Command Recipes

Safe Read-Only Queries

Find files breadth-first excluding .git and node_modules
bfs . -nocolor -exclude -name .git -exclude -name node_modules -type f -limit 50

Traverses shallow files first, skips .git and node_modules with -exclude, and stops after 50 matches (-limit).

Format file metadata with -printf
bfs src -nocolor -type f -printf '%s\t%p\n'

Outputs tab-separated byte size and path records without spawning stat subprocesses.

Strengths for Agents

  • + Breadth-first order with -limit finds shallow project files instantly without descending deep trees.
  • + -exclude syntax is far simpler and less error-prone than find's -prune expressions.

Caveats & Pitfalls

  • ! POSIX/Unix only (macOS, Linux, BSD); Windows requires WSL or MSYS2.
  • ! Lacks --json output, and inherits find's -delete / -exec hazards if misused.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI