ast-grep
Structural search and rewrite tool for code — find and modify code patterns across 20+ languages using AST syntax.
| 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.
Key features
What makes it stand outWho is ast-grep for?
Who benefits most from this toolTrust & presence
Similar tools
AI-powered code search tool that understands natural language queries and integrates with coding assistants like Claude and Cursor.
Generate regex patterns from text examples and natural language descriptions.
AI-powered code generation tool that creates unit tests, documentation, and refactors code across 56 programming languages.
Terminal-centric AI development environment — manage multiple workspaces, terminals, and AI CLI tools in one interface
Native desktop assistant that fixes spelling and improves writing tone in any app with quick shortcuts.
AI testing agent that explores your live app, finds bugs, and lets your coding agent fix them automatically
AI tool that converts plain English descriptions into regular expressions instantly — no regex knowledge required.
CLI tool that bundles your codebase and gets AI-powered code reviews directly from your terminal.