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

fastmod

$ fastmod Community Med Risk
Meta · Files & Search · Apache-2.0 · macos / linux / windows

fastmod is Meta's Rust replacement for legacy Python codemod, performing fast .gitignore-aware multi-file regex search-and-replace. Headless agents must pass --accept-all (-a) to avoid interactive TTY prompts, which writes changes immediately in-place with no --dry-run flag.

FCRS-1.0 Score
70 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install fastmod
CLI vs MCP Decision CLI Only

Direct local regex replacement; prefer sd -p or ast-grep when an agent needs a built-in dry-run preview.

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 15 / 25

Interactive prompt by default blocks headless shells unless --accept-all is passed; lacks both --dry-run and --json output.

  • Interactive confirmation is the default mode
  • No --dry-run or --json flags
Trust & Safety 16 / 25

--accept-all immediately overwrites matched files in-place without a preview/dry-run mode, forcing reliance on Git to revert mistakes.

  • Non-interactive --accept-all mutates files directly with no dry-run flag
Setup & Portability 14 / 15

Static Rust binary available via brew install fastmod, cargo install fastmod, and GitHub releases.

  • Cross-platform Rust binary
Utility & Efficiency 11 / 15

Very fast .gitignore-aware regex replacement across large repos, though sd -p or ast-grep offer safer agent ergonomics.

  • Parallel Rust traversal respecting .gitignore and --extensions
Maintenance & Lineage 7 / 10

Meta facebookincubator OSS project under Apache-2.0 with minimal recent churn.

  • Stable facebookincubator/fastmod repository
Docs & Verifiability 7 / 10

Concise README and --help documenting Rust regex syntax (${1} captures) and flags.

  • README examples and --help output

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates directly on local workspace files.

Side Effects
Local Write
Cost & Quotas

100% free, offline, and open-source (Apache-2.0).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# fastmod Agent Rules
- NEVER run `fastmod` without `--accept-all` (`-a`) in headless shells (default interactive mode hangs).
- Because `fastmod` has NO `--dry-run` flag, verify matches with `rg` first and only run on a clean Git working tree.

Agent-Ready Command Recipes

Safe Read-Only Queries

Preview regex matches with ripgrep before running fastmod
rg -n "oldFunction\(" src/

Because fastmod has no --dry-run flag, inspect exact matches with rg before invoking fastmod --accept-all.

Controlled Writes & Previews

Apply multi-file regex replacement non-interactively
fastmod --accept-all --extensions ts,tsx -d src/ 'oldApi\((.*)\)' 'newApi(${1})'

Replaces matches across src/ without interactive prompts; ensure git status is clean first so git diff can verify changes.

Strengths for Agents

  • + Fast parallel Rust execution respecting .gitignore, -g globs, and --extensions.
  • + Clean ${1} capture group syntax powered by Rust regex.

Caveats & Pitfalls

  • ! Default invocation prompts interactively per hunk; requires --accept-all for headless runs.
  • ! Lacks --dry-run and --json: --accept-all writes changes straight to disk.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI