ast-grep vs Sourcery
ast-grep
ast-grep.github.ioSourcery
sourcery.aiSide by side
| Figure | ast-grep | Sourcery |
|---|---|---|
| Price from | Free | $12/mo |
| Free plan | Yes | Yes |
| Free trial | — | Yes |
| Open source | — | — |
| Web | Yes | Yes |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| API | Yes | Yes |
| Self-hosted | — | Yes |
| Plans published | 1 | 4 |
| Spec score · Code Refactoring Tools | 9.1 (#1) | 8.6 (#3) |
| Custom rules | Rules are written in YAML and can combine pattern, kind, regex, relational, and composite matching conditions. | Users can define project-wide review rules in a .sourcery.yaml file and use public rulesets such as the Google Python Style Guide. |
| Integrations | The documentation describes editor integrations, including a VS Code extension and language server support for editors such as Vim and Neovim. | GitHub, GitLab, GitHub Enterprise Server, self-hosted GitLab, VS Code, Cursor, Windsurf, JetBrains, Jira |
| Support | The project directs users with questions or issues to GitHub or Discord and also points to Stack Overflow and Reddit. | Support is offered through in-app chat and email, with documentation covering setup, reviews, scanning, IDEs, administration, API, and compliance. |
| Support channels | The site links to Discord, Stack Overflow, and Reddit community channels. | email, docs |
| What it does | ast-grep is a fast, polyglot tool for structural code search, linting, and large-scale rewriting. | Sourcery automatically reviews pull requests and posts summaries, review comments, and suggested fixes. |
Plans
In their own words
ast-grep
ast-grep is a free, open-source tool for structural code search, linting, and rewriting. It matches patterns against syntax-tree nodes, helping developers locate and change code across a codebase rather than searching plain text. Its CLI can preview and apply rewrites interactively, and scan configurable YAML rules with error, warning, info, or hint severity. Rules can combine pattern, kind, regex, relational, and composite conditions, and CLI commands help create and snapshot-test them. The project says it supports more than 20 languages and can load custom languages. JavaScript and WebAssembly APIs allow programmatic syntax-tree work; a browser playground offers a way to try patterns without local installation. Editor options include a VS Code extension and language-server setups, including for Vim and Neovim. The tool is free, has a web interface, and is distributed through package managers or built from source. Its FAQ notes that some advanced static-analysis information is unsupported, and one rule cannot target multiple languages at once.
Sourcery
Sourcery reviews pull requests with AI, returning a summary, review comments and suggested fixes within minutes. Users can apply a suggestion as a change and commit it to the pull request. Security checks cover committed secrets, static-analysis vulnerabilities, infrastructure-as-code misconfigurations, dependencies and licenses. The extension works in VS Code, Cursor, Windsurf and JetBrains editors, and Sourcery supports GitHub, GitLab, GitHub Enterprise Server and self-hosted GitLab. Open Source checks security on every pull request; Open Source and Pro also scan twice a week, while Team includes nightly scans. The public REST API, for listing, reading, counting and bulk-updating security findings and groups, is a Team feature. Open Source is free; Pro is $12 a month billed annually, or $15 per developer per month billed monthly. Team is $24 a month billed annually, or $30 per developer per month billed monthly. A 14-day Team-feature trial is available organization-wide after installation, without a credit card. Sourcery says it does not retain customer code after reviews or use it to train models.