What the tech

Search

/ opens search from anywhere. Esc closes it.

Tools

Get the newsletter

ast-grep: a Claude Code skill by ast-grep

Official

For developers who need to find code by its structure, like async functions without try-catch. Skip it if plain text search already finds what you need.

The skill's text changed on Nov 4, 2026, after we last read it. Our description may be behind.

Score
73of 100
Rank
#149of 239
Installs
19.6Kon skills.sh
Security
Clear 5 scanners
Updated
2026
Context
~108tokens always

Install

npx skills add https://github.com/ast-grep/agent-skill --skill ast-grep

Run it in your terminal. View the source

Using the Claude app rather than Claude Code? You can add a skill there too. How to add it in the app

What does ast-grep do?

ast-grep is a skill that helps Claude turn a plain request into an ast-grep rule for searching code by its syntax tree rather than its text. It first pins down the pattern and language, writes a small example file, then drafts a YAML rule using pattern, kind, relational rules like has and inside with stopBy: end, and all, any or not logic. It tests the rule on the example with ast-grep scan, uses --debug-query to inspect the tree when nothing matches, and only then runs it on your project. It also explains the --json output format and shell escaping for inline rules.

When should you use ast-grep?

Use it when

  • You need every call matching a code shape across a repo
  • Grep returns too many false matches
  • You want a reusable lint-style rule

Skip it when

  • A simple text search answers the question
  • You can't install the ast-grep CLI

What it needs and what it can touch

You need

  • The ast-grep CLI

What it can do

  • Runs shell commands (ast-grep run, ast-grep scan)
  • Writes temporary example and rule files

From reading its instructions, not from running it.

Why it scores 73

Strongest on upkeep (100 of 100), weakest on adoption (40).

  • Adoption35 points 40
  • Upkeep20 points 100
  • Trust20 points 85
  • Quality15 points 100
  • Reader answers10 points Not enough answers yet, so this does not count

How the formula works

Is ast-grep safe to install?

Every scanner that checked it passed it. Scanners often miss what other scanners catch, and a skill can change after a scan. Read its source before you install it.

ScannerResultDate
Gen Agent Trust HubPassedNov 4, 2026
SocketPassedNov 4, 2026
SnykLow riskNov 4, 2026
RunlayerPassedFeb 26, 2026
ZeroLeaksPassedApr 16, 2026

Details

Installs
19,597
Repository stars
903
Last repository change
Tokens always loaded
about 108
Tokens when used
about 2,641
License
Not stated
Data confidence
High

Alternatives to ast-grep

All skills for this job