The best ast-grep alternatives
3 tools that do a similar job to ast-grep, 3 of them open source. Each entry says what it does and who it suits, so you can pick the one that fits instead of the most famous.
You're replacing
ast-grepA command-line tool that searches, lints, and rewrites code by its syntax structure, not plain text.
- 1

jscodeshift
Open source · MIT · ★ 10k
A toolkit for running automated code-rewriting scripts (codemods) across many JavaScript or TypeScript files.
Best for: Engineers migrating a large JavaScript or TypeScript codebase to a new API or syntax; Teams that need the same mechanical refactor applied consistently across many files
- 2

Ruff
Open source · MIT · ★ 50.4k
A very fast Python linter and code formatter, written in Rust.
Best for: Python developers who want one tool for linting and formatting; Teams with large Python codebases where slow checks are a problem
- 3

broot
Open source · MIT · ★ 13.1k
A terminal tool to browse, search, and manage directory trees without losing the overview.
Best for: Developers who work in a terminal and often jump between project folders; People with large directories who find the tree command produces too much output
How we pick: tools in the same category that solve the same problem, projects that name each other as alternatives, and open-source projects that describe themselves as an alternative to ast-grep. We don't take payment for placement.