ast-grep

Structural search and rewrite tool for code — find and modify code patterns across 20+ languages using AST syntax.

Visit Website
ast-grep.github.io
Verified API available
Quick facts
What is it Structural search and rewrite tool for code — find and modify code patterns across 20+ languages using AST syntax.
Pricing Unknown
Platform Desktop Application
API Yes
Best for finding code patterns across large codebases, automated code refactoring
Domain registered 2013

Data updated Aug. 1, 2026

What does ast-grep do?

ast-grep is a command-line tool that helps developers find and modify code patterns using abstract syntax trees instead of regular expressions. It works by parsing code into ASTs and matching patterns based on the actual syntax structure of programming languages. This approach allows for more precise code searching and transformation than traditional text-based tools like grep or sed.

The tool supports over 20 programming languages out of the box, including JavaScript, TypeScript, Python, Rust, and Java, with the ability to load custom tree-sitter parsers for additional languages. It offers multiple usage modes from simple command-line operations to a full programmatic Node.js API. The Rust-based parallel processing engine ensures fast performance even when scanning thousands of files, and it includes practical features like interactive codemod previews and a language server.

ast-grep benefits developers working on large codebases who need to perform systematic code changes, create custom linting rules, or maintain consistent code patterns across multiple projects. Real-world use cases include refactoring code to new patterns, eliminating anti-patterns, automating code style enforcement, and preparing code for major library migrations.

#code refactoring#code search#developer productivity#multi-language

Key features

What makes it stand out
01
Syntax-aware search and replace using AST patterns instead of regex
02
Linting capabilities with customizable rules and pretty error reporting
03
Programmatic Node.js API for traversing and manipulating syntax trees
04
Parallel Rust backend for blazing fast performance across thousands of files
05
Polyglot support for 20+ languages with custom language loading

Who is ast-grep for?

Who benefits most from this tool
finding code patterns across large codebases
automated code refactoring
custom lint rule creation

Trust & presence

Domain Domain registered 2013

Similar tools

GREB by Cheetah AI Verified Developer Tools

AI-powered code search tool that understands natural language queries and integrates with coding assistants like Claude and Cursor.

Regexgpt Verified Developer Tools

Generate regex patterns from text examples and natural language descriptions.

Refraction AI Verified Developer Tools

AI-powered code generation tool that creates unit tests, documentation, and refactors code across 56 programming languages.

Termdock Verified Developer Tools

Terminal-centric AI development environment — manage multiple workspaces, terminals, and AI CLI tools in one interface

Steer Verified AI Email Assistant

Native desktop assistant that fixes spelling and improves writing tone in any app with quick shortcuts.

TestSprite Verified Testing

AI testing agent that explores your live app, finds bugs, and lets your coding agent fix them automatically

AutoRegex Verified Developer Tools

AI tool that converts plain English descriptions into regular expressions instantly — no regex knowledge required.

CREV Verified Developer Tools

CLI tool that bundles your codebase and gets AI-powered code reviews directly from your terminal.

Share X LinkedIn Telegram
ast-grep Visit