# ast-grep

21 Hacker News commenters recommended ast-grep and 3 criticized it, November 2025 to November 2026. It was recommended in 9 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** A syntax-aware command-line tool for searching and refactoring code without regex headaches, which people also expose to AI agents as a skill. Some report mixed results.

## Why people recommend it

- Efficient syntax-aware code refactoring (5 comments): "an AST-aware CLI that can search and refactor code -- and you can expose it to your AI agent using a skill" ([source](https://news.ycombinator.com/item?id=47196638)) "CLI tools that effectively give me the things an IDE would offer such as astgrep for refactoring" ([source](https://news.ycombinator.com/item?id=48120357)) "making these refactors with ast-grep is quite efficient" ([source](https://news.ycombinator.com/item?id=48978866))
- Useful as an AI agent skill (4 comments): "an AST-aware CLI that can search and refactor code -- and you can expose it to your AI agent using a skill" ([source](https://news.ycombinator.com/item?id=47196638)) "Using ast-grep as a skill in claude code makes it a lot easier to edit code as well." ([source](https://news.ycombinator.com/item?id=46583788)) "The only useful generic skill I have is the ast-grep one." ([source](https://news.ycombinator.com/item?id=49597662))
- Builds linters and deterministic repo maps (3 comments): "It is better to build the repomap deterministically using something like ast-grep" ([source](https://news.ycombinator.com/item?id=46988559)) "write a poor man's linter using ast-grep" ([source](https://news.ycombinator.com/item?id=46797924)) "bridges the linter gaps nicely" ([source](https://news.ycombinator.com/item?id=47454748))

## Alternatives hackers recommend

- [ripgrep](https://hackerapproved.com/p/ripgrep.md): 122 recommend
- [Semble](https://hackerapproved.com/p/semble.md): 20 recommend
- [Graft (Claude Code hooks)](https://hackerapproved.com/p/graft.md): 13 recommend
- [Lat.md](https://hackerapproved.com/p/lat-md.md): 11 recommend
- [Ory Lumen](https://hackerapproved.com/p/lumen.md): 10 recommend

## Cite as

Hacker Approved, "ast-grep", https://hackerapproved.com/p/ast-grep/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
