Hacker ApprovedDepartments

ast-grep

Hacker Approved

Ranked 2 of 15 code search tools by recommenders

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.

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.

24 people gave an opinion

recommend it
21
criticize it
3
approval share
88%
Each figure is one person. RecommendsCriticizes

Recommended in 9 of 13 months

  1. November 2025: recommended
  2. December 2025: not recommended
  3. January 2026: recommended
  4. February 2026: recommended
  5. March 2026: recommended
  6. April 2026: recommended
  7. May 2026: recommended
  8. June 2026: not recommended
  9. July 2026: recommended
  10. August 2026: not recommended
  11. September 2026: recommended
  12. October 2026: recommended
  13. November 2026: not recommended (month in progress)

Why it carries the badge

  • 21 people recommend itNeeds 10 or more, met.
  • 7 recommenders for every criticNeeds 2 to 1 or better, met.
  • Recommended in 9 of 13 monthsNeeds 4 or more, met.

The same three rules apply to every product, and the badge can’t be bought. How the badge works

What people say about it

The reasons people give, with the number of comments that give each one. Open a reason to read what they said.

Why people recommend it

Each mark is one comment

  • Efficient syntax-aware code refactoring

    “an AST-aware CLI that can search and refactor code -- and you can expose it to your AI agent using a skill”

    Comment from 28 Feb 2026 in “Everything Changes, and Nothing Changes”

    “CLI tools that effectively give me the things an IDE would offer such as astgrep for refactoring”

    Comment from 13 May 2026 in “The vi family”

    “making these refactors with ast-grep is quite efficient”

    Comment from 20 Jul 2026 in “Stop Using OpenCode”
  • Useful as an AI agent skill

    “an AST-aware CLI that can search and refactor code -- and you can expose it to your AI agent using a skill”

    Comment from 28 Feb 2026 in “Everything Changes, and Nothing Changes”

    “Using ast-grep as a skill in claude code makes it a lot easier to edit code as well.”

    Comment from 12 Jan 2026 in “Ask HN: What Are You Working On? (January 2026)”

    “The only useful generic skill I have is the ast-grep one.”

    Comment from 7 Sep 2026 in “Ask HN: How do you manage skills files?”
  • Builds linters and deterministic repo maps

    “It is better to build the repomap deterministically using something like ast-grep”

    Comment from 12 Feb 2026 in “Show HN: CodeRLM – Tree-sitter-backed code indexing for LLM agents”

    “write a poor man's linter using ast-grep”

    Comment from 28 Jan 2026 in “Karpathy: A few random notes from Claude coding quite a bit last few weeks”

    “bridges the linter gaps nicely”

    Comment from 20 Mar 2026 in “Be intentional about how AI changes your codebase”

Other code search tools people recommend

The four most recommended other code search tools, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.

ast-grep compared with 4 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
ripgrep1221887%12—Approved
ast-grepThis page21388%9—Approved
Semble20774%4—Approved
Graft (Claude Code hooks)13476%4—Approved
Lat.md11379%3——
See all 15 code search tools, ranked

What people said

25 of the 29 comments that mention it, newest first. Each links to the original comment.

“some general ast-grep rules have pretty much been an absolute necessity”

RecommendsComment from 13 Oct 2026 in “Show HN: Deslop – Oxlint rules for AI-generated TypeScript”

“ast-grep is a fantastic tool.”

RecommendsComment from 27 Sep 2026 in “On caring for user data: NeoVim caused Vim undo files to be deleted”

“The only useful generic skill I have is the ast-grep one.”

RecommendsComment from 7 Sep 2026 in “Ask HN: How do you manage skills files?”

“would be a huge intelligence and performance boost”

RecommendsComment from 4 Sep 2026 in “Grep beats LSP? Why coding agents ignore your fancier tools”

“I like ast-grep and I think the changes are interesting”

RecommendsComment from 27 Jul 2026 in “How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster”

“Really helps with agentic work.”

RecommendsComment from 27 Jul 2026 in “How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster”

“all the performance gains came from optimising for fixed files with no error recovery”

CriticizesComment from 26 Jul 2026 in “How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster”

“making these refactors with ast-grep is quite efficient”

RecommendsComment from 20 Jul 2026 in “Stop Using OpenCode”

“They already know how to use it.”

RecommendsComment from 5 Jul 2026 in “Mouse: Precision Editing Tools for AI Coding Agents”

“saves me from having to memorize that syntax myself”

RecommendsComment from 29 May 2026 in “We should be more tired than the model”

“CLI tools that effectively give me the things an IDE would offer such as astgrep for refactoring”

RecommendsComment from 13 May 2026 in “The vi family”

“perform such mechanical code changes”

RecommendsComment from 21 Apr 2026 in “Less human AI agents, please”

“The proper tool for this is ast-grep (sg)”

RecommendsComment from 21 Apr 2026 in “Less human AI agents, please”

“leverages ast-grep for ast-safe replacement”

RecommendsComment from 5 Apr 2026 in “Writing Lisp Is AI Resistant and I'm Sad”

“llms really mess up on them”

CriticizesComment from 2 Apr 2026 in “The future of code search is not regex – 100x faster than ripgrep”

“bridges the linter gaps nicely”

RecommendsComment from 20 Mar 2026 in “Be intentional about how AI changes your codebase”

“It's syntax-aware so you don't need care about whitespace, indentation etc. Very easy to dip your toes in where a regex would get complex fast”

RecommendsComment from 7 Mar 2026 in “Ki Editor - an editor that operates on the AST”

“The tool itself is solid!”

RecommendsComment from 7 Mar 2026 in “Ki Editor - an editor that operates on the AST”

“an AST-aware CLI that can search and refactor code -- and you can expose it to your AI agent using a skill”

RecommendsComment from 28 Feb 2026 in “Everything Changes, and Nothing Changes”

“allows this for far more languages, since it is based on the tree-sitter parser library”

MixedComment from 21 Feb 2026 in “Coccinelle: The Linux kernel's source-to-source transformation tool”

“It is better to build the repomap deterministically using something like ast-grep”

RecommendsComment from 12 Feb 2026 in “Show HN: CodeRLM – Tree-sitter-backed code indexing for LLM agents”

“write a poor man's linter using ast-grep”

RecommendsComment from 28 Jan 2026 in “Karpathy: A few random notes from Claude coding quite a bit last few weeks”

“I don't see ast-grep as being very useful to an agent.”

CriticizesComment from 16 Jan 2026 in “Ask HN: How are you doing RAG locally?”

“Using ast-grep as a skill in claude code makes it a lot easier to edit code as well.”

RecommendsComment from 12 Jan 2026 in “Ask HN: What Are You Working On? (January 2026)”

“my experience the results are mixed”

MixedComment from 22 Nov 2025 in “Agent design is still hard”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.